NoSQLMap is an open source Python tool designed to audit for as well as automate injection attacks and exploit default configuration weaknesses in NoSQL databases and web applications using NoSQL in order to disclose or clone data from the database.
Originally authored by @tcsstool and now maintained by @codingo_ NoSQLMap is named as a tribute to Bernardo Damele and Miroslav's Stampar's popular SQL injection tool sqlmap. Its concepts are based on and extensions of Ming Chow's excellent presentation at Defcon 21, "Abusing NoSQL Databases".
A NoSQL (originally referring to "non SQL", "non relational" or "not only SQL") database provides a mechanism for storage and retrieval of data which is modeled in means other than the tabular relations used in relational databases. Such databases have existed since the late 1960s, but did not obtain the "NoSQL" moniker until a surge of popularity in the early twenty-first century, triggered by the needs of Web 2.0 companies such as Facebook, Google, and Amazon.com. NoSQL databases are increasingly used in big data and real-time web applications. NoSQL systems are also sometimes called "Not only SQL" to emphasize that they may support SQL-like query languages.
NoSQLMap 1.0 is a full rewrite for Python 3 as a command line tool. The design notes are in docs/DESIGN.md.
- Reliable detection. Every boolean finding needs a TRUE/FALSE pair that disagrees, anchored to a random-value or original response, and reproduced with fresh values. Dynamic page content is learned and masked. Time-based results use a statistical threshold and are re-verified.
- Injection points. Query string, form body, JSON body (nested), cookies (
--level 2), headers (--level 3) and URI path segments marked with*(/users/42*/profile). Burp/ZAP request files (-r) and*markers on parameter values are supported. At--level 2a form body is also retried as JSON. - Techniques. Operator injection (
$ne,$regex,$gt,$nin,$exists) on single or combined parameters (login bypass),$expr,$where,$or-nested$where(Mongoose CVE-2025-23061), JavaScript string-concatenation injection (quoted and numeric), error-based probes with backend fingerprinting, and time-based blind (--risk 2). - Extraction (
--dump). About 7 requests per character (bisection), about 4 for hex or numeric values, multi-threaded where possible:$expr+$regexMatchreads any field of every document and lists field names, without server-side JavaScript. This works on MongoDB with--noscripting, through JSON bodies and through bracket syntax (query/form) alike.$where/JS injection reads every field through a boolean or time oracle.$regexreads the injected fields themselves (for example username/password pairs from a login form).- Sibling-field conditions read arbitrary fields when the app passes the whole request object as the filter (MongoDB, CouchDB Mango).
- Lucene
query_stringinjection enumerates the mapped field names (_exists_wildcards) and reads keyword, numeric, date and boolean fields from Elasticsearch/OpenSearch. Text fields are read through their.keywordsubfield when it exists. Otherwise the field is rebuilt from its analyzed tokens with word order recovered by phrase queries, and the value is prefixed with~.
- Real-world documents. Collections whose documents have different fields are handled (the schema is checked per document and re-discovered when it differs). Nested objects and arrays are extracted as JSON, including over bracket syntax. Form endpoints that also accept JSON are used for numeric comparisons automatically.
- Fast time-based extraction. The delay is tuned down automatically after detection (as low as 0.25 s on a quiet link). Every value is verified at the end and re-read with a longer delay if the check fails.
- Sessions. Findings and extraction progress are saved after every character in
~/.local/share/nosqlmap/sessions/. Interrupt with Ctrl+C and run the same command again to resume. Use--flush-sessionto start over or--no-sessionto disable. - Direct database attacks. MongoDB and CouchDB unauthenticated access, enumeration, dumping, user hash extraction and cracking (MONGODB-CR, SCRAM-SHA-1/256, CouchDB PBKDF2). Redis, Elasticsearch and Memcached checks. Async network scan.
- Many targets.
-m targets.txt(oneURLorMETHOD URL BODYper line) and--forms(parse and test every HTML form on the page) run one scan per target and end with a summary table. One unreachable target does not stop the run. - WAF/IPS awareness. A heuristic probe identifies common WAFs (Cloudflare, AWS WAF, Akamai, Imperva, F5, Sucuri, ModSecurity, Barracuda, FortiWeb, Azure, Wordfence, Wallarm). When the probe is blocked, every tamper script is tried and a working one is offered. Blocked responses are also watched during the scan.
- Precise attribution. When parameters are only injectable together (login forms), parameters that do not matter, such as CSRF tokens and submit buttons, are dropped from the finding.
- Tamper scripts.
unicodedollar,urlencodedollar,doubleencode,space2comment,jsoncookie.
| Backend | Web injection | Extraction | Direct attacks |
|---|---|---|---|
| MongoDB (Express/qs, PHP, Mongoose, operator-accepting ORMs) | operator, $expr, $where, JS concat, field, error, time |
expr, where, regex, field | yes |
CouchDB (Mango _find) |
operator, field (_id), error |
regex, field | yes |
| Elasticsearch / OpenSearch | Lucene query_string (plain and quoted), error |
lucene | unauthenticated check |
| Redis, Memcached | – | – | unauthenticated check |
- Elasticsearch
_id: it only supports exact term lookups, not regexp, prefix or range queries, so it cannot be bisected. Rows are keyed by a keyword field instead. - Original case and punctuation of analyzed text fields that have no
.keywordsubfield: only the indexed tokens exist. - CouchDB numbers through a GET query string: query strings carry only strings, and Mango never compares strings with numbers. Through a POST endpoint that also accepts JSON, numbers are read.
From a checkout, any of:
uv tool install . # isolated install with uv
pipx install . # isolated install with pipx
pip install . # into the current environment
nosqlmap --help
Requires Python 3.10+ (tested on 3.10 to 3.14). No Docker needed. An optional image is available:
docker build -t nosqlmap .
docker run --rm nosqlmap web -u "http://target/search?q=1" --batch
# web application
nosqlmap web -u "http://target/search?user=test"
nosqlmap web -u "http://target/login" --data "username=a&password=b" --dump
nosqlmap web -u "http://target/api/login" --data '{"user":"a","pass":"b"}' --dump -o report.json
nosqlmap web -r burp_request.txt --level 3 --risk 2 --proxy http://127.0.0.1:8080
nosqlmap web -u "http://target/item?id=1*&debug=0" --tamper unicodedollar --batch
nosqlmap web -u "http://target/api/users/42*/profile" --dump # URI path segment
nosqlmap web -u "http://target/login.html" --forms --batch # every form on the page
nosqlmap web -m targets.txt --batch -o report.json # many targets, one report
# databases
nosqlmap db mongo 10.0.0.5 --dump ./loot --crack --wordlist rockyou.txt
nosqlmap db couch 10.0.0.6 --user admin --password admin --dump ./loot
nosqlmap db service redis 10.0.0.7
# network scan
nosqlmap scan 10.0.0.0/24 -s mongo -s couch -s redis -o scan.json
Main web options:
| Option | Meaning |
|---|---|
--level 1-3 |
1: query/body. 2: also cookies, and retries the form body as JSON. 3: also headers |
--risk 1-3 |
2: adds time-based payloads (server-side JS sleep) |
--technique BET |
B=boolean, E=error, T=time |
-p / --skip |
test or skip specific parameters |
--string / --not-string / --regexp / --code / --text-only |
override the response comparison for noisy pages |
--dump, --fields, --max-rows, --threads |
extraction |
--time-sec |
delay used to detect time-based injection; extraction tunes it down |
--flush-session, --no-session, --session-dir |
resume control |
-m FILE, --forms |
many targets / HTML forms |
--skip-waf |
skip the WAF probe |
--batch, -o report.json, -v/-vv/-vvv |
automation and output |
uv venv && uv pip install -e '.[dev]'
docker run -d --rm -p 27017:27017 mongo:8.0 # required
docker run -d --rm -p 27019:27017 mongo:8.0 --noscripting # optional: $expr without JS
docker run -d --rm -p 5984:5984 -e COUCHDB_USER=admin -e COUCHDB_PASSWORD=admin couchdb:3.3 # optional
docker run -d --rm -p 9200:9200 -e discovery.type=single-node -e xpack.security.enabled=false \
docker.elastic.co/elasticsearch/elasticsearch:8.15.3 # optional
pytest
CI (.github/workflows/tests.yml) runs ruff and the full suite on Python 3.10–3.14 with all four backends; there NSM_REQUIRE_ALL=1 turns a missing backend into an error instead of skipped tests.
tests/vulnapp.py is a deliberately vulnerable app covering every technique, plus non-vulnerable and dynamic endpoints for false-positive checks.
Usage of NoSQLMap for attacking targets without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable laws.

