"""
Comprehensive Pentest Playbook - 100 Vulnerability Types
=========================================================
Multi-phase testing methodologies, bypass techniques, verification checklists,
and thousands of specific AI prompts for the autonomous pentesting agent.
Each entry contains:
- category: Vulnerability category
- title: Human-readable name
- overview: What to test and why
- threat_model: Attack scenarios
- discovery: How to find this vuln
- test_phases: Multi-phase testing with prompts, expected results, decision trees
- bypass_strategies: WAF/filter evasion techniques
- verification_checklist: Steps to confirm true positive
- chain_attacks: How to chain with other vulns
- anti_false_positive: Common FP patterns to avoid
"""
from typing import Dict, List, Any, Optional
# ─────────────────────────────────────────────────────────────
# PENTEST PLAYBOOK - 100 Vulnerability Types
# ─────────────────────────────────────────────────────────────
PENTEST_PLAYBOOK: Dict[str, Dict[str, Any]] = {
# ═══════════════════════════════════════════════════════════
# CHAPTER 1: INJECTION ATTACKS (1-15)
# ═══════════════════════════════════════════════════════════
"xss_reflected": {
"category": "client_side",
"title": "Reflected Cross-Site Scripting (XSS)",
"overview": "User input reflected in HTTP response without sanitization. Test every parameter in every endpoint for reflection, then determine rendering context and craft context-appropriate payloads.",
"threat_model": "Attacker crafts URL with malicious script. Victim clicks link, script executes in their browser session stealing cookies, tokens, or performing actions.",
"discovery": [
"Inject unique canary (e.g., xss8a3f) into every parameter",
"Check if canary appears in response body",
"Determine rendering context: HTML body, attribute, JS, URL, CSS",
"Check Content-Type header (must be text/html)",
"Test both GET and POST parameters",
"Check URL path segments for reflection",
"Test HTTP headers (Referer, User-Agent) for reflection"
],
"test_phases": [
{
"phase": 1,
"name": "Canary Injection & Context Detection",
"prompts": [
"Inject a unique alphanumeric canary string into the parameter. Check if it appears in the response body. If reflected, identify the exact HTML context: is it inside a tag attribute, within a . Check if backslash escaping is applied — if so try \\';alert(1)//.",
"URL CONTEXT: If reflected in href/src, try javascript:alert(1), data:text/html,, or javascript:/**/alert(1).",
"Try case variations: , .",
"Try null bytes: alert(1), ."
],
"expected_results": ["Payload executes in browser", "Alert/console.log fires", "DOM modification visible"],
"decision_tree": {
"payload_executes": "CONFIRMED - Document payload, context, and bypass used",
"payload_reflected_but_no_execution": "Check CSP, check if in non-executable context",
"payload_filtered": "Proceed to Phase 3 - Bypass strategies"
}
},
{
"phase": 3,
"name": "Filter Bypass & WAF Evasion",
"prompts": [
"Try encoding bypass: double URL encoding (%253Cscript%253E), HTML entity encoding (<script>), unicode normalization.",
"Try tag mutation: