xalgord/xalgorix/pentesting-mongodb
Claude Code and agent skill by xalgord/xalgorix
- community
Checking that the SKILL.md file is still in the repository.
Testing MongoDB document databases (default ports 27017 and 27018) for no-auth/unauthenticated access, weak credentials, database and collection dumping, predictable ObjectID enumeration, config-based auth bypass, and the MongoBleed unauthenticated memory-disclosure CVE during authorized engagements.
Install
npx vskill@latest install xalgord/xalgorix/pentesting-mongodbSKILL.md
The same SKILL.md was published earlier as xalgord/xalgorix/pentesting-mongodb.
Pentesting MongoDB (port 27017)
When to Use
- Default ports
27017/tcpand27018/tcp(shard/replica members);27019config servers,28017legacy HTTP status. - Banner/
nmapshowsmongodband a version likeMongoDB 2.6.9. - Use whenever 27017/27018 is reachable — MongoDB requires no authentication by default and is one of the most commonly exposed databases.
Quick Enumeration
Critical: Checks Most Often Missed
- No-auth / unauthenticated access — the #1 miss. By default mongod accepts connections without credentials;
adminis a common DB. - How to CONFIRM:
mongo <IP>:27017connects andshow dbslists databases without prompting;nmap --script mongodb-brutereports "No authentication needed". Shodan:"mongodb server information" -"partially enabled"= fully open. - Weak / default credentials — if auth is on, brute force common pairs.
- How to CONFIRM:
mongo <db> -u admin -p <pass>connects, ornmap --script mongodb-brutefinds valid creds. - Config-based auth bypass (local root) —
noauth = true(or missingauth = true) inmongodb.conf//opt/bitnami/mongodb/mongodb.conf; if you have root on the host you can flip it and log in. - How to CONFIRM:
grep "noauth.*true" /opt/bitnami/mongodb/mongodb.conf | grep -v '^#'shows it enabled. - Predictable ObjectID enumeration (IDOR) — 12-byte ObjectIDs encode timestamp + machine id + process id + incrementing counter, so adjacent records are guessable in apps that expose them.
- How to CONFIRM: dissect an
_id(first 4 bytes = unix time); usemongo-objectid-predictto generate likely next IDs and test them. - MongoBleed (CVE-2025-14847) — unauthenticated heap memory disclosure — MongoDB 3.6–8.2 with the zlib network compressor enabled trusts an attacker-supplied
uncompressedSizeinOP_COMPRESSED, leaking uninitialized heap (creds, tokens) pre-auth on 27017. - How to CONFIRM:
db.adminCommand({getParameter:1, networkMessageCompressors:1})showszlib; the public PoCpython3 mongobleed.py --host <IP>returns leaked bytes.
Workflow
Step 1: Enumerate
Step 2: Authenticate (no-auth, default/weak creds, brute force)
Step 3: Exploit / Extract (dump databases + collections)
Step 4: Post-access / privilege escalation / pivot
- Dump user collections / app secrets and reuse credentials against web apps, SSH, and other databases.
- With host root and
noauth=true, restart-free login gives full DB access. - ObjectID prediction enables IDOR against any app endpoint that takes a Mongo
_id. - Carve MongoBleed output (
leaks.bin) for credentials, API keys, and session tokens leaked from other connections //proc/ WiredTiger cache; repeat with varied offsets to aggregate secrets.
Key Concepts
| Concept | Description | |
|---|---|---|
| No-auth default | mongod accepts connections without credentials unless auth/security.authorization is enabled. | |
| admin database | Default administrative DB; presence of privileged users indicates auth is configured. | |
| ObjectID structure | 12 bytes = 4-byte timestamp + 3-byte machine id + 2-byte PID + 3-byte counter (predictable). | |
| OP_COMPRESSED / zlib | Wire-protocol compression abused by MongoBleed to over-allocate and leak heap. | |
| MongoBleed (CVE-2025-14847) | Unauthenticated heap memory disclosure on 27017 when zlib compressor enabled. | |
| noauth config | noauth=true / missing auth=true in mongodb.conf disables authentication. |
Tools & Systems
| Tool | Purpose | |
|---|---|---|
| mongo / mongosh | Native shell for connecting, enumerating, and dumping collections. | |
| pymongo | Scriptable client for server info and full database dumps. | |
| nmap NSE | mongodb-info, mongodb-databases, mongodb-brute. | |
| Metasploit | scanner/mongodb/mongodb_login and related auth modules. | |
| netexec (nxc) | nxc mongodb <IP> -u .. -p .. for auth/spraying. | |
| mongo-objectid-predict | Generate likely next ObjectIDs for IDOR enumeration. | |
| mongobleed.py | PoC for CVE-2025-14847 unauthenticated memory disclosure. |
Common Scenarios
Scenario 1: No-auth → full dump
mongo <IP>:27017 connects without credentials. show dbs lists application databases; iterating collections with pymongo exfiltrates user records and secrets.
Scenario 2: ObjectID IDOR
An app exposes Mongo _id values in URLs. Using mongo-objectid-predict, the tester guesses adjacent ObjectIDs and accesses other users' documents through the app.
Scenario 3: MongoBleed credential leak
A 27017 instance has zlib compression enabled and a vulnerable version. The PoC repeatedly probes OP_COMPRESSED with oversized uncompressedSize, leaking heap fragments containing another tenant's credentials, all pre-authentication.
Output Format
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckinginternal/tools/skills/data/network-services-pentesting/pentesting-mongodb/SKILL.md
Popularity
- Repository stars
- 933
- Repository forks
- 167
- 7-day trend score
- 34
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 28 Aug 2026, 3 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/xalgord/xalgorix/pentesting-mongodb)