Published March 20, 2019 | Version v2
Journal article Open

[Preprint] Transforming malicious code to ROP gadgets for antivirus evasion

  • 1. University of Piraeus
  • 2. University of Athens

Description

The downside of current polymorphism techniques lies to the fact that they require a writeable code section, either marked as such in the corresponding Portable Executable (PE) section header, or by changing permissions during runtime. Both approaches are identified by AV software as alarming characteristics and/or behavior, since they are rarely found in benign PEs unless they are packed. In this paper we propose the use of Return-Oriented Programming (ROP) as a new way to achieve polymorphism and evade AV software. To this end, we have developed a tool named ROPInjector which, given any piece of shellcode and any non-packed Portable Executable (PE) file, it transforms the shellcode to its ROP equivalent and patches it into (i.e. infects) the PE file. After trying various combinations of evasion techniques, the results show that ROPInjector can evade nearly and completely all antivirus software employed in the online VirusTotal service. The main outcome of this research is the developed algorithms for: a) analysis and manipulation of assembly code on the x86 instruction set, and b) the automatic chaining of gadgets by ROPInjector to form safe, and functional ROP code that is equivalent to a given shellcode.

Files

[Preprint] Transforming Malicious Code to ROP Gadgets for Antivirus Evasion.pdf

Additional details

Funding

FutureTPM – Future Proofing the Connected World: A Quantum-Resistant Trusted Platform Module 779391
European Commission