Skip to content

About

A machine learning system for malware classification using binary analysis and Random Forest classification.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Enhanced Malware Classification System

A sophisticated machine learning-based system for classifying malware using advanced binary analysis and Random Forest classification. This project demonstrates the application of machine learning techniques to cybersecurity, specifically in the domain of malware detection.

Enhanced Features

  • Advanced binary file analysis with multiple feature extraction methods:
    • File size and basic statistics
    • Shannon entropy calculation
    • Byte frequency distribution analysis
    • Sequential pattern detection
    • Top N common sequence identification
  • Random Forest-based classification with feature importance analysis
  • Standardized feature scaling
  • Detailed file analysis with top contributing features
  • Visualization of feature importance
  • Support for both malware and benign file analysis
  • Test file generation for educational purposes

Project Structure

malware-classification-ml/
├── src/
│   ├── enhanced_malware_classifier.py
│   └── generate_test_files.py
├── data/
│   ├── malware_samples/
│   └── benign_samples/
├── results/
│   └── feature_importance.png
├── requirements.txt
└── README.md

Installation

  1. Clone the repository:
git clone https://github.com/Varunpoojari/malware-classification-ml.git
cd malware-classification-ml
  1. Install the required dependencies:
pip install -r requirements.txt

Usage

  1. First, create sample directories and generate test files:
python src/generate_test_files.py
  1. Add some benign files to the data/benign_samples directory for comparison.

  2. Run the enhanced classifier:

python src/enhanced_malware_classifier.py

Features Extracted

The system extracts the following features from binary files:

Basic Features

  • File size
  • Average byte value
  • Shannon entropy

Advanced Features

  • Complete byte frequency distribution (256 features)
  • Sequential pattern analysis
  • Top 10 most common byte sequences

Analysis Capabilities

The enhanced system provides:

  • Overall malware probability score
  • Top contributing features for each analysis
  • Feature importance visualization
  • Detailed per-file analysis reports

Model Details

  • Algorithm: Random Forest Classifier
  • Number of estimators: 100
  • Feature scaling: StandardScaler
  • Train/Test split: 80/20
  • Advanced feature extraction and analysis

Results

The system generates:

  • Test accuracy metrics
  • Feature importance plots (saved in results/feature_importance.png)
  • Detailed analysis reports for each file

Educational Purpose

This project is designed for educational purposes to demonstrate:

  • Advanced machine learning application in cybersecurity
  • Sophisticated binary file analysis techniques
  • Feature extraction and selection methods
  • Classification algorithms application
  • Data visualization and interpretation

Disclaimer

This tool is intended for educational purposes only. It should not be used as a primary security measure or for malicious purposes. Always use proper security tools and antivirus software for real-world applications.

License

MIT License - See LICENSE file for details

About

A machine learning system for malware classification using binary analysis and Random Forest classification.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages