A multi-threaded web application security auditing framework featuring 12+ specialized vulnerability scanners (SQLi, XSS, RCE, SSRF, IDOR, Path Traversal), an interactive Web GUI, and automated CVSS-scored PDF/HTML vulnerability reporting.
- Overview
- System Architecture
- Vulnerability Scanner Suite
- OWASP Top 10 Coverage
- Execution Modes (CLI & Web GUI)
- Automated Audit Reports
- Tech Stack
- Project Structure
- Getting Started
- Disclaimer & Legal Notice
- Author & License
PenTestHub is an automated web penetration testing engine engineered in Python. It simplifies security posture assessments by combining high-speed asynchronous network probing with payload fuzzing across target web applications, REST APIs, and authentication endpoints.
- Comprehensive Attack Surface Discovery: Crawls web endpoints, form parameters, query strings, and JavaScript bundles.
- Intelligent Payload Injection: Dispatches context-aware payloads to detect critical injection and logic flaws with minimal false positives.
- Executive & Technical Reporting: Compiles categorized findings with CVSS v3.1 severity scores, proof-of-concept (PoC) payloads, and remediation guidance into PDF and HTML summaries.
flowchart TD
subgraph Target["Target Scope"]
TargetURL["Target Web Application / API Endpoint"]
end
subgraph Interface["User Control Interfaces"]
CLI["CLI Command Hub (pentesthub.py)"]
WebGUI["Interactive Web Dashboard (server.py / templates)"]
end
subgraph CoreEngine["Core Orchestrator (core/scanner.py)"]
Crawler["Web Crawler & Form Parameter Extractor"]
Dispatcher["Multi-Threaded Async Scanner Dispatcher"]
end
subgraph ScannerSuite["Modular Vulnerability Detection Modules"]
SQLi["SQL Injection (sqli_scanner.py)"]
XSS["Cross-Site Scripting (xss_scanner.py)"]
RCE["Remote Code Execution (rce_scanner.py)"]
SSRF["Server-Side Request Forgery (ssrf_scanner.py)"]
IDOR["IDOR & Access Control (idor_scanner.py)"]
Traversal["Path Traversal & LFI (traversal_scanner.py)"]
CSRF["CSRF & Token Validation (csrf_scanner.py)"]
Auth["Auth & Session Security (auth_scanner.py)"]
Headers["Security Headers Audit (headers_scanner.py)"]
JSScan["JavaScript Secret & Endpoint Scraper (js_scanner.py)"]
Cookies["Cookie Flag Audit (cookies_scanner.py)"]
Redirect["Open Redirect Detection (open_redirect_scanner.py)"]
end
subgraph Output["Vulnerability Reporting Engine"]
ReportGen["Report Generator (reports/report_generator.py)"]
HTMLRep["Interactive HTML Audit Report"]
PDFRep["Executive PDF Vulnerability Report"]
end
CLI & WebGUI --> CoreEngine
CoreEngine --> TargetURL
TargetURL --> Crawler
Crawler --> Dispatcher
Dispatcher --> SQLi & XSS & RCE & SSRF & IDOR & Traversal & CSRF & Auth & Headers & JSScan & Cookies & Redirect
SQLi & XSS & RCE & SSRF & IDOR & Traversal & CSRF & Auth & Headers & JSScan & Cookies & Redirect --> ReportGen
ReportGen --> HTMLRep & PDFRep
| Scanner Module | Vulnerability Class | Detection Methodology | Severity |
|---|---|---|---|
sqli_scanner.py |
SQL Injection (SQLi) | Error-based heuristics, boolean differential analysis, time-based blind sleep injections. | Critical |
xss_scanner.py |
Cross-Site Scripting (XSS) | Reflected payload reflection, DOM sink inspection, polyglot script injection. | High |
rce_scanner.py |
Command Execution (RCE) | OS command separator fuzzing (` | , ;, &&`), out-of-band execution triggers. |
ssrf_scanner.py |
Server-Side Request Forgery | Internal metadata endpoint targeting (169.254.169.254, localhost, 127.0.0.1). |
High |
idor_scanner.py |
Broken Object Level Auth | Sequential & UUID parameter fuzzing across unauthenticated/authenticated contexts. | High |
traversal_scanner.py |
Path Traversal / LFI | Directory traversal string injection (../../../../etc/passwd, win.ini). |
High |
csrf_scanner.py |
Cross-Site Request Forgery | Form audit for missing, predictable, or unvalidated anti-CSRF tokens. | Medium |
auth_scanner.py |
Broken Authentication | Credential rate-limiting verification, brute-force sensitivity, password policy checks. | High |
headers_scanner.py |
Misconfiguration | Evaluates CSP, HSTS, X-Frame-Options, X-Content-Type-Options, Referrer-Policy. | Low / Info |
js_scanner.py |
Information Disclosure | Scrapes client JavaScript bundles for hardcoded API keys, bearer tokens, and internal routes. | Medium |
cookies_scanner.py |
Session Security | Audits HttpOnly, Secure, and SameSite flags on session tokens. |
Medium |
open_redirect_scanner.py |
Open Redirect | Injects arbitrary external URLs into redirection query parameters (next=, url=, redirect=). |
Medium |
PenTestHub maps directly to the OWASP Top 10 Web Application Security Risks:
- A01:2021 — Broken Access Control: IDOR, Path Traversal, Open Redirect.
- A02:2021 — Cryptographic Failures: Weak cookies, missing HSTS, exposed secrets in JS.
- A03:2021 — Injection: SQL Injection, Remote Command Execution, Cross-Site Scripting.
- A05:2021 — Security Misconfiguration: Missing security headers, permissive CORS policies.
- A07:2021 — Identification & Authentication Failures: Auth brute-force, insecure session cookies.
- A10:2021 — Server-Side Request Forgery (SSRF): Internal network probe payloads.
Start the local web dashboard for interactive point-and-click scanning:
python3 server.pyNavigate to http://127.0.0.1:5000 to configure target domains, select scanner modules, and view real-time vulnerability logs.
# Execute a full scan on target URL
python3 pentesthub.py --url https://target.example.com --full
# Scan for specific vulnerability vectors
python3 pentesthub.py --url https://target.example.com --scan sqli,xss,headers
# Export audit report to PDF
python3 pentesthub.py --url https://target.example.com --full --report target_audit.pdfThe platform produces structured audit deliverables including:
- Target Scope & Metadata (Scan duration, endpoints tested, HTTP status distribution).
- Vulnerability Breakdown Chart by CVSS Severity (Critical, High, Medium, Low, Info).
- Detailed Finding Cards:
- Vulnerability Title & CVE/CWE Classification
- Affected URL & Parameter
- Exact Injected Payload
- Remediation & Hardening Steps
- Language: Python 3.10+
- Web Framework: Flask, Jinja2, HTML5/CSS3, Bootstrap
- Networking: Requests, Urllib3, AsyncIO, BeautifulSoup4
- PDF Generation: pdfkit, wkhtmltopdf
- Testing: Pytest
pentesthub/
├── server.py # Flask Web Application Server & API
├── pentesthub.py # CLI Scanner Entry Point
├── requirements.txt # Python Dependencies
├── core/
│ └── scanner.py # Central Scanner Engine & Dispatcher
├── scanners/ # Modular Vulnerability Detectors
│ ├── sqli_scanner.py # SQL Injection Scanner
│ ├── xss_scanner.py # Cross-Site Scripting Scanner
│ ├── rce_scanner.py # Remote Code Execution Scanner
│ ├── ssrf_scanner.py # SSRF Scanner
│ ├── idor_scanner.py # IDOR Scanner
│ ├── traversal_scanner.py # Directory Traversal Scanner
│ ├── csrf_scanner.py # CSRF Token Validator
│ ├── auth_scanner.py # Authentication Auditor
│ ├── headers_scanner.py # Security Headers Analyzer
│ ├── cookies_scanner.py # Cookie Flag Inspector
│ ├── js_scanner.py # Client JS Secrets Scraper
│ └── open_redirect_scanner.py # Open Redirect Detector
├── templates/ # Web Dashboard Templates
│ ├── index.html # Scan Configuration Interface
│ └── result.html # Real-Time Results & Findings View
├── reports/ # Audit Report Generation
│ └── report_generator.py # PDF & HTML Report Compiler
└── utils/
└── helpers.py # Formatting & HTTP Helpers
- Python 3.10 or higher
wkhtmltopdf(optional, for PDF report generation)
-
Clone the repository:
git clone https://github.com/a360n/pentesthub.git cd pentesthub -
Install dependencies:
pip install -r requirements.txt
-
Launch the Web Interface:
python3 server.py
Open
http://localhost:5000in your web browser.
This software is developed strictly for authorized educational research, defensive security assessments, and legitimate penetration testing on systems where you have explicit written permission from the asset owner. Unauthorized scanning, testing, or attacking of third-party systems without prior authorization is illegal. The author assumes no liability for misuse, damages, or legal repercussions resulting from the operation of this tool.
Ali Nasser (Ali Al-Khazali)
- Portfolio: www.ali-nasser.dev
- GitHub: @a360n
- LinkedIn: Ali Nasser
This project is licensed under the MIT License — see the LICENSE file for details.