Eric Capuano1 posted an excellent blog regarding MongoBleed (CVE-2025-14847) and indicators to look out for. PoC by Joe Desimone2 shows exactly how the memory leak exploit works and Kevin Beaumont3 has an excellent write-up on the vulnerability (see reference section for links).
MongoBleed Triage Script
The script focuses on safe artifact acquisition first, followed by optional on-host analysis, and produces a portable, hashed forensic archive suitable for offline investigation on a forensic workstation.**
PoC Displaying Memory Leak
Triage Script Run
Table of Contents
Purpose
MongoBleed exploitation leaves minimal persistent artifacts and often relies on high-velocity unauthenticated connections and metadata enumeration.
This script helps responders:
- Scope exposure starting from PoC disclosure
- Identify suspicious connection velocity
- Detect metadata exfiltration indicators
- Preserve host and Docker-based MongoDB evidence
- Package artifacts in a forensically sound format
What the Script Does
Evidence Collection (Always Runs)
- Collects MongoDB configuration and version information
- Copies MongoDB logs from host systems
- Enumerates Docker containers running MongoDB
- Extracts container logs, configs, socket state, and FD listings
- Captures system context (hostname, kernel, timestamps)
Time-Scoped Log Filtering
- Uses a fixed start time (2024-12-24) corresponding to public PoC release
- Uses a dynamic end time (execution time)
- Filters logs strictly within the incident window
Optional On-Host Analysis
If jq is installed:
- Extracts connection and metadata events from MongoDB logs
- Aggregates connections by source IP
- Calculates:
- Total connections
- Metadata request ratio
- Connection velocity (per minute)
- Flags high-confidence exploitation patterns
If jq is not installed:
- Skips analysis safely
- Preserves all raw artifacts for offline analysis
- Forensic Packaging
- Creates a compressed .tar.gz archive of all collected artifacts
- Generates SHA256 and MD5 hashes
- Produces a single immutable evidence package ready for transfer
Output
The script produces:
- A structured artifact directory
- A compressed forensic archive
- Cryptographic hashes for integrity verification
- All analysis can be reproduced offline without re-running the script on the affected host.
- Post-Execution Layout (Authoritative)
Design Principles
- Collection-first (analysis is never required on the target)
- Non-destructive (read-only operations)
- Defensible (timestamped, hashed, reproducible)
- Docker-aware
- Minimal dependencies
Important Notes
- This script is intended for incident response and forensic triage
- It does not modify MongoDB state
- Detection is based on behavioral indicators, not signatures
- Absence of findings does not guarantee absence of compromise
Intended Audience
- Incident Responders
- DFIR Analysts
- SOC Engineers
- Cloud Security Teams
- Digital Forensic Examiners
References
License
- Use, modify, and adapt responsibly. Attribution appreciated.