Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

# 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
  1. Create a virtual environment (recommended):

    python -m venv venv
    source venv/bin/activate       # On Windows: venv\Scripts\activate
  2. Install dependencies:

    pip install -r requirements.txt

Running the Application

Start the Flask server with:

python app.py

By default, the app runs on:

http://127.0.0.1:5000

Open this link in your browser.


Usage

  1. Navigate to the homepage.

  2. 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
  3. Submit your input.

  4. View results in the browser (classified as safe/threat).


Example Workflow

  • Go to http://127.0.0.1:5000

  • Select URL Threat Detection

  • Paste:

    http://malicious-example.com/abc?id=1
    
  • Output:

    Prediction: Malicious URL
    

Screenshots / Demo

Homepage

Screenshot 2025-09-20 212619

XSS Detection Module

Screenshot 2025-09-20 212631

SQL Injection Detection

Screenshot 2025-09-20 212641

URL Threat Detection

Screenshot 2025-09-20 212659

Troubleshooting

  • Model not found β†’ Ensure the models/ folder contains required .h5, .pkl, .joblib files.

  • Dependency errors β†’ Reinstall with pip install -r requirements.txt.

  • Port conflicts β†’ Run with a different port:

    flask run --port 8080


Files


License

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..

About

# 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

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages