Skip to content

Commit eff314b

Browse files
author
fevra-dev
committed
feat(waf): data-driven WAF engine, charset/header probes, README update
- Replace ad-hoc waf.py with orchestrator + signature loader + bypass engine - Add PROBE-CHARSET-01 (IBM037 body) and PROBE-HEADER-01 (X-Forwarded-For) - Provider YAMLs and bypass chains for 10 WAFs; scanner uses get_bypass_payloads - Update README WAF section and What's New
1 parent 6b3cd9e commit eff314b

21 files changed

Lines changed: 2957 additions & 864 deletions
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Security Scan
2+
on:
3+
push:
4+
branches: [ main, develop ]
5+
pull_request:
6+
branches: [ main ]
7+
schedule:
8+
- cron: '0 0 * * 0'
9+
jobs:
10+
security-scan:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Set up Python
15+
uses: actions/setup-python@v5
16+
with:
17+
python-version: '3.11'
18+
- name: Install Stiletto
19+
run: pip install -r requirements.txt
20+
- name: Run Stiletto
21+
env:
22+
TARGET_URL: ${{ secrets.TARGET_URL }}
23+
run: |
24+
python stiletto.py -u "$TARGET_URL" --output json -o stiletto_results.json || true
25+
- name: Upload results
26+
if: always()
27+
uses: actions/upload-artifact@v4
28+
with:
29+
name: stiletto-results
30+
path: stiletto_results.json

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Built for learning, authorized penetration testing, and security research.
2929
- **CVE Sync**: Automatically sync SQL injection CVEs from [Trickest's 23K+ CVE repository](https://github.com/trickest/cve)
3030
- **PoC Fetcher**: Extracts real payloads from GitHub exploit repositories
3131
- **Dynamic Payloads**: Scanner uses 115+ payloads extracted from real-world CVEs (2023-2025)
32+
- **Data-driven WAF engine**: Provider definitions in YAML (`waf_signatures/providers/`), passive header + active probe fingerprinting, charset (IBM037) and header-injection probes, provider-specific bypass chains
3233
- **Latest Techniques**: Stay current with latest SQLi bypasses, WAF evasions, and PoCs
3334
- **Threat Intelligence**: 500+ SQLi CVEs catalogued with PoC references
3435
- **Enhancements**: Second-order SQLi, HPP, GraphQL SQLi, OOB, exploit chains, compliance (PCI-DSS/ASVS/GDPR), remediation verification, genetic fuzzer, cloud-specific tests, CISA KEV/ExploitDB enrichment, and CI/CD config generator
@@ -113,10 +114,13 @@ python stiletto.py -u "http://example.com/page?id=1" --second-order --hpp --grap
113114
| **JSON-Based** | WAF bypass via JSON syntax | MySQL, PostgreSQL, MongoDB |
114115
| **Stacked Queries** | Multiple statement execution | MSSQL, PostgreSQL |
115116

116-
### 🛡️ WAF Detection & Bypass
117-
- **30+ WAF Signatures**: Cloudflare, AWS WAF, Akamai, Imperva, F5, ModSecurity, and more
118-
- **20+ Tamper Techniques**: Automatic payload obfuscation to bypass filters
119-
- **Adaptive Bypass**: Selects optimal techniques based on detected WAF
117+
### 🛡️ WAF Detection & Bypass (Data-Driven Engine)
118+
- **Provider YAML definitions**: 10 major WAFs (Cloudflare, AWS WAF, Azure, Akamai, F5, Imperva, ModSecurity/CRS, Google Cloud Armor, Fortinet, Palo Alto) with signatures and blind spots in `src/waf_signatures/providers/*.yaml`
119+
- **Passive + active fingerprinting**: Header-based detection first; if inconclusive, a probe suite sends targeted SQLi payloads and scores providers by which probes get blocked
120+
- **Probe suite**: Standard GET/POST parameter probes, plus **charset probe** (IBM037-encoded body with `Content-Type: charset=ibm037`) and **header-injection probe** (payload in `X-Forwarded-For`) to detect WAFs that don’t inspect those vectors
121+
- **Provider-specific bypass chains**: Each provider has an ordered list of strategies (encoding, comment, charset, JSON syntax, size overflow, header abuse, etc.); the engine applies the chain to generate obfuscated payload variants
122+
- **20+ transform techniques**: `randomcase`, `space2comment`, `mysql_version_comment`, `double_urlencode`, `encode_ibm037`, `prepend_json_operator`, `pad_to_8kb`, `move_to_header`, and more
123+
- **Backward compatibility**: Scanner still uses `WAFDetector.detect()` and `get_bypass_payloads()`; legacy `WAFType` / `WAFDetectionResult` / `TamperEngine` remain for compatibility
120124

121125
### 🤖 AI-Powered Features
122126
- **GPT-4 Payload Generation**: Context-aware payloads that adapt to WAF blocks

requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
# Async HTTP client
99
aiohttp>=3.9.0
1010

11+
# WAF signature definitions (YAML)
12+
PyYAML>=6.0
13+
1114
# Standard HTTP requests (fallback)
1215
requests>=2.31.0
1316

0 commit comments

Comments
 (0)