Hunt: XSS - reflected expert (microskill)
Reflected-XSS expert of the xss split: the input comes back in the immediate response. The mapper (hunt-xss) owns the reflection map, sanitizer probe, and class routing; this skill owns everything from context classification to a browser-validated execution.
The load-bearing idea: context decides the payload. A payload that fires in an HTML body dies inside a JS string. Classify the reflection context FIRST, pick the breakout for THAT context, and only then worry about filters.
Wiki
Hub: [[wiki/techniques/web/xss]] - Primary page: [[wiki/techniques/web/xss]]
Context matrix: [[wiki/techniques/web/xss]] (if harvested) - Payloads:
wiki/payloads/xss.md
REFS: [[wiki/techniques/web/xss]], wiki/payloads/xss.md
qmd on hint only: "reflected xss context breakout attribute javascript string waf bypass" - the payload page first.
Paths (binding - shared with the mapper run)
# seat side (wsl):
ENG_DIR=/mnt/c/Users/Lenovo/Desktop/VMshare/<eng>/<eng>
RUN=$ENG_DIR/hunt/xss/<host> # SHARED with hunt-xss
# VM side:
ENG_DIR=/mnt/VMshare/<eng>/<eng>
RUN=$ENG_DIR/hunt/xss/<host>
Experts write probes/xss-reflected*.jsonl into the mapper's $RUN tree.
Transport
Every VM-native command block ships through ONE documented transport:
wsl.exe -d kali-linux -u root bash -c "cd /mnt/c/Users/Lenovo/Documents/ObisidianVaults/ZTorch/ZTorch && bash scripts/vm-ssh.sh '<command>'"
- vm-ssh lands as user tz (NOT root); one argument per call; quotes
ship as base64 (
echo <b64> | base64 -d | bash). - Target-facing curls MUST use /opt/scope-shim/bin/curl by absolute path; out-of-scope dies rc 126 (never work around); UNKNOWN = ADVISORY, self-deny.
- Browser validation runs on the seat (real browser); console snapshots + screenshots into targets//poc/.
Entry gate
All four must pass; each is falsifiable:
Active engagement exists; the reflection point is on targets//scope.md in-scope. Scope-guard is the deny.
hunt-core loaded (skills/exploit/hunt/hunt-core/SKILL.md).
Mapper verified: $RUN/raw/reflection-map.md exists AND the XSS-HUNT-DONE pointer names reflected in next=. Missing = dispatch hunt-xss first.
Toolchain preflight (fails LOUD):
for t in /usr/bin/jq /usr/bin/python3 \ /opt/scope-shim/bin/curl; do [ -x "$t" ] || { echo "MISSING TOOL: $t"; exit 1; } done
Checklist (mandatory)
Copy checklist.md (this skill's dir) to
$ENG_DIR/hunt/xss/<host>/xss-reflected-checklist.md at run start.
Unchecked at stop = UNCHECKED lane, re-run from the first unchecked
step. SKILL.md and the checklist header agree byte-for-byte on that
copy target.
Nudge
Review-skill re-injection text (pinned; NOTE: completion-gate emits its own generic nudge - both mean: resume at the first unchecked box):
Your work was just reviewed by the review skill and it was found
that you either missed a step of analysis, or didn't generate an
artifact of sufficient proof. Look at the markdown based checklist
and the output for each step, find what you missed, and complete
that step.
Confirmation gate
NOT confirmation: markup reflected in a response body; a payload that "looks right" in the HTML source; an alert box on YOUR local copy of the page.
IS confirmation: alert(window.origin) (or equivalent) EXECUTED in a real browser against the live target, console captured, reproduced from your own written steps. Click-required vectors (hover/redirect) are classified as such - they are real but lower severity; say which.
Methodology
Steps 1-2 - Context classification + breakout
Per reflection point: HTML body / tag name / attribute value / JS
string / URL / CSS. The breakout is mechanical per context (close the
quoting construct, close the tag, escape the string). Record
point | context | breakout | evidence rows. The mapper's sanitizer
verdict (aaa"bbb'ccc<ddd) gates this: a field through an escaping
renderer is closed HERE, not after fifty payloads.
Steps 3-6 - Combos + vectors
- Allowlisted combos when tags are blocked:
<math><style>,<svg><style>,<iframe srcdoc>- full carry inwiki/payloads/xss.md. - Markdown/RDoc:
[text](javascript:alert(document.domain)),link:javascript:. - Redirect params:
?redirect=javascript:alert(1). - UTM params: utm_source/utm_medium - often unsanitized on marketing pages.
Steps 7-8 - Evasion + validation
- WAF evasion: obfuscate ONLY the blocked token, never the whole payload (over-obfuscation breaks before the filter does); one variation at a time, plain payload as the A/B control.
- Browser validation: alert(window.origin) executed; console snapshot beside the screenshot into targets//poc/.
Step 9 - Exit
Append rows to the mapper's $RUN/candidates.jsonl;
XSS-REFLECTED-DONE contexts=<n> fired=<n> appended to the mapper
pointer $ENG_DIR/hunt-xss-.md; _requests.md rows (lane =
hunt-xss-reflected); Deadends per clean context.
Chaining
- Field persists + renders elsewhere -> hunt-xss-stored owns it.
- Sink is client-side (hash/postMessage/innerHTML) -> hunt-xss-dom.
- Admin/moderation viewer -> hunt-xss-blind (beacon ops).
Validation
- Proof = executed alert(window.origin) with console capture; click-required vectors explicitly classified.
- Negative control: the same URL without the payload renders clean.
False Positives
- Reflected but always-encoded context (the sanitizer verdict).
- Payload fires only on your local copy / stale cache.
- WAF-blocked payload reported as "no XSS" without a plain-payload control proving the context itself is injectable.
Severity
HIGH = executed in an authenticated/privileged page. MEDIUM = executed, user-triggered. LOW = click-required/hover/redirect.
N/A escapes
- "N/A: no markdown renderer" An N/A tick is a claim with a reason, never a silent pass. Identical strings in SKILL.md and checklist.md.
Bitter-pill variant
Freehand run: skip checklist + numbered steps, one freehand pass over the reflection map, output ONLY $RUN/analysis/bitter-pill.md. The browser-executed gate survives freehand. Declare with a _requests.md row (lane = hunt-xss-reflected-bitterpill).
Depth walk (mandatory)
Walk EVERY applicable row of the payload arsenal page cited above.
Record each row in $RUN/coverage-depth.md as a table
| row | state | evidence | where state is probed, blocked, or
N/A, and evidence is a probe-pair path or a Deadends.md line. A bare
probed with no evidence reference fails the completion gate
(NEEDS-REVIEW). N/A rows cite why (surface shape forbids it).
Blocked implies research: before any Deadend is claimable on a blocked
row, (a) walk the arsenal page's bypass-ladder rows for that control
class, and (b) run one wiki query AND one mcp__wigolo__search for the
specific tech-plus-control bypass. Results, or a genuine null, land in
coverage-depth.md. "No research tried" is not a claimable state.
Exit artifact + handoff
Appends into the shared mapper $RUN: probes/xss-reflected*.jsonl,
analysis/xss-reflected-contexts.md, candidates.jsonl rows, pointer
line XSS-REFLECTED-DONE. Consumer: triage. Findings leave ONLY
through G1. Distill: python3 scripts/wiki-stage.py --kind technique --slug <slug> --target-page techniques/web/xss.md.
Stop conditions
All steps terminal; browser-validated or click-classified claims only; nothing written into skill dirs; no unchecked boxes above REVIEW; hunt-core stop conditions fire unchanged.
Attack surface
APPROACH: Map every reflection point, classify reflected/stored/DOM, probe the sanitizer (aaa"bbb'ccc<ddd), then fire the context-matched payload; plant a blind beacon in admin/moderation-viewed fields and confirm the session-theft callback.
AVOID: A payload that comes back URL/HTML-encoded (<script>) is NOT XSS; a blind/stored beacon is unproven until its oob.md row flips to HIT.
Cross-routing
- Load hunt-upload for SVG/file-borne payload delivery.
- Load hunt-cache / hunt-smuggling when the payload needs a poisoned or desynced response to reach the victim.
- Load hunt-llm when the sink renders model output (markdown render of LLM content).
- Not this skill: stored-but-always-escaped fields (deadend with the control named).