Skenario Pengujian
Halaman ini berisi skenario uji manual yang dapat dijalankan setelah npm run dev.
Semua skor dihitung dari config/rules.json dengan threshold default 50.
Persiapan
Section titled “Persiapan”npm run devDev server berjalan di http://localhost:8787. Jika ORIGIN_URL kosong, request yang lolos
akan menerima teks placeholder, bukan response origin.
Matriks pengujian
Section titled “Matriks pengujian”| # | Request | Skor | Hasil yang diharapkan |
|---|---|---|---|
| 1 | GET /etc/passwd |
50 | Honeypot lfi |
| 2 | GET /.env |
25 | Lolos |
| 3 | GET /.env/wp-admin |
65 | Honeypot recon |
| 4 | GET /wp-admin |
20 | Lolos |
| 5 | GET /?q=union+select |
60 | Honeypot sqli |
| 6 | GET /?q=%3Cscript%3E |
35 | Lolos |
| 7 | GET /?q=%3Cscript%3Edocument.cookie |
80 | Honeypot xss |
| 8 | GET /?q=../../etc/passwd |
100 | Honeypot lfi |
| 9 | GET /?q=../../ |
35 | Lolos |
| 10 | POST /api JSON union select |
60 | Honeypot sqli |
| 11 | GET /?url=http://169.254.169.254/ |
60 | Honeypot ssrf |
| 12 | GET /?cmd=;whoami |
55 | Honeypot rce |
| 13 | GET /proc/self/environ |
50 | Honeypot lfi |
| 14 | GET / dengan UA sqlmap |
0 | Lolos (headers belum dipakai) |
| 15 | 6× GET /etc/passwd berturut-turut |
— | Trigger ke-6 diblokir 403 |
| 16 | GET / |
0 | Lolos |
Perintah lengkap
Section titled “Perintah lengkap”1. LFI di path
Section titled “1. LFI di path”curl -i "http://localhost:8787/etc/passwd"lfi:0 cocok di path → 50. Response berisi header X-Bangk-Shield: honeypot-active.
2. Recon sendirian
Section titled “2. Recon sendirian”curl -i "http://localhost:8787/.env"recon:0 = 25, di bawah threshold → diteruskan.
3. Recon combo
Section titled “3. Recon combo”curl -i "http://localhost:8787/.env/wp-admin"recon:0 (25) + recon:2 (20) + combo (20) = 65.
4. Recon lemah
Section titled “4. Recon lemah”curl -i "http://localhost:8787/wp-admin"recon:2 = 20 → lolos.
5. SQLi di query
Section titled “5. SQLi di query”curl -i "http://localhost:8787/?q=union+select"Query di-decode menjadi ?q=union select → sqli:0 = 60.
6. XSS sendirian
Section titled “6. XSS sendirian”curl -i "http://localhost:8787/?q=%3Cscript%3E"xss:0 = 35 → lolos.
7. XSS combo
Section titled “7. XSS combo”curl -i "http://localhost:8787/?q=%3Cscript%3Edocument.cookie"xss:0 (35) + xss:2 (30) + combo (15) = 80.
8. LFI combo
Section titled “8. LFI combo”curl -i "http://localhost:8787/?q=../../etc/passwd"lfi:0 (50) + lfi:3 (35) + combo (15) = 100.
9. Path traversal sendirian
Section titled “9. Path traversal sendirian”curl -i "http://localhost:8787/?q=../../"lfi:3 = 35 → lolos.
10. SQLi di body JSON
Section titled “10. SQLi di body JSON”curl -i -X POST "http://localhost:8787/api/search" \ -H "Content-Type: application/json" \ -d "{\"q\":\"union select\"}"Body dibaca karena Content-Type JSON → sqli:0 = 60.
11. SSRF metadata
Section titled “11. SSRF metadata”curl -i "http://localhost:8787/?url=http://169.254.169.254/latest/meta-data"ssrf:0 = 60.
12. RCE command injection
Section titled “12. RCE command injection”curl -i "http://localhost:8787/?cmd=;whoami"rce:3 cocok pada ;whoami → 55.
13. LFI proc environ
Section titled “13. LFI proc environ”curl -i "http://localhost:8787/proc/self/environ"lfi:2 = 50.
14. User-Agent scanner
Section titled “14. User-Agent scanner”curl -i -A "sqlmap/1.7" "http://localhost:8787/"Tidak ada sinyal yang memeriksa header selain User-Agent, dan vector saat ini tidak memakai
headers di where. Hasilnya lolos. Ini menunjukkan bahwa deteksi berbasis User-Agent belum
aktif meskipun engine mendukung field headers.
15. Circuit breaker
Section titled “15. Circuit breaker”for i in 1 2 3 4 5 6; do curl -s -o /dev/null -w "%{http_code}\n" "http://localhost:8787/etc/passwd"doneHasil yang diharapkan:
200200200200200403Trigger ke-6 diblokir karena counter sudah bernilai 5. Lihat Circuit Breaker untuk detail perhitungan.
16. Trafik normal
Section titled “16. Trafik normal”curl -i "http://localhost:8787/"Tidak ada sinyal → diteruskan.
Uji case sensitivity
Section titled “Uji case sensitivity”curl -i "http://localhost:8787/?q=UNION+SELECT"Context di-lowercase dan regex memakai flag i, sehingga tetap terdeteksi dengan skor 60.
Uji false positive
Section titled “Uji false positive”curl -i "http://localhost:8787/?q=how+to+union+select+in+sql"Ini contoh konten sah yang tetap terdeteksi sebagai SQLi (skor 60). Jika situs Anda memuat artikel atau dokumentasi teknis, pertimbangkan untuk:
- Menyesuaikan skor atau pola.
- Menambahkan path artikel ke whitelist.
- Menaikkan threshold.
Uji watermark
Section titled “Uji watermark”curl -i "http://localhost:8787/etc/passwd" | Select-String "X-Bangk-Shield-Watermark"Untuk memverifikasi, hitung ulang hash memakai IP (Unknown IP di lokal), User-Agent curl/x.y,
tanggal UTC hari ini, dan salt yang aktif. Lihat Watermark.
Inspeksi KV lokal
Section titled “Inspeksi KV lokal”Wrangler menyimpan KV lokal di folder .wrangler/.
npx wrangler kv:key get "strike:Unknown IP" --binding=BANGK_KV --localnpx wrangler kv:key list --binding=BANGK_KV --localJika cf-connecting-ip tidak tersedia di lokal, semua request memakai key strike:Unknown IP.
Checklist regresi
Section titled “Checklist regresi”- Known-asset (
.css,.js, path whitelist) tidak memicu honeypot. - Request normal tidak menulis KV.
- Setiap vector dapat memicu honeypot dengan skor yang diharapkan.
- Combo bonus menambah skor sesuai konfigurasi.
- Threshold berubah sesuai
global.score_threshold. - Watermark berformat
bs1-+ 16 hex. - Circuit breaker memblokir trigger ke-6.
- Header
X-Bangk-Shieldsesuai jenis response. -
npm run build:rulesgagal pada rules yang sengaja dirusak. - Error runtime tetap fail-open ke origin.