
CVE-2023-38831 (PoC) - WinRAR Exploit
This repository contains a Python proof-of-concept (PoC) script for exploiting CVE-2023-38831, a vulnerability in WinRAR (versions < 6.23) that allows code execution when a user opens a specially crafted archive.
The script generates a malicious RAR archive (actually a ZIP file with a .rar extension) that abuses a filename parsing vulnerability in WinRAR. When a victim opens the crafted archive and double-clicks the decoy file, a payload (such as a .bat or .exe file) is executed alongside the decoy document.
python exploit.py <INPUT_FILE> <PAYLOAD_FILE> <OUTPUT_FILE>
Arguments:
<INPUT_FILE>: Path to the decoy file (e.g., document.pdf, image.jpg).<PAYLOAD_FILE>: Path to the payload file to execute (e.g., script.bat, malware.exe).<OUTPUT_FILE>: Name of the crafted archive to generate (e.g., poc.rar).Example:
python exploit.py document.pdf script.bat poc.rar
A demonstration of the exploit in action is shown below:


⚠️ Warning:
These demos are for educational purposes only. Do not use on systems you do not own or have explicit permission to test.
.rar extension.This code is for educational and authorized testing purposes only.
Do not use it on systems you do not own or have explicit permission to test.