Hunt: SQLi - time-based expert (microskill)
Time-based extraction expert of the sqli split: nothing renders and no differential exists - the only channel is response latency. The core (hunt-sqli) owns mapping and the sqlmap contract; this skill owns the timing oracle.
Load-bearing ideas: (1) clock skew and load produce 2-5s delays all by themselves - EVERY claim needs an A/B pair with repeat-to-confirm; (2) a query that is inherently slow mimics SLEEP - the volatile-SLEEP caveat; (3) this is the slowest channel: rank what actually needs extracting before spending minutes per character.
Wiki
Hub: [[sql-injection]] - Primary page: [[sql-injection]] REFS: [[sql-injection]]
qmd on hint only: "time based sqli sleep pg_sleep waitfor delay clock skew" - the sqli page first.
Shared obfuscation arsenal: hunt-sqli/references/waf-bypass.md -
SLEEP blocked -> BENCHMARK()/GET_LOCK() (tamper sleep2getlock), SQLite
CPU-burn oracle when SLEEP absent, scientific-notation
(1' or 1.e(1)) whitespace bypass.
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-time.jsonl into the core'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.
- Serial probes with a pause between them (timing needs a quiet channel); the extractor loop runs detached (vm-bg.sh) writing to $RUN - a 1-char extraction at 5s/bit is minutes, not seconds.
- RoE: no_dos - keep SLEEP bounded (<=5s) and serial; never parallelize timing probes.
- 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:
Active engagement exists; the injection point is on targets//scope.md in-scope. Scope-guard is the deny.
hunt-core loaded (skills/exploit/hunt/hunt-core/SKILL.md).
Core verified: $RUN/raw/vector-map.md exists AND the core pointer carries SQLI-HUNT-DONE with time named in next=. Missing = dispatch hunt-sqli core 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/sqli/<host>/sqli-time-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: one delayed response; a delay that does not repeat; a delay from the baseline query too (inherently slow query).
IS confirmation: the delay flips WITH the payload across repeat A/B pairs (SLEEP(5) vs SLEEP(0) controls), stable against the baseline, extracting a known value correctly (version() verified against the banner), reproduced from your own written steps.
Methodology
Step 1 - Baseline + A/B pair
Baseline latency recorded (3 probes). Then the pair: payload with SLEEP(5) vs the same payload with SLEEP(0) - repeat BOTH twice; the delta must track the payload, not the clock. Clock-skew caveat: a flat time response does NOT disprove injectability (volatile-SLEEP caveat - some drivers fold SLEEP during optimization); it only closes the channel when the A/B pair itself is clean.
Step 2 - Engine grammar
SLEEP(5) (MySQL), pg_sleep(5) (Postgres), WAITFOR DELAY '0:0:5' (MSSQL), heavy-query equivalents (Oracle: UTL_INADDR.gethostaddress shapes / heavy joins). Conditional forms: IF(cond,SLEEP(5),0), CASE WHEN cond THEN SLEEP(5) END.
Step 3 - Bounded extraction
Binary search per character through the conditional-delay oracle; version() first (verify vs banner); then ONLY the core's ranked targets - this channel is slow, do not enumerate for sport. Every extracted value cites its A/B probe pairs. Detached run + progress file under $RUN.
Step 4 - Exit
Append rows to the core's $RUN/candidates.jsonl;
SQLI-TIME-DONE oracle=<engine-delay> values=<n> appended to the
core pointer $ENG_DIR/hunt-sqli-.md; _requests.md rows (lane =
hunt-sqli-time); Deadends per unstable timing.
Chaining
- A differential appears under quieter conditions -> hunt-sqli-boolean (faster channel).
- Outbound allowed (egress on 53/80/443, DB can call out) -> hunt-sqli-oob (much faster than timing).
- sqlmap when manual bounds exceed: the CORE's contract (--technique=T).
Validation
- Proof = repeat-pair delay flip + a known value extracted right.
- Negative control: baseline query without SLEEP stays flat.
False Positives
- Inherently slow query mimicking delay (baseline check kills it).
- Network jitter in the 2-5s band (repeat-to-confirm kills it).
- WAF holding the connection open on suspicious input (delay on BOTH sides of the pair kills it).
Severity
CRITICAL = credential/sensitive extraction. HIGH = version + schema chain. MEDIUM = proof of delay control only.
N/A escapes
- "N/A: no stable timing channel" (A/B pair evidence, incl. the volatile-SLEEP caveat note) 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 repeat-pair gate survives freehand. Declare with a _requests.md row (lane = hunt-sqli-time-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-time.jsonl,
candidates.jsonl rows, pointer line SQLI-TIME-DONE. 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; repeat-pair proof on every claimed value; SLEEP bounded <=5s serial (no_dos); 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).