Skip to content

faroq45/vuln-scanner-flask

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›‘οΈ Advanced Vulnerability Scanner - Flask Edition

A comprehensive, enterprise-grade vulnerability scanning platform with AI/ML-powered payload generation, zero-day detection, and threat intelligence integration.

Python Flask License Redis


🌟 Features

Core Capabilities

  • πŸ” Network Scanning: Port scanning, service detection, OS fingerprinting
  • 🎯 Vulnerability Detection: OWASP Top 10, CVE database integration
  • πŸ€– AI/ML Payload Generation: 15+ advanced algorithms for sophisticated attack simulation
  • 🚨 Zero-Day Detection: Pattern-based and behavioral anomaly detection
  • πŸ“Š Threat Intelligence: Integration with 6+ threat intel feeds
  • πŸ“ˆ Real-time Dashboard: Live scanning status and vulnerability tracking
  • πŸ“ Comprehensive Reports: PDF/JSON/CSV export capabilities
  • πŸ‘₯ Multi-user Support: Role-based access control
  • πŸ” Secure Architecture: Session management, authentication, and authorization

Advanced Features

1. AI/ML-Powered Payload Generation 🧠

  • 15 Algorithms:
    • Deep Neural Networks with Backpropagation
    • Multi-Objective Genetic Algorithms
    • Deep Q-Learning with Experience Replay
    • Enhanced Particle Swarm Optimization
    • Adversarial Training (GAN-style)
    • Transformer-based Sequence Generation
    • LSTM Neural Networks
    • Simulated Annealing
    • Ant Colony Optimization
    • Bayesian Optimization
    • Actor-Critic Reinforcement Learning
    • Metamorphic Payload Generation
    • Steganographic Encoding
    • Adversarial ML Resistance
    • Real-time Adaptive Learning

2. Zero-Day Detection Module 🎯

  • Pattern-based vulnerability detection
  • Behavioral anomaly analysis
  • Time-based blind detection
  • Response correlation analysis
  • Active exploit detection (Log4Shell, Spring4Shell, ShellShock)

3. Threat Intelligence Integration 🌐

  • CVE feed integration
  • Exploit database correlation
  • IOC (Indicators of Compromise) matching
  • Real-time threat updates

4. OWASP Top 10 Coverage βœ…

  • SQL Injection
  • Cross-Site Scripting (XSS)
  • Command Injection
  • Path Traversal
  • Template Injection
  • XML External Entity (XXE)
  • Deserialization Attacks
  • LDAP Injection
  • NoSQL Injection
  • SSRF (Server-Side Request Forgery)

πŸš€ Quick Start

Prerequisites

  • Python 3.11+
  • Redis Server
  • Git

Installation

  1. Clone the repository
git clone https://github.com/faroq45/vuln-scanner-flask.git
cd vuln-scanner-flask
  1. Create virtual environment
python -m venv env

# Windows
env\Scripts\activate

# Linux/Mac
source env/bin/activate
  1. Install dependencies
pip install -r requirements.txt
  1. Install additional WSGI server (optional)
# For Windows
pip install waitress

# For Linux/Unix
pip install gunicorn
  1. Start Redis
# Windows (if installed as service)
net start redis

# Linux/Mac
redis-server
  1. Run the application

Development Mode:

python main.py

Production Mode (Windows):

python run_waitress.py
# or
start_production.bat

Production Mode (Linux/Unix):

gunicorn -c gunicorn_config.py wsgi:application
  1. Access the application
http://localhost:8080

πŸ“– Documentation


πŸ—οΈ Architecture

