Share
## https://sploitus.com/exploit?id=3EFB21F7-B711-5DED-9ECD-7627DC7F9796
# ๐Ÿ›ก๏ธ VulnHawk โ€” OWASP Top 10 Web Vulnerability Scanner


  
  
  
  
  
  



  VulnHawk is an advanced, full-stack web application vulnerability scanner that tests for all OWASP Top 10 (2021) vulnerability classes using active probing, ML-based severity classification, CVE enrichment, and automated PDF reporting โ€” all wrapped in a real-time terminal-style web dashboard.


---

## ๐Ÿ“ธ Dashboard Preview

```
โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘  ๐Ÿ›ก VULNHAWK          STATUS: ACTIVE    FINDINGS: 14    โ•‘
โ• โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฃ
โ•‘  TARGET: http://testphp.vulnweb.com                     โ•‘
โ•‘  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘  87%                       โ•‘
โ•‘  ๐Ÿค– Running ML severity classifier...                   โ•‘
โ• โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฆโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฃ
โ•‘  RISK: HIGH  โ•‘  FINDINGS TABLE                          โ•‘
โ•‘  CRIT:  2    โ•‘  #  Vulnerability        Severity  Score โ•‘
โ•‘  HIGH:  5    โ•‘  1  SQL Injection        CRITICAL   95   โ•‘
โ•‘  MED:   4    โ•‘  2  Reflected XSS        HIGH       78   โ•‘
โ•‘  LOW:   3    โ•‘  3  Missing HSTS         MEDIUM     52   โ•‘
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฉโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
```

---

## โœจ Key Features

### ๐Ÿ” Scanning Modules
| Module | OWASP | What It Detects |
|--------|-------|-----------------|
| **SQL Injection** | A03:2021 | Error-based, time-based blind, boolean blind, NoSQL |
| **Cross-Site Scripting** | A03:2021 | Reflected, DOM-based, filter bypass payloads |
| **Security Headers** | A05:2021 | Missing HSTS, CSP, X-Frame-Options, cookie flags |
| **SSRF** | A10:2021 | Internal endpoints, cloud metadata (AWS/GCP/Azure) |
| **Path Traversal / LFI** | A01:2021 | Unix/Windows traversal, encoded variants |

### ๐Ÿค– ML Severity Classifier
- **Gradient Boosting** model trained on vulnerability feature vectors
- Features: vuln type, CVSS score, detection confidence, parameter context, OWASP rank
- Outputs: `ml_severity`, `ml_confidence`, `exploitability_score` (0โ€“100)
- Auto-trains and caches model on first run (`ml/vulnhawk_model.pkl`)

### ๐ŸŒ Threat Intelligence
- **NIST NVD API v2.0** โ€” fetches related CVEs per CWE/vulnerability type
- **AbuseIPDB** โ€” scores target IP for malicious activity history
- **HaveIBeenPwned** โ€” checks if target domain appears in known data breaches

### ๐Ÿ“Š Live Dashboard
- Real-time WebSocket progress updates
- Interactive severity bar chart, OWASP doughnut chart
- Filterable findings table with exploitability scores
- Click-to-expand detail modal with CVEs, MITRE ATT&CK mapping, remediation

### ๐Ÿ“„ PDF Reports
- Auto-generated, professionally styled PDF with:
  - Executive summary & risk rating
  - Per-finding detail blocks with evidence and remediation
  - MITRE ATT&CKยฎ coverage matrix
  - Prioritized remediation roadmap
  - Threat intelligence data (IP rep, breach records)

---

## ๐Ÿ—๏ธ Architecture

```
VulnHawk/
โ”œโ”€โ”€ api/
โ”‚   โ””โ”€โ”€ main.py              โ† FastAPI app + WebSocket engine + scan orchestrator
โ”œโ”€โ”€ scanner/
โ”‚   โ”œโ”€โ”€ crawler.py           โ† Async BFS web crawler (URLs, forms, params)
โ”‚   โ”œโ”€โ”€ sqli.py              โ† SQL Injection scanner (3 detection methods)
โ”‚   โ”œโ”€โ”€ xss.py               โ† XSS scanner (Reflected + DOM-based)
โ”‚   โ”œโ”€โ”€ headers.py           โ† HTTP headers + cookie + TLS auditor
โ”‚   โ””โ”€โ”€ ssrf.py              โ† SSRF + Path Traversal scanner
โ”œโ”€โ”€ ml/
โ”‚   โ””โ”€โ”€ classifier.py        โ† Gradient Boosting severity classifier
โ”œโ”€โ”€ intel/
โ”‚   โ””โ”€โ”€ cve_lookup.py        โ† NVD CVE + AbuseIPDB + HIBP integration
โ”œโ”€โ”€ report/
โ”‚   โ””โ”€โ”€ pdf_gen.py           โ† ReportLab PDF generator + MITRE mapper
โ”œโ”€โ”€ dashboard/
โ”‚   โ””โ”€โ”€ templates/index.html โ† Terminal-style live dashboard (vanilla JS)
โ”œโ”€โ”€ config/
โ”‚   โ””โ”€โ”€ settings.py          โ† All config, OWASP categories, severity maps
โ”œโ”€โ”€ tests/
โ”‚   โ””โ”€โ”€ test_scanner.py      โ† pytest unit tests
โ”œโ”€โ”€ Dockerfile
โ”œโ”€โ”€ docker-compose.yml
โ”œโ”€โ”€ requirements.txt
โ””โ”€โ”€ .env.example
```

---

## ๐Ÿš€ Quick Start

### Option 1 โ€” Docker (Recommended)

```bash
# Clone the repo
git clone https://github.com/YOUR_USERNAME/VulnHawk.git
cd VulnHawk

# Configure API keys (optional but recommended)
cp .env.example .env
nano .env

# Build and run
docker-compose up --build

# Open dashboard
open http://localhost:8000
```

### Option 2 โ€” Local Python

```bash
# Clone
git clone https://github.com/YOUR_USERNAME/VulnHawk.git
cd VulnHawk

# Create virtual environment
python -m venv venv
source venv/bin/activate        # Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Configure environment
cp .env.example .env
# Edit .env with your API keys

# Run
python -m api.main
# OR
uvicorn api.main:app --host 0.0.0.0 --port 8000 --reload

# Open dashboard
open http://localhost:8000
```

---

## ๐Ÿ”‘ API Keys (Optional)

All API integrations are optional โ€” VulnHawk works without them, but they enrich results significantly.

| Service | Purpose | Get Key |
|---------|---------|---------|
| NIST NVD | CVE enrichment (free) | [nvd.nist.gov/developers](https://nvd.nist.gov/developers/request-an-api-key) |
| AbuseIPDB | IP reputation (free tier) | [abuseipdb.com/register](https://www.abuseipdb.com/register) |
| HaveIBeenPwned | Breach data ($3.50/mo) | [haveibeenpwned.com/API/Key](https://haveibeenpwned.com/API/Key) |

---

## ๐Ÿ“ก API Reference

### Start a Scan
```http
POST /api/scan
Content-Type: application/json

{
  "target_url": "http://testphp.vulnweb.com",
  "scan_modules": ["sqli", "xss", "headers", "ssrf", "traversal"],
  "generate_pdf": true,
  "enrich_cve": true
}
```

### Get Scan Status
```http
GET /api/scan/{scan_id}
```

### Download PDF Report
```http
GET /api/scan/{scan_id}/report
```

### WebSocket Live Updates
```javascript
const ws = new WebSocket('ws://localhost:8000/ws/{scan_id}');
ws.onmessage = (e) => {
  const { type, progress, message, findings } = JSON.parse(e.data);
  // type: "progress" | "complete" | "error"
};
```

---

## ๐Ÿง  ML Model Details

The ML classifier uses a **Gradient Boosting** ensemble with 8 handcrafted features:

| Feature | Description |
|---------|-------------|
| `vuln_type_enc` | Encoded vulnerability category (0โ€“19) |
| `cvss_score` | Base CVSS score from scanner |
| `detection_method` | Confidence of detection (0=passive, 2=active) |
| `has_payload` | Whether an active payload was used |
| `has_evidence` | Whether direct evidence was captured |
| `param_is_url` | Detects URL-class injection parameters |
| `param_is_file` | Detects file-class injection parameters |
| `owasp_rank` | OWASP category rank (A01=1 โ†’ A10=10) |

Training data: 460 synthetic samples with Gaussian noise for generalization.  
Model accuracy on held-out test set: **~89%** (5-class severity classification).

---

## โš–๏ธ Legal & Ethical Use

> **VulnHawk is designed exclusively for authorized security testing.**

- โœ… Scan your own applications
- โœ… Scan with explicit written permission
- โœ… Use in CTF / bug bounty targets that allow automated scanning
- โœ… Use against intentionally vulnerable apps: [DVWA](https://dvwa.co.uk/), [WebGoat](https://owasp.org/www-project-webgoat/), [VulnHub](https://www.vulnhub.com/)
- โŒ Never scan targets without authorization
- โŒ Never use against production systems without permission

The author is not responsible for misuse of this tool.

---

## ๐Ÿงช Running Tests

```bash
pip install pytest pytest-asyncio
pytest tests/ -v
```

---

## ๐Ÿ—บ๏ธ MITRE ATT&CKยฎ Coverage

| Vulnerability | Tactic | Technique |
|--------------|--------|-----------|
| SQL Injection | Initial Access | T1190 โ€“ Exploit Public-Facing Application |
| XSS | Execution | T1059 โ€“ Command & Scripting Interpreter |
| SSRF | Discovery | T1083 โ€“ File and Directory Discovery |
| Path Traversal | Collection | T1005 โ€“ Data from Local System |
| Missing HSTS | Credential Access | T1557 โ€“ Adversary-in-the-Middle |
| Insecure Cookie | Credential Access | T1539 โ€“ Steal Web Session Cookie |

---

## ๐Ÿ› ๏ธ Technologies Used

| Layer | Technology |
|-------|-----------|
| Backend | Python 3.11, FastAPI, Uvicorn |
| Async HTTP | httpx, asyncio |
| HTML Parsing | BeautifulSoup4, lxml |
| Machine Learning | scikit-learn (Gradient Boosting, StandardScaler) |
| Threat Intel | NIST NVD API, AbuseIPDB API, HaveIBeenPwned API |
| PDF Generation | ReportLab |
| Frontend | Vanilla JS, Chart.js, WebSocket API |
| Containerization | Docker, Docker Compose |
| Testing | pytest, pytest-asyncio |

---

## ๐Ÿ“„ License

MIT License โ€” see [LICENSE](LICENSE) for details.

---

## ๐Ÿ™ References

- [OWASP Top 10 (2021)](https://owasp.org/www-project-top-ten/)
- [MITRE ATT&CKยฎ Framework](https://attack.mitre.org/)
- [NIST National Vulnerability Database](https://nvd.nist.gov/)
- [PortSwigger Web Security Academy](https://portswigger.net/web-security)
- [OWASP Testing Guide v4.2](https://owasp.org/www-project-web-security-testing-guide/)