Sh Kb Sqli logo

Sh Kb Sqli

Community
dmdhrumilmistry
sh-kb-sqli

Knowledge base for finding SQL injection (and query-language injection). Use when hunting SQLi, or when a hunter/reviewer needs sources, sinks, detection queries, payloads, false-positive filters, and remediation for injection into SQL/ORM raw queries. CWE-89, OWASP A03:2021-Injection.

Overview

Publisherdmdhrumilmistry
Repositorysecurity-harness
Skill namesh-kb-sqli
Stars
42
Forks
11
Bundled files
1
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by dmdhrumilmistry on GitHub. Read the source before you install it.

Installation

Install the Sh Kb Sqli AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/dmdhrumilmistry/security-harness/tree/main/plugins/security-harness/skills/sh-kb-sqli
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/dmdhrumilmistry/security-harness.git /tmp/security-harness
mkdir -p .claude/skills
cp -r /tmp/security-harness/plugins/security-harness/skills/sh-kb-sqli .claude/skills/sh-kb-sqli
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Sh Kb Sqli in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Sh Kb Sqli on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Sh Kb Sqli is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

SQL Injection - Hunter Knowledge Base

SQLi happens when attacker-controlled input is placed into a SQL statement as code rather than data - typically string concatenation/interpolation into a query instead of a bound parameter.

When to hunt this

  • Any code that builds SQL from variables: string concatenation, f-strings/template literals, %/+/.format.
  • ORM "raw" escape hatches even when the ORM normally parameterizes.
  • Dynamic query pieces attackers rarely expect to be bound: table/column names, ORDER BY, LIMIT, IN (...) lists, LIKE patterns.
  • Reachability first: prioritize sinks reachable from an entry point in codebase-map.json.

Sources (untrusted input)

Request params/body/query/headers/cookies, path segments, uploaded content, values from other services, and anything from the entry-point inventory. Also "stored" sources: DB/file values that were themselves attacker-influenced (second-order SQLi).

Sinks by ecosystem (grep targets)

  • Python: cursor.execute(, cursor.executemany(, .execute( on a DB conn; SQLAlchemy text(, .from_statement(, session.execute(, engine.execute(; Django .raw(, .extra(, RawSQL(, connection.cursor(). Danger sign: a %, +, f"...", or .format( inside the SQL string.
  • JS/TS: db.query(, connection.query(, pool.query(, sequelize.query(, knex.raw(, .$queryRawUnsafe( (Prisma), client.query(. Template literals with ${...} inside SQL.
  • Java: Statement.execute*(, createStatement() then executeQuery(concat), JPA createQuery/createNativeQuery with string concat, MyBatis ${} (vs safe #{}).
  • PHP: mysqli_query(, $pdo->query(, ->exec( with concatenation; mysql_query(.
  • Go: db.Query(/db.Exec(/QueryRow( where the query string is built with fmt.Sprintf/+.
  • Ruby: where("... #{}"), find_by_sql(, exec_query(, .where(user_str).
  • .NET: SqlCommand(concat), ExecuteReader with interpolated string; EF FromSqlRaw(.

Detection recipe (see references/graft-guide.md)

  1. graft grep "execute\(|\.query\(|raw\(|createNativeQuery|FromSqlRaw" --json (or Grep).
  2. For each hit, inspect the query argument: is it a bound-parameter call (safe) or string building (suspect)? Grep the same lines for %|\+|\$\{|f\"|\.format\(|#\{|Sprintf|concat.
  3. graft callers <enclosing-fn> to reach an entry point; record the data_flow[] source->sink.
  4. Confirm no whitelist/cast/parameterization intervenes.

Payloads / PoC templates (curated)

  • Detection: ' , '' , 1' OR '1'='1 , 1) OR (1=1 , admin'-- , " OR ""=".
  • Boolean-blind: 1 AND 1=1 vs 1 AND 1=2 (differing responses).
  • Time-blind: 1; WAITFOR DELAY '0:0:5'-- (MSSQL), 1 AND SLEEP(5) (MySQL), 1; SELECT pg_sleep(5)-- (PG).
  • UNION: 1 UNION SELECT NULL,version(),NULL-- (adjust column count/types).
  • Error-based: 1 AND extractvalue(1,concat(0x7e,version())) (MySQL).
  • Second-order: store x'-- via one endpoint, trigger the vulnerable query via another. See references/cheatsheet.md for per-DB detail and ORDER BY/LIKE/IN injection variants.

False-positive filters (do NOT flag)

  • Fully parameterized queries: execute("... WHERE id = %s", [id]), ?/:name placeholders, Prisma $queryRaw tagged template (safe) vs $queryRawUnsafe (unsafe), MyBatis #{} (safe).
  • The interpolated value is a constant/enum/int-cast the attacker cannot control, or is validated against an allowlist (e.g. sort column checked against a fixed set).
  • ORM query builders (.filter(User.id==id), .where({id})) that bind under the hood.
  • Identifiers quoted via a proper quoting API (e.g. psycopg2.sql.Identifier).

CWE / OWASP / severity

  • CWE-89 (SQLi), CWE-943 (NoSQL/query injection). OWASP A03:2021-Injection.
  • Severity: usually critical if unauthenticated and dumps/modifies data; high if authenticated or limited. Blind-only with narrow impact may be high/medium.

Chaining hints

  • SQLi -> read credential/secret tables -> auth bypass / account takeover.
  • SQLi write -> stored XSS or config poisoning.
  • SQLi -> read files (LOAD_FILE, COPY ... FROM PROGRAM) -> RCE on some DBs; -> SSRF via DB features.
  • Feeds chains with secrets, auth, access-control.

Mitigation (put a specific one on each finding)

Use parameterized queries / prepared statements for values; for identifiers use an allowlist or the driver's identifier-quoting API; least-privilege DB accounts; ORM safe APIs. Never concatenate input into SQL.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Sh Kb Sqli AI skill do?

Knowledge base for finding SQL injection (and query-language injection). Use when hunting SQLi, or when a hunter/reviewer needs sources, sinks, detection queries, payloads, false-positive filters, and remediation for injection into SQL/ORM raw queries. CWE-89, OWASP A03:2021-Injection.

Why use Sh Kb Sqli on TypingMind?

Because you install it once and use it with any model. Sh Kb Sqli is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Sh Kb Sqli in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/dmdhrumilmistry/security-harness/tree/main/plugins/security-harness/skills/sh-kb-sqli. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Sh Kb Sqli?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Sh Kb Sqli?

As many as you like. As long as a model supports skills, you can use Sh Kb Sqli with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Sh Kb Sqli AI skill free?

Yes. It is published on GitHub by dmdhrumilmistry under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