vuln-scanner-flask/
β”œβ”€β”€ bin/                    # Background worker processes
β”‚   β”œβ”€β”€ scanner.py         # Port and service scanner
β”‚   β”œβ”€β”€ attacker.py        # Vulnerability exploitation
β”‚   └── scheduler.py       # Scheduled scanning
β”œβ”€β”€ core/                  # Core functionality
β”‚   β”œβ”€β”€ database.py        # Database management (SQLite/PostgreSQL)
β”‚   β”œβ”€β”€ redis.py          # Redis session management
β”‚   β”œβ”€β”€ workers.py        # Worker thread management
β”‚   β”œβ”€β”€ payload_generator_enhanced.py       # 8 AI/ML algorithms
β”‚   β”œβ”€β”€ payload_generator_ultra_enhanced.py # 15+ advanced algorithms
β”‚   β”œβ”€β”€ owasp_wrapper.py  # OWASP scanner integration
β”‚   └── ...
β”œβ”€β”€ rules/                 # Vulnerability detection rules
β”‚   └── vulnerabilities/  # Individual rule modules
β”‚       β”œβ”€β”€ rule_zeroday-detection.py
β”‚       β”œβ”€β”€ rule_zeroday-intelligence.py
β”‚       └── rule_advanced-payload-detection.py
β”œβ”€β”€ views/                 # Web interface views
β”œβ”€β”€ templates/            # HTML templates
β”œβ”€β”€ static/               # Static assets (CSS, JS, images)
β”œβ”€β”€ config.py            # Main configuration
β”œβ”€β”€ config_zeroday.py    # Zero-day detection config
β”œβ”€β”€ main.py              # Application entry point
β”œβ”€β”€ wsgi.py              # WSGI entry point
└── requirements.txt     # Python dependencies

βš™οΈ Configuration

Basic Configuration (config.py)

# Web Server
WEB_HOST = '0.0.0.0'
WEB_PORT = 8080
WEB_DEBUG = False

# Redis
RDS_HOST = 'localhost'
RDS_PORT = 6379

# Database (PostgreSQL or SQLite)
DB_TYPE = 'postgresql'  # or 'sqlite'
DB_HOST = 'localhost'
DB_PORT = 5432
DB_NAME = 'vuln_scanner'
DB_USER = 'your_user'
DB_PASSWORD = 'your_password'

Zero-Day Detection (config_zeroday.py)

ZERODAY_ENABLED = True
ZERODAY_AGGRESSIVE_MODE = True
ZERODAY_MAX_PAYLOADS = 100
MACHINE_LEARNING_ENABLED = True

🎯 Usage

1. Create a User Account

  • Navigate to /signup
  • Create your account
  • Login at /login

2. Start a Scan

  • Go to Quick Scan or Assessment
  • Enter target IP range or URL
  • Configure scan options
  • Click Start Scan

3. Monitor Progress

  • View real-time progress in the dashboard
  • Check discovered assets
  • Review vulnerabilities as they're found

4. Generate Reports

  • Navigate to Reports
  • Select scan session
  • Export as PDF, JSON, or CSV

πŸ”’ Security Features

  • βœ… Session-based authentication
  • βœ… Password hashing (bcrypt)
  • βœ… SQL injection prevention
  • βœ… XSS protection
  • βœ… CSRF protection
  • βœ… Rate limiting on login attempts
  • βœ… Secure cookie handling
  • βœ… Content Security Policy headers
  • βœ… User activity logging

πŸ“Š Supported Vulnerability Types

Category Tests
SQL Injection Union-based, Boolean-based, Time-based, Error-based
XSS Reflected, Stored, DOM-based
Command Injection OS command, Code execution
Path Traversal Directory traversal, File inclusion
Template Injection SSTI (Jinja2, Smarty, etc.)
XXE XML External Entity attacks
Deserialization Pickle, YAML, JSON unsafe deserialization
Authentication Weak passwords, Default credentials
Information Disclosure Version disclosure, Debug info
Misconfigurations Insecure headers, Missing patches

πŸ§ͺ Testing

Run the test suite:

# All tests
pytest

# Specific test file
pytest test_advanced_payloads.py

# With coverage
pytest --cov=core --cov-report=html

🀝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.


⚠️ Disclaimer

FOR EDUCATIONAL AND AUTHORIZED TESTING PURPOSES ONLY

This tool is designed for security professionals and researchers to test their own systems or systems they have explicit permission to test. Unauthorized access to computer systems is illegal.

The developers assume no liability and are not responsible for any misuse or damage caused by this program. Use at your own risk.


πŸ™ Acknowledgments

Project Team

Special Thanks

  • OWASP for vulnerability classifications
  • Nmap for port scanning
  • Flask community for the excellent web framework
  • Redis for session management
  • All open-source contributors

For full contributor list, see CONTRIBUTORS.md


πŸ“§ Contact


🌟 Star History

Star History Chart


Built with ❀️ by Security Researchers, for Security Researchers

About

Advanced vulnerability scanner with advanced payload generation and zero day module

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors