Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

​"An advanced Real-time SQL Injection Detection & Prevention System (IDPS) based on Reverse Proxy architecture. Utilizing a hybrid engine (Signature-based & Machine Learning/SVM) to secure web applications."

Notifications You must be signed in to change notification settings

khaled7737/SQL-Injection-IDPS

Repository files navigation

🛡️ SQLi-IDPS: Intelligent SQL Injection Detection & Prevention System

License: MIT Python 3.11 Framework: Flask Proxy: Nginx Detection: Hybrid ML Project Status: Graduation Project


Welcome to the repository of my graduation project: SQLi-IDPS, an intelligent system designed to detect and prevent SQL Injection (SQLi) attacks. I developed this system to provide a robust, real-time defense layer for web applications using a Reverse Proxy architecture.

The core objective of this project was to build a security solution that sits in front of any web application, inspecting incoming traffic and blocking malicious payloads before they ever reach the backend server.


🧠 How It Works (Hybrid Detection Methodology)

I implemented a Hybrid Detection Strategy that combines speed with high accuracy:

  1. Nginx Reverse Proxy: All incoming HTTP/HTTPS requests are intercepted by Nginx. Using a custom Lua module, the request data is forwarded to my inspection service.
  2. Dual-Layer Inspection:
    • Signature-based Detection: Utilizing the libinjection library for lightning-fast detection of known SQLi patterns.
    • Machine Learning-based Detection: Leveraging a trained Support Vector Machine (SVM) model to identify complex, obfuscated, or zero-day attacks that traditional signatures might miss.
  3. Real-time Response: If an attack is detected, the request is blocked immediately with a 403 Forbidden response. The incident is logged, and an instant alert is sent to the administrator via Email/SMS.

System Architecture

The following diagram illustrates the data flow and how the components interact:

System Architecture


💻 Technologies & Tools

I chose a powerful stack to ensure reliability and performance:

Component Technology My Role
Backend Service Python + Flask Developed the inspection engine, RESTful APIs, and management logic.
Web Server/Proxy Nginx + Lua Configured the reverse proxy and integrated it with the Python backend.
AI/Machine Learning Scikit-learn (SVM) Trained and optimized the ML model for high-precision detection.
Frontend Dashboard React.js (Integrated) Designed a modern UI for monitoring logs, alerts, and system status.
Database SQLite / SQLAlchemy Managed local storage for incident logs and system configurations.

📸 System Screenshots

Here is a look at the final product in action:

Feature Screenshot
Login Interface Login Page
Main Dashboard Dashboard Overview
Detection Reports Alerts Log
Workflow Diagram Process Flow Diagram

🚀 Quick Start Guide

To run this project locally:

  1. Install Dependencies:
    pip install -r requirements.txt
  2. Run the Application:
    python main.py
  3. Access the Dashboard: Open http://localhost:5000 in your browser.
    • Default Credentials: admin / password

👨‍🎓 Project Information

This project was completed as part of the requirements for a Bachelor's degree in Cybersecurity.

  • Academic Institution: University of Science and Technology.
  • e-mail: [alaqlqlan47@gmail.com ]
  • Developed by: [khaled abdulsattar]

⚖️ License

This project is licensed under the MIT License. See the [MIT License.md] file for details.

About

​"An advanced Real-time SQL Injection Detection & Prevention System (IDPS) based on Reverse Proxy architecture. Utilizing a hybrid engine (Signature-based & Machine Learning/SVM) to secure web applications."

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

AltStyle によって変換されたページ (->オリジナル) /