Rapid7 Vulnerability & Exploit Database

Process Herpaderping evasion technique

Back to Search

Process Herpaderping evasion technique

Created
02/25/2021

Description

This module allows you to generate a Windows executable that evades security products such as Windows Defender, Avast, etc. This uses the Process Herpaderping technique to bypass Antivirus detection. This method consists in obscuring the behavior of a running process by modifying the executable on disk after the image has been mapped in memory (more details https://jxy-s.github.io/herpaderping/). First, the chosen payload is encrypted and embedded in a loader Portable Executable (PE) file. This file is then included in the final executable. Once this executable is launched on the target, the loader PE is dropped on disk and executed, following the Process Herpaderping technique. Note that the name of the file that is being dropped is randomly generated. However, it is possible to configure the destination path from Metasploit (see WRITEABLE_DIR option description). Here is the main workflow: 1. Retrieve the target name (where the PE loader will be dropped). 2. Retrieve the PE loader from the binary and write it on disk. 3. Create a section object and create a process from the mapped image. 4. Modify the file content on disk by copying another (inoffensive) executable or by using random bytes (see REPLACED_WITH_FILE option description). 5. Create the main Thread. The source code is based on Johnny Shaw's PoC (https://github.com/jxy-s/herpaderping).

Author(s)

  • Johnny Shaw
  • Christophe De La Fuente

Platform

Windows

Architectures

x64, x86

Development

Module Options

To display the available options, load the module within the Metasploit console and run the commands 'show options' or 'show advanced':

Time is precious, so I don’t want to do something manually that I can automate. Leveraging the Metasploit Framework when automating any task keeps us from having to re-create the wheel as we can use the existing libraries and focus our efforts where it matters.

– Jim O’Gorman | President, Offensive Security

;