
Parchear shellcodes codificados con ROP en PEs
Una herramienta escrita en C (Win32) para convertir cualquier shellcode en ROP e inyectarlo en un ejecutable portátil (PE) dado. Solo soporta PE de 32 bits y el conjunto de instrucciones x86.
Publicado en Blackhat USA 2015, "ROPInjector: Using Return Oriented Programming for Polymorphism and Antivirus Evasion" Más información:
ropinjector <file-to-infect> <shellcode-file> <output-file>* [options]*
(* denota argumentos opcionales)
p.ej.
ropinjector.exe firefox.exe revshell.txt
file-to-infect : cualquier PE de 32 bits, sin empaquetar
shellcode-file : el shellcode a inyectar en el archivo PE
output-file (opcional) : El nombre del archivo de salida. Si no se especifica, ROPInjector elegirá un nombre de archivo adecuado que indique el tipo de inyección realizada.
options :
text Force reading of shellcode file as text file. Shellcode in text
form must be in the \xHH\xHH\xHH format.
norop Don't transform shellcode to ROP.
nounroll Don't unroll SIBs.
noinj Don't inject missing gadgets.
getpc Don't replace getPC constructs in the shellcode.
entry Have shellcode run before the original PE code. Without this
option, ROPInjector will try to hook calls to ExitProcess(),
exit() and the like so that the shellcode runs last, right
before process exit.
-d<secs> Number of seconds to Sleep() before executing the shellcode.
When this option is specified, "entry" is also implicitly used.
ROPInjector mostrará algunas estadísticas separadas por comas al final. Estas son (en orden de aparición):