# Cyber Epidemic ML
A Flask web application that applies Machine Learning models to defend against epidemic-style cybersecurity threats such as **XSS attacks, SQL Injection, and Malicious URLs**.
---
## Features
- π‘οΈ **XSS Detection** β Uses a deep learning model (`xss_model.h5`)
- π **SQL Injection Detection** β Uses trained ML model (`saved_model.pkl`)
- π **Malicious URL Detection** β Uses ensemble model (`BestModel_ExtraTreesClassifier.joblib`)
- π Web interface for uploading URLs and queries
- β‘ Real-time results directly in your browser
---
## Project Structure
project/ βββ app.py # Main Flask app βββ web_vul.py # Web vulnerability scanning logic βββ requirements.txt # Python dependencies βββ models/ # Pretrained ML models (.h5, .pkl, .joblib, etc.) βββ templates/ # HTML templates βββ static/ # CSS, JS, assets
---
## Installation
1. Clone the repository:
```bash
git clone https://github.com/CHAbhiram/cyber-epidemic-ml.git
cd cyber-epidemic-ml/project
-
Create a virtual environment (recommended):
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
Start the Flask server with:
python app.pyBy default, the app runs on:
http://127.0.0.1:5000
Open this link in your browser.
-
Navigate to the homepage.
-
Select the section/module you want:
- XSS Detection β Paste a query or payload to test
- SQL Injection Detection β Enter a query to check for injection
- URL Threat Detection β Upload or paste URLs for classification
-
Submit your input.
-
View results in the browser (classified as safe/threat).
-
Go to
http://127.0.0.1:5000 -
Select URL Threat Detection
-
Paste:
http://malicious-example.com/abc?id=1 -
Output:
Prediction: Malicious URL
-
Model not found β Ensure the
models/folder contains required.h5,.pkl,.joblibfiles. -
Dependency errors β Reinstall with
pip install -r requirements.txt. -
Port conflicts β Run with a different port:
flask run --port 8080
- Few files are Excluded with size reasons and if needed go through below link https://drive.google.com/file/d/1LSrnxGkN9V3ilW2hUpT76sizjFc2Cq6g/view?usp=sharing
MIT License
Copyright (c) 2025 Chada Abhiram Sharma
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE..