Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

sql-injection-testing

БесплатноЗапускает вложенные скриптыНе проверен

Validate SQL injection vulnerabilities (including blind SQLi) across time-based, error-based, boolean-based, UNION-based, stacked-query, and out-of-band…

anshumanbhот anshumanbh★ 287 звёзд на GitHub

Об этом скилле

SQL Injection Testing Skill

Purpose

Validate SQL injection (including blind SQLi) by injecting SQL syntax into user-controlled inputs and observing:

  • Time-based delays (blind)
  • Error messages (error-based)
  • Boolean/content differences (blind)
  • Data extraction via UNION
  • Stacked queries where supported
  • Out-of-band interactions (DNS/HTTP callbacks) when infra allows

Vulnerability Types Covered

1. Time-Based Blind SQLi (CWE-89)

Inject time-delay functions and detect response latency.

Detection Methods: SLEEP(5), pg_sleep(5), WAITFOR DELAY '0:0:5', heavy functions (e.g., randomblob() for SQLite).

2. Boolean-Based Blind SQLi (CWE-89)

Inject true/false conditions and compare content/length/status.

Detection Methods: ' OR '1'='1 vs ' OR '1'='2, AND 1=1 vs AND 1=2.

3. Error-Based SQLi (CWE-89)

Trigger SQL parser errors and observe verbose error responses.

Detection Methods: stray quote/backtick, type-cast errors, extractvalue()/updatexml() (MySQL), CAST('a' AS INT) (PostgreSQL/MSSQL).

4. UNION-Based SQLi (CWE-89)

Use UNION to extract data when column counts align.

Detection Methods: UNION SELECT NULL,NULL, ORDER BY N probing for column count.

5. Stacked Queries (CWE-89)

Inject additional statements when DB/driver permits (e.g., MSSQL ; WAITFOR, PostgreSQL ; SELECT pg_sleep(5)).

6. Out-of-Band SQLi (CWE-89)

Detect DNS/HTTP callbacks via load_file(), xp_dirtree, or UTL_HTTP/UTL_INADDR when response-based detection is blocked (use only if callback infra is authorized).

7. ORM/Framework-Specific (CWE-564)

Hibernate/JPA or query-builder misuse leading to SQLi (parameter concatenation, unsafe createQuery).

Database-Specific Notes

Database Time-Based Error-Based Boolean-Based UNION Stacked Queries
MySQL/MariaDB SLEEP(5) ✓ ✓ ✓ Limited
PostgreSQL pg_sleep(5) ✓ ✓ ✓ ✓ (; SELECT ...)
MSSQL WAITFOR DELAY '0:0:5' ✓ ✓ ✓ ✓
Oracle dbms_pipe.receive_message ✓ ✓ ✓ Limited
SQLite No native sleep; use heavy ops (randomblob) ✓ ✓ Partial No

Prerequisites

  • Target reachable; SQL-backed functionality identified (endpoints, forms, headers, cookies, path params).
  • If authentication required: test accounts available (low-priv + optional admin) or mark paths UNVALIDATED.
  • Know (or infer) DB type to choose correct payloads; default to generic when unknown.
  • VULNERABILITIES.json with suspected SQLi findings if provided.

Testing Methodology

Phase 1: Identify Injection Points

  • URL params, POST bodies (JSON/form), headers, cookies, path segments.
  • Look for string interpolation, query concatenation, ORM custom queries.

Phase 2: Establish Baseline

  • Send a benign request; record status, content length, and response time.
  • Note WAF/rate-limit behaviors.

Phase 3: Execute SQLi Tests

Time-Based (Blind):

payload = "123' OR SLEEP(5)--"
resp_time = send(payload)
if resp_time > baseline_time + 4.5:
    status = "VALIDATED"

Boolean-Based (Blind):

true_p = "123' OR '1'='1"
false_p = "123' OR '1'='2"
len_true = len(send(true_p).text)
len_false = len(send(false_p).text)
if abs(len_true - len_false) >= 50:
    status = "VALIDATED"

Error-Based:

payload = "123'"
resp = send(payload)
if any(err in resp.text.lower() for err in sql_errors):
    status = "VALIDATED"

UNION/Stacked Probing:

  • ORDER BY incrementally to find column count.
  • UNION SELECT NULL,... until count matches; watch for 200 vs 500.
  • For stacked-capable DBs: append ; SELECT pg_sleep(5) or ; WAITFOR DELAY '0:0:5'.

Out-of-Band (only if infra-approved):

  • Use controlled collaborator domain; record DNS/HTTP hits.
  • Stop if any unexpected external interaction occurs.

Phase 4: Classification Logic

Status Meaning
VALIDATED Clear SQLi indicators (delay, error, boolean diff, data via UNION/stacked, OOB hit)
FALSE_POSITIVE No indicators; behavior unchanged
PARTIAL Mixed/weak signals (small deltas, inconsistent responses)
UNVALIDATED Blocked, error, or insufficient evidence

Phase 5: Capture Evidence

Capture minimal structured evidence (redact PII/secrets, truncate to 8KB, hash full response). Include:

  • status, injection_type, cwe
  • Baseline request (url/method/status/time/hash)
  • Test request (url/method/status/time/hash, or collaborator hit details)
  • Payload used
  • Note if truncated and original size

Phase 6: Safety Rules

  • Detection-only payloads; never destructive statements (DROP/DELETE/TRUNCATE/UPDATE/INSERT).
  • Avoid data exfiltration; prefer boolean/time-based confirmation.
  • Do not send OOB callbacks unless explicitly authorized.
  • Respect rate limits; add delays between time-based probes.
  • Redact cr
Полный SKILL.md на GitHub

Установить sql-injection-testing в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Read
Write
Bash

Вложенные файлы

examples.mdreference/README.mdreference/sql_payloads.pyreference/validate_sqli.py

FAQ

Что делает скилл sql-injection-testing?

Validate SQL injection vulnerabilities (including blind SQLi) across time-based, error-based, boolean-based, UNION-based, stacked-query, and out-of-band patterns. Use when testing CWE-89 (SQL Injection), CWE-564 (Hibernate SQL Injection), and related SQL injection classes across MySQL, PostgreSQL, MSSQL, Oracle, and SQLite targets.

Как установить скилл sql-injection-testing?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл sql-injection-testing запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить sql-injection-testing с