Skip to content

About

A single-file Python scanner for PHP and JavaScript web apps, combining static taint analysis, live HTTP checks, and active XSS/SQLi verification into clear, exportable reports.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

webexploit-scan

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.

What it does

Static analysis (PHP / JS)

  • Taint tracking from common sources ($_GET, $_POST, $_COOKIE, $_REQUEST, $_SERVER, php://input, $_SESSION, JS location/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 after session_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.
  • --baseline support to diff a scan against a previous JSON report (new vs. fixed findings).
  • .scanignore file support (gitignore-style patterns) to exclude paths from static scanning.

Requirements

  • Python 3.8+
  • colorama (required)
  • requests (optional — needed for --url live/active scanning)
pip install colorama requests

Usage

python webexploit-scan.py [target] [options]

If no target folder is given and --url is not set, a folder picker dialog opens.

Examples

Static scan of a local source folder:

python webexploit-scan.py ./my-php-app

Live scan of a deployed site (headers, TLS, exposed paths, CORS):

python webexploit-scan.py --url https://example.com

Static + 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.sarif

Active 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 20

Compare against a previous scan to see new/fixed findings:

python webexploit-scan.py ./my-php-app --json new.json --baseline old.json

Key options

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

How detection works (short version)

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.

License

MIT — use at your own risk, see the disclaimer above.

About

A single-file Python scanner for PHP and JavaScript web apps, combining static taint analysis, live HTTP checks, and active XSS/SQLi verification into clear, exportable reports.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages