Share
## https://sploitus.com/exploit?id=BB81C264-FDC1-559D-9F14-D1E022D06463
# ๐Ÿ” WebVulnScanner v1.0

> A production-grade, async Python web vulnerability scanner for bug bounty hunting, security research, and CTF/lab environments.

---

## โš ๏ธ Ethical Disclaimer

**This tool is for authorised security testing only.** Always obtain explicit written permission before scanning any target. Unauthorised scanning is illegal. The authors accept no responsibility for misuse.

---

## โœจ Features

| Module | Techniques |
|--------|-----------|
| **SQL Injection** | Error-based ยท Boolean blind ยท Time-based ยท WAF bypass mutations |
| **XSS** | Reflected ยท DOM-based (static) ยท Blind/OOB ยท Context-aware |
| **SSRF** | Internal IP probes ยท AWS/GCP/Azure metadata ยท OOB callback |
| **LFI / RFI** | Path traversal ยท Null-byte ยท Linux + Windows targets |
| **Header Injection** | CRLF ยท Host ยท X-Forwarded-For ยท Referer ยท User-Agent |

**Architecture:**
- Async engine (asyncio + aiohttp) for high-speed concurrent scanning
- Modular design โ€” add new analyzers without touching core code
- Intelligent response analysis with confidence scoring (minimises false positives)
- OOB listener for blind vulnerability detection (blind XSS, SSRF callbacks)
- JSON + dark-theme HTML reports with Charts.js visualisations
- Cookie / Bearer token / custom header authentication
- Rate limiting, retry logic, exponential back-off

---

## ๐Ÿ“ Project Structure

```
web_vuln_scanner/
โ”œโ”€โ”€ scanner.py              โ† Main entry point
โ”œโ”€โ”€ demo_target.py          โ† Intentionally vulnerable Flask app for testing
โ”œโ”€โ”€ requirements.txt
โ”œโ”€โ”€ core/
โ”‚   โ”œโ”€โ”€ config.py           โ† All configuration (ScannerConfig dataclass)
โ”‚   โ”œโ”€โ”€ session.py          โ† Async HTTP session manager
โ”‚   โ”œโ”€โ”€ models.py           โ† Finding, Target, ScanResult data models
โ”‚   โ””โ”€โ”€ logger.py           โ† Coloured logging
โ”œโ”€โ”€ crawler/
โ”‚   โ””โ”€โ”€ crawler.py          โ† BFS async web crawler
โ”œโ”€โ”€ analyzers/
โ”‚   โ”œโ”€โ”€ response_analyzer.pyโ† Shared detection logic (error matching, diff, timing)
โ”‚   โ”œโ”€โ”€ sqli.py             โ† SQL injection analyzer
โ”‚   โ”œโ”€โ”€ xss.py              โ† XSS analyzer
โ”‚   โ”œโ”€โ”€ ssrf.py             โ† SSRF analyzer
โ”‚   โ”œโ”€โ”€ lfi.py              โ† LFI / RFI analyzer
โ”‚   โ””โ”€โ”€ header_injection.py โ† Header injection analyzer
โ”œโ”€โ”€ fuzzer/
โ”‚   โ””โ”€โ”€ engine.py           โ† Async fuzzing orchestrator
โ”œโ”€โ”€ payloads/
โ”‚   โ”œโ”€โ”€ sqli_payloads.py    โ† SQL injection payload library + WAF bypass mutations
โ”‚   โ”œโ”€โ”€ xss_payloads.py     โ† XSS payload library (reflected, DOM, blind)
โ”‚   โ”œโ”€โ”€ ssrf_payloads.py    โ† SSRF target URLs
โ”‚   โ”œโ”€โ”€ lfi_payloads.py     โ† Path traversal + sensitive file list
โ”‚   โ””โ”€โ”€ header_payloads.py  โ† CRLF, Host, XFF, Referer payloads
โ”œโ”€โ”€ oob/
โ”‚   โ””โ”€โ”€ listener.py         โ† Async HTTP server for OOB callback capture
โ”œโ”€โ”€ reports/
โ”‚   โ””โ”€โ”€ reporter.py         โ† JSON + dark-theme HTML report generation
โ””โ”€โ”€ utils/
    โ””โ”€โ”€ helpers.py          โ† URL normalisation, deduplication, terminal output
```

---

## ๐Ÿš€ Installation

**Requirements:** Python 3.11+

```bash
# 1. Clone / download the project
git clone https://github.com/yourname/web-vuln-scanner.git
cd web-vuln-scanner

# 2. Create virtual environment (recommended)
python -m venv venv
source venv/bin/activate        # Linux/macOS
venv\Scripts\activate           # Windows

# 3. Install dependencies
pip install -r requirements.txt
```

---

## ๐ŸŽฏ Quick Start

### Option A โ€” Scan a real (authorised) target

```bash
python scanner.py --url https://target.example.com
```

### Option B โ€” Test against the included vulnerable demo app

```bash
# Terminal 1: Start the demo target
pip install flask
python demo_target.py

# Terminal 2: Run the scanner against it
python scanner.py --url http://127.0.0.1:5000 --depth 2 --concurrency 5
```

---

## ๐Ÿ› ๏ธ CLI Reference

```
usage: scanner.py [options] --url URL

Required:
  --url URL              Target URL to scan

Crawling:
  --depth INT            Crawl depth (default: 3)
  --max-urls INT         Max URLs to crawl (default: 200)

Performance:
  --concurrency INT      Concurrent requests (default: 10)
  --timeout INT          Request timeout in seconds (default: 15)
  --delay FLOAT          Delay between requests in seconds (default: 0.2)

Authentication:
  --cookies STR          Cookies: "name=val,name2=val2"
  --headers STR          Extra headers: "Name:Value,Name2:Value2"
  --token STR            Bearer token for Authorization header

Modules:
  --modules STR          Comma-separated: sqli,xss,ssrf,lfi,headers (default: all)

OOB / Blind detection:
  --oob-url URL          OOB callback URL (e.g. http://yourserver:8888)

Output:
  --output DIR           Output directory (default: scan_results)
  --no-json              Disable JSON report
  --no-html              Disable HTML report
  --min-confidence FLOAT Minimum confidence to report 0.0โ€“1.0 (default: 0.5)
  --log-file PATH        Write logs to file

General:
  --verbose, -v          Verbose debug logging
  --help, -h             Show this help message
```

---

## ๐Ÿ’ก Example Commands

```bash
# Basic scan
python scanner.py --url http://testphp.vulnweb.com

# Deep crawl with custom concurrency
python scanner.py --url https://app.example.com --depth 5 --max-urls 500 --concurrency 20

# Authenticated scan (cookie + bearer token)
python scanner.py --url https://app.example.com \
  --cookies "session=abc123;csrftoken=xyz" \
  --token "eyJhbGciOiJIUzI1NiJ9..."

# SQLi and XSS only (faster)
python scanner.py --url http://target.com --modules sqli,xss

# With blind XSS/SSRF OOB listener
python scanner.py --url http://target.com --oob-url http://YOUR_IP:8888

# DVWA (low security)
python scanner.py --url http://localhost/dvwa/vulnerabilities \
  --cookies "PHPSESSID=abc123;security=low" \
  --depth 2

# High confidence only, save logs
python scanner.py --url http://target.com \
  --min-confidence 0.75 \
  --log-file logs/scan.log

# Run standalone OOB listener
python -m oob.listener --host 0.0.0.0 --port 8888
```

---

## ๐Ÿ“Š Sample Output

```
โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘          Web Vulnerability Scanner  v1.0                  โ•‘
โ•‘    SQL Injection ยท XSS ยท SSRF ยท LFI ยท Header Injection    โ•‘
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

10:23:01  INFO     scanner โ€” Target  : http://127.0.0.1:5000
10:23:01  INFO     scanner โ€” Depth   : 2  |  Max URLs: 200  |  Concurrency: 10
10:23:01  INFO     scanner โ€” Modules : SQLi=True  XSS=True  SSRF=True  LFI=True
10:23:01  INFO     scanner โ€” โ”€โ”€โ”€ Phase 1: Crawling โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
10:23:03  INFO     crawler โ€” Crawler finished โ€” 12 URLs crawled, 18 targets built
10:23:03  INFO     scanner โ€” โ”€โ”€โ”€ Phase 2: Fuzzing โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
10:23:05  WARNING  sqli    โ€” โšก SQLi (error) @ http://127.0.0.1:5000/user param=id
10:23:06  WARNING  xss     โ€” โšก Reflected XSS @ http://127.0.0.1:5000/search param=q ctx=html
10:23:08  WARNING  ssrf    โ€” โšก SSRF @ http://127.0.0.1:5000/fetch param=url
10:23:10  WARNING  lfi     โ€” โšก LFI @ http://127.0.0.1:5000/file param=name

  [Critical]  SQL Injection
  URL:       http://127.0.0.1:5000/user?id='
  Parameter: id  |  Method: GET
  Payload:   '
  Confidence:90%
  Evidence:  ...error in your SQL syntax near ''' at line 1...

  [High]  Cross-Site Scripting
  URL:       http://127.0.0.1:5000/search?q=alert(1)
  Parameter: q  |  Method: GET
  Payload:   alert(1)
  Confidence:85%
  Evidence:  Payload reflected verbatim: alert(1)

โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
  SCAN COMPLETE  (18.3s)
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
  URLs crawled   : 12
  Requests sent  : 847
  Total findings : 6
    Critical      : 2
    High          : 2
    Medium        : 1
    Low           : 1
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

Reports saved:
  [JSON] scan_results/scan_report_20240523_102319.json
  [HTML] scan_results/scan_report_20240523_102319.html
```

---

## ๐Ÿ—๏ธ Adding Custom Modules

1. Create `analyzers/my_module.py` implementing an `async def analyze(self, target) -> list[Finding]` method
2. Add to `fuzzer/engine.py` `_analyzers` list
3. Add toggle in `core/config.py`
4. Done โ€” the engine handles the rest

---

## ๐ŸŒ Recommended Practice Targets

| Target | URL | Notes |
|--------|-----|-------|
| DVWA | `http://localhost/dvwa` | Run with Docker |
| WebGoat | `http://localhost:8080/WebGoat` | OWASP Java app |
| Vulnweb (Acunetix) | `http://testphp.vulnweb.com` | Public demo (authorised) |
| HackTheBox / TryHackMe | Various | Legal CTF platforms |

---

## ๐Ÿ”’ False Positive Reduction

The scanner uses a multi-factor confidence scoring system:

- **Error matching**: Specific DB error patterns โ†’ 0.75โ€“0.9 confidence
- **Boolean differential**: Response length diff TRUE/FALSE โ†’ 0.5โ€“0.85
- **Time delay**: Measured delay vs baseline โ†’ 0.7โ€“0.95
- **Reflection**: Exact payload match in body โ†’ 0.75โ€“0.98
- **Status change**: Auth bypass indicators โ†’ 0.6โ€“0.8

Use `--min-confidence 0.75` for stricter, lower-noise output.

---

## ๐Ÿ“„ License

MIT โ€” For educational and authorised security testing purposes only.