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
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).
- Johnny Shaw
- Christophe De La Fuente