Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

50 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VulnerabilityScanner

A Python CLI tool for automated web vulnerability scanning (MPA & SPA) with AI-generated security reporting for executives, developers, and security teams.

Problem Statement

Modern web applications frequently contain security vulnerabilities such as SQL Injection (SQLi), Cross-Site Scripting (XSS), Cross-Site Request Forgery (CSRF), server misconfigurations, and information disclosure weaknesses. Identifying these vulnerabilities often requires multiple specialized tools and extensive manual effort from penetration testers and developers.

Existing vulnerability scanners typically generate highly technical outputs that can be difficult for developers, students, and non-security stakeholders to interpret. Additionally, many tools focus only on specific vulnerability classes and do not provide unified workflows for reconnaissance, exploitation, and reporting.

As web applications continue to grow in complexity, there is a need for an automated and centralized security assessment platform capable of discovering application attack surfaces, performing repeatable vulnerability testing, and generating human-readable reports with actionable remediation guidance.

This project addresses these challenges through the development of an AI-assisted web vulnerability scanner that combines automated crawling, browser automation, vulnerability detection, network reconnaissance, and intelligent report generation into a single unified framework.

Project Description

VulnerabilityScanner is a Python-based command-line tool that combines automated crawling, browser automation via Playwright, and AI-driven report generation to deliver comprehensive web application security assessments.

The scanner targets several high-impact vulnerability classes:

  • SQL Injection (SQLi)
  • Cross-Site Scripting (XSS)
  • Cross-Site Request Forgery (CSRF)
  • Server misconfigurations and information disclosure
  • Network-level weaknesses via Nmap port and service scanning

The tool auto-detects whether the target is a traditional multi-page application (MPA) or a modern Single Page Application (SPA), then selects the appropriate scanning strategy. All findings are exported as structured JSON, which are then passed to an AI language model to generate detailed, human-readable security reports complete with vulnerability descriptions, severity ratings, and prioritized remediation guidance.

Key Features

  • Auto-detection of SPA vs traditional web apps
  • Authenticated scanning — automatically finds and submits login forms, extracts JWT tokens
  • Browser automation with Playwright for SPAs
  • Nmap-based network reconnaissance and vulnerability detection
  • Exploit chain execution for traditional apps
  • AI-generated reports accessible to developers, security teams, and executives
  • All output saved as structured JSON for auditability and reuse

Software Architecture

Software Architecture Diagram

Technologies Used

Category Technology
Language Python 3
Browser Automation Playwright (Chromium)
HTTP Requests requests
HTML Parsing BeautifulSoup4
Network Scanning Nmap
AI Report Generation Gemini API
Report Rendering HTML
Containerization Docker

Running the Project

1. Clone the Repository

git clone https://github.com/comp596-spring-2026/VulnerabilityScanner.git
cd VulnerabilityScanner

2. Set Up a Virtual Environment

python3 -m venv venv
source venv/bin/activate   # Linux / Mac

3. Navigate to the Scanner Directory

cd scanner

4. Install Dependencies

pip install -r requirements.txt
brew install nmap netcat curl mysql-client  # Mac

5. Install Playwright Browser

playwright install chromium

6. Install Docker

Docker is required to run the example target apps below:

Download and install from: https://www.docker.com/products/docker-desktop/

7. Set Up Gemini API Key

This project uses the Gemini API to generate AI-powered security reports. You will need a free API key from Google.

  1. Go to https://aistudio.google.com/apikey
  2. Sign in with your Google account
  3. Click Create API Key
  4. Copy the key and create a .env file in the scanner/ directory:
GEMINI_API_KEY=your_api_key_here
echo ".env" >> .gitignore

8. Run the Scanner

python3 main.py <target_url> --username <your_username> --password <your_password>

Example: Running Against DVWA

1. Start the DVWA Container

docker run --rm -it -p 8080:80 vulnerables/web-dvwa

This runs DVWA locally at http://localhost:8080

2. Initialize DVWA

Open your browser and go to http://localhost:8080/setup.php, click Create / Reset Database, then navigate to http://localhost:8080/login.php

3. Default Credentials

Field Value
Username admin
Password password

4. Run the Scanner Against DVWA

source venv/bin/activate
cd scanner
python3 main.py http://localhost:8080 --username admin --password password

Example: Running Against OWASP Juice Shop

1. Pull the Image

docker pull bkimminich/juice-shop

2. Start the Container

docker run --rm -p 3000:3000 bkimminich/juice-shop

3. Access Juice Shop

Open your browser and navigate to http://localhost:3000

4. Run the Scanner Against Juice Shop

Unauthenticated:

source venv/bin/activate
cd scanner
python3 main.py http://localhost:3000/#/

Authenticated:

python3 main.py http://localhost:3000/#/ --username admin@juice-sh.op --password admin123

Disclaimer

This tool is intended for authorized security testing only.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages