RazanMujawar/Malware-Detection-and-Classification

GitHub: RazanMujawar/Malware-Detection-and-Classification

基于随机森林算法与 PE 头静态分析的机器学习恶意软件检测系统,提供 Flask Web 界面实现对 Windows 可执行文件的良性与恶意分类。

Stars: 0 | Forks: 0

# 恶意软件检测与分类 ## 📌 项目简介 本项目旨在利用**机器学习**技术检测并分类 Windows 可执行文件(`.exe`)。通过**静态分析**和**基于模式的学习**,系统能够识别文件是**恶意软件**(Malware)还是**良性文件**(Benign)。 该工具采用 Python 作为后端,并配备了一个简洁的 Web UI,展示了在网络安全实时分析中的实用方法。它作为一个基础模型,可以扩展为企业级安全工具,或与防病毒软件及威胁情报系统进行集成。 ## 🧪 主界面 提供了一个简洁、极简的 UI,用户可以在此上传 `.exe` 文件以进行恶意软件检查。

## 🚨 预测结果 扫描完成后,系统会立即返回结果: - **MALWARE**(如果检测到威胁) - **BENIGN**(如果文件安全) ## 🚨 恶意软件 (Malware)

##✅ 良性文件 (Benign)

### ✅ 使用 Conda(推荐) ``` # 步骤 1:创建虚拟环境 conda create -n malware_detector python=3.10 # 步骤 2:激活环境 conda activate malware_detector # 步骤 3:Clone repository git clone https://github.com/dhirajrhatwal8788-cell/Malware-Detection-and-Classification.git cd Malware-Detection-And-Classification # 步骤 4:安装 dependencies pip install -r requirements.txt``` ---- 📦 Python Dependencies These are the primary packages used in the project: | Package | Purpose | | -------------- | -------------------------------------------- | | `Flask` | Backend web framework | | `scikit-learn` | ML model (Random Forest) | | `pandas` | Data handling and manipulation | | `numpy` | Numerical computation | | `joblib` | Saving and loading ML models | | `pefile` | Extracting static features from `.exe` files | | `werkzeug` | Secure filename handling in Flask | Install them all using: pip install flask scikit-learn pandas numpy joblib pefile werkzeug --- 🗂️ Directory Structure Malware-Detection-System/ ├── app/ # Core application logic │ ├── feature_extractor.py # Feature extraction from .exe files │ └── predict_malware.py # Prediction function / wrapper │ ├── scripts/ # Scripts used for training or testing │ ├── train_model.py # Model training script (if applicable) │ └── create_dataset.py # Dataset preparation script │ ├── models/ # Stored trained models │ ├── classifier.pkl │ └── malware_model.pkl │ ├── data/ # Input datasets for training/testing │ ├── dataset.csv │ ├── PE_Dataset_Label.csv │ └── sample_dataset.csv │ ├── templates/ # HTML templates for Flask UI │ └── index.html │ ├── uploads/ # Temporary uploaded .exe files │ ├── fake_malware.exe │ └── notepad.exe │ ├── static/ # (Optional) for future CSS or JS │ ├── app.py # Main Flask server ├── requirements.txt # List of Python packages ├── README.md # Project documentation ---- 🚀 Running the Application To start the web app locally: python app.py Then visit the application in your browser at: http://127.0.0.1:5000/ ---- 🛠️ Tech Stack Layer Tools Used Frontend HTML, CSS Backend Python, Flask ML Framework scikit-learn (Random Forest) File Parsing pefile (Python PE Parser) Hosting Localhost (Flask Server) --- 🚧 Planned Enhancements Add threat intelligence APIs (VirusTotal, Hybrid Analysis) Extend support for ELF and Mach-O binaries (Linux/macOS) Deploy with Docker for better security Add advanced visualization for feature analysis Build an authentication module for multi-user access ```
标签:Apex, DNS 反向解析, Flask, Python, 云安全监控, 后端开发, 多模态安全, 无后门, 机器学习, 逆向工具, 静态分析