This project is purely for educational and research purposes.
The ransomware created here is a non-functional proof-of-concept (PoC) meant to showcase how ransomware works, not to be used maliciously.
- It lacks the robustness and stealth of real-world malware.
- Unauthorized use, testing, or distribution of tools like this is illegal and unethical.
- The goal? Learning to defend against ransomware by understanding how it works.
Edu_RW is my MSc final project: a hands-on study of ransomware mechanics. It explores how ransomware attacks are designed, built, and executed, focusing on CVE-2023-38831 as the entry point.
Here’s the big picture:
- The ransomware tricks users into opening a malicious
.rarfile. - A script inside secretly delivers the payload.
- Files are encrypted with AES-256, and the key is locked up using RSA-2048.
- Victims are greeted with a ransom note, demanding payment for decryption.
This project doesn’t just simulate the attack—it breaks it down step by step, showing how the techniques can be defended against in real-world scenarios.
- Step 1: Exploitation
Leveraging CVE-2023-38831, a vulnerability in WinRAR (pre-v6.23), the attack uses a.cmdscript disguised in a.rararchive. - Step 2: Payload Delivery
The script downloads and runs the ransomware payload silently. - Step 3: File Encryption
Files are encrypted using AES-256, and the encryption key is secured using RSA-2048. - Step 4: Ransom Note
A minimal GUI displays instructions for paying the ransom to unlock files.
How it works:
- AES-256: Encrypts the victim’s files for speed and security.
- RSA-2048: Encrypts the AES key to make recovery almost impossible without the ransom.
This dual-layer encryption protects the ransomware from being easily reversed.
Crypter Module:
- Written in C++, the AES module encrypts files efficiently.
- Targets specific file types (e.g.,
.docx,.png,.txt) while avoiding critical system files. - Uses the ECB mode for simplicity, and clears keys from memory after use to resist forensic analysis.
The C2 server orchestrates the attack, hosted on a Debian-based virtual machine with:
- Apache Web Server for payload delivery.
- Flask-based Python App to manage endpoints securely.
Endpoints include:
- Payload Delivery: Dynamically delivers the ransomware payload via randomized URLs.
- Session Management: Handles victim connections using unique tokens and generates RSA keys for encryption.
- Key Retrieval: Provides the decryption key once the ransom is “paid.”
Security Features:
- Obfuscation techniques to evade detection.
- Rate limiting to prevent exploitation.
The ransomware payload is the attack's heart, built in Rust for:
- Performance: Fast and reliable across platforms.
- Memory Safety: Reduces vulnerabilities attackers (or defenders!) could exploit.
- Efficiency: Handles secure file encryption and stealthy C2 communication.
This project sharpened my skills in several areas critical to cybersecurity:
- Understanding Vulnerabilities
- Deep dive into CVE-2023-38831, including how attackers exploit software flaws.
- Building C2 Infrastructure
- Designing secure, scalable, and stealthy command-and-control systems.
- Advanced Cryptography
- Implementing AES-256 and RSA-2048 to secure file data and encryption keys.
- Malware Development
- Crafting realistic ransomware simulations to study how attackers evade detection.
- Red Team Tactics
- Using offensive tools to identify and close gaps in defensive measures.
🚧 What’s working?
- Proof-of-concept payload and C2 infrastructure.
🚀 What’s next? - Adding more stealth features for evasion.
- Expanding encryption support for additional file types.
- Enhancing C2 server robustness.
Creating ransomware—even as a proof-of-concept—comes with serious ethical responsibilities. This project was developed with strict adherence to legal guidelines, with one goal: education and defense.
If you’re here to learn, welcome aboard. If you’re here for malicious purposes, you’re in the wrong place.
Thanks to the open-source community for inspiration and tools, including:
- Danillo Treffiletti’s AES-256 implementation: https://github.com/Urban82/Aes256
Edu_RW is an opportunity to explore the complexities of ransomware in a safe, controlled way. By studying how attacks work, we can build stronger defenses—and keep the bad guys at bay.
Remember: Knowledge is power, but it’s also responsibility. Use it wisely.