A single-file Python web security scanner that combines static source analysis (PHP/JS), live HTTP checks, and active verification probes into one tool and produces a clean HTML/JSON/CSV/SARIF report.
⚠️ Authorized use only. Run this tool only against applications and sites you own or have explicit written permission to test. Active mode sends real payloads to a live target and must only be used with proper authorization.
Static analysis (PHP / JS)
- Taint tracking from common sources (
$_GET,$_POST,$_COOKIE,$_REQUEST,$_SERVER,php://input,$_SESSION, JSlocation/document.cookie, etc.) to dangerous sinks. - Detects SQL Injection, Reflected XSS, DOM XSS, Command Injection / RCE, Path Traversal / LFI, SSRF, XXE, Insecure Deserialization, Open Redirect, HTTP Header Injection, Code Injection, and weak crypto usage.
- Flags hardcoded credentials and secrets (passwords, API keys, AWS/Google keys, Slack tokens, private keys, GitHub tokens, DB connection strings).
- Basic checks for missing CSRF protection and session hardening (
session_regenerate_id, cache headers aftersession_start).
Live scan (--url)
- Missing security headers (CSP, HSTS, X-Frame-Options, X-Content-Type-Options, Referrer-Policy, Permissions-Policy).
- Missing cookie flags (
HttpOnly,Secure,SameSite). - TLS/SSL checks: certificate expiry, outdated protocols (SSLv2/v3, TLSv1/1.1).
- Exposed sensitive paths (
.git/HEAD,.env, backup files,phpinfo.php,adminer.php, phpMyAdmin, etc.) using a baseline-diff technique to reduce false positives. - CORS misconfiguration detection (reflected arbitrary origin,
*+ credentials).
Active verification (--active, requires --i-own-this-site)
- Sends lightweight canary payloads to query parameters to confirm Reflected XSS and error-based SQL Injection with low noise and a configurable request budget.
Reporting
- Colored console summary with a severity breakdown and a 0–100 security score/grade.
- HTML report, JSON report, CSV export, and SARIF output for CI pipelines.
--baselinesupport to diff a scan against a previous JSON report (new vs. fixed findings)..scanignorefile support (gitignore-style patterns) to exclude paths from static scanning.
pip install colorama requestspython webexploit-scan.py [target] [options]If no target folder is given and --url is not set, a folder picker dialog opens.
Static scan of a local source folder:
python webexploit-scan.py ./my-php-appLive scan of a deployed site (headers, TLS, exposed paths, CORS):
python webexploit-scan.py --url https://example.comStatic + live scan with full reports:
python webexploit-scan.py ./my-php-app --url https://example.com \
--html report.html --json report.json --csv report.csv --sarif report.sarifActive verification (only on sites you own/are authorized to test):
python webexploit-scan.py --url "https://example.com/page.php?id=1" \
--active --i-own-this-site --max-requests 20Compare against a previous scan to see new/fixed findings:
python webexploit-scan.py ./my-php-app --json new.json --baseline old.json| Flag | Description |
|---|---|
target |
Source folder to scan (positional, optional) |
--url URL |
Target URL for live scan |
--active |
Enable active XSS/SQLi verification (needs --url and --i-own-this-site) |
--i-own-this-site |
Confirms you are authorized to run active tests against the target |
--max-requests N |
Request budget for active mode (default: 30) |
--ext EXT [EXT ...] |
File extensions to scan (default: .php .phtml .inc .js) |
--exclude DIR [DIR ...] |
Directories to skip (default: vendor node_modules .git dist build) |
--scanignore FILE |
.scanignore-style ignore file (default: .scanignore) |
--threads N |
Worker threads for file scanning |
--html FILE |
HTML report output path (default: report.html) |
--json FILE |
JSON report output path |
--csv FILE |
CSV report output path |
--sarif FILE |
SARIF report output path (for CI integration) |
--baseline FILE |
Previous JSON report to diff against |
The static analyzer masks string/comment literals, then tracks variable assignments to flag when data coming from an untrusted source (user input, cookies, headers, session, etc.) reaches a dangerous sink (query(), exec(), include(), echo, innerHTML, …) without passing through a recognized sanitizer. Findings are scored by severity, deduplicated, and summarized into an overall security grade (A–F).
This is a heuristic, regex-based analyzer — it is fast and dependency-free, but it will have false positives/negatives like any lightweight SAST tool. It does not replace a manual code review or a professional penetration test.
MIT — use at your own risk, see the disclaimer above.