A comprehensive collection of hands-on labs and exercises for learning ransomware analysis, detection, and cybersecurity fundamentals using Python and machine learning techniques.
- Overview
- Prerequisites
- Installation
- Project Structure
- Labs Overview
- Usage
- Datasets
- Contributing
- License
This repository contains a complete set of labs for learning ransomware analysis and detection, covering:
- Foundational Python & Cybersecurity Concepts
- Static Analysis & Reverse Engineering
- Dynamic Analysis & Behavioral Analysis
- Machine Learning for Malware Detection
- Real-time File Monitoring Systems
The labs progress from basic Python programming to advanced machine learning models for ransomware detection, providing hands-on experience with real-world cybersecurity challenges.
Before starting the labs, ensure you have:
- Python 3.8+ installed
- Virtual environment (recommended)
- Jupyter Notebook or JupyterLab
- Git for cloning the repository
- Basic understanding of Python programming
- Virtual Machine software (VirtualBox/VMware) for isolated analysis
-
Clone the repository:
git clone <repository-url> cd ransomeware-course-labs
-
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
For VS Code Users - Connect to Virtual Environment Kernel:
After activating your virtual environment, install ipykernel and register it:
pip install ipykernel python -m ipykernel install --user --name=ransomware-course-labs --display-name="Ransomware Course Labs"Then in VS Code:
- Open a Jupyter notebook (.ipynb file)
- Click on the kernel selector in the top-right corner
- Select "Ransomware Course Labs" from the kernel list
- If the kernel doesn't appear, restart VS Code and try again
-
Install dependencies:
pip install -r requirements.txt
-
Launch Jupyter:
jupyter notebook
ransomeware-course-labs/
├── requirements.txt # Python dependencies
├── README.md # This file
├── content.txt # Course content and lab descriptions
├── *.ipynb # Jupyter notebooks for various labs
├── *.py # Python scripts
├── *.csv # Datasets for analysis
├── 8_lab/ # C programming and reverse engineering labs
│ ├── bogus.c
│ ├── obf.c
│ └── 1.c
├── 9_lab/ # CTF challenges and XOR exercises
│ ├── part2.c
│ └── xor_chall.c
├── 12_lab/ # Additional lab materials
│ ├── a.out
│ └── idk
└── 28_lab/ # Advanced ransomware detection
├── file_monitor.py # Real-time file monitoring system
├── modeling.py # Machine learning model training
└── windows_ransomeware.csv
- Lab 1: Jupyter & Basic Data Structures
- Lab 2: File I/O & Basic Pandas DataFrames
- Lab 3: VM Setup & Baselines
- Lab 4: Command Line & Network Investigation
- Lab 5: Essential Static Analysis Tools
- Lab 6: Extracting Strings & Hashes
- Lab 7: Exploring PEStudio
- Lab 8: Writing & Compiling Simple C Code
- Lab 9: Reverse Engineering CTF Challenges
- 13.ipynb - 28.ipynb: Progressive labs covering data analysis, machine learning, and ransomware detection
- 28_lab/: Advanced ransomware detection with real-time monitoring
- Start Jupyter:
jupyter notebook - Navigate to the desired notebook (e.g.,
19.ipynb) - Run cells sequentially to follow the lab progression
# Basic file operations
python 2.py
# Advanced ransomware detection
cd 28_lab
python modeling.py
python file_monitor.pycd 8_lab
gcc -o program program.c
./programThe repository includes several datasets for analysis:
- Android_Ransomeware.csv (198MB): Android malware dataset
- Ransomeware_Detection.csv (7.3MB): Windows ransomware dataset
- heart_failure_clinical_records_dataset.csv: Medical data for analysis
- epileptic_seizure_recognition.csv: Time series data
- drebin-215-dataset-5560malware-9476-benign.csv: Android malware analysis
- Random Forest Classifiers for malware detection
- Neural Networks using TensorFlow
- Support Vector Machines for classification
- Feature engineering and data preprocessing
- PE file analysis using
pefile - Real-time file monitoring with
watchdog - String extraction and hash analysis
- Static and dynamic analysis techniques
- Matplotlib and Seaborn for data visualization
- Confusion matrices and classification reports
- Feature importance analysis
- Never run malware on production systems
- Use isolated VMs for analysis
- Follow responsible disclosure practices
- Respect legal boundaries and institutional policies
- Always use isolated environments for malware analysis
- Never download or distribute live malware without authorization
- Document all analysis activities
- Proper disposal of infected VMs and storage media
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Commit changes:
git commit -am 'Add feature' - Push to branch:
git push origin feature-name - Submit a pull request
This project is for educational purposes only. Please ensure compliance with your institution's policies and local laws regarding malware analysis and cybersecurity research.
- PEStudio Documentation
- Ghidra Reverse Engineering Tool
- Scikit-learn Documentation
- TensorFlow Tutorials
For issues or questions:
- Check the course content in
content.txt - Review the lab descriptions
- Ensure all dependencies are properly installed
- Verify your Python environment is correctly configured
Disclaimer: This course is designed for educational purposes in controlled environments. Always follow ethical guidelines and legal requirements when conducting cybersecurity research.