Crossplatform tool for injecting shellcode into .exe or .dll binaries (x86 and 64).
Linux:
Run make in directory
Windows:
Run compile.bat
-
Prepare the shellcode (for example build raw shellcode with metasploit framework to file; recommend with option EXITFUNC=none if it is possible for resume execution of the original program)
-
Run PE-infector -i <path_for_source_exe_or_dll> -o <patched_exe_or_dll> -s <path_for_shellcode> Support x86 and x64 .exe/.dll binaries. Also support injection methods:
1. Code injection (default method; success if enough empty space in the code section) 2. Create new section (turn on with option -m sect; by default section name has value ".code"; use additional option -n for set custom section name) 3. Resize the current code section (turn on with option -m resz)Also support output for current sections (option -d)
Also support run shellcode within a separate thread (option -t or --thread. For 32bit and 64bit)
This is instruction for Kali Linux (it doesn't matter which distributive is using here; it is just convinient to use Kali Linux because it has the preinstalled metasploit framework for generating shellcodes).
-
Generate the shellcode with the effect of showing the window with caption:
msfvenom -p windows/messagebox TEXT="Big brother watches you." -f raw > shellcode.raw -
Inject generated raw file into exe (choosen method resz because it works in the most cases):
PE-infector -i original.exe -o injected.exe -s shellcode.raw -m resz -
In success injected.exe will be generated
-
Profit!