Enumeration with Nmap and Text
Memcached is usually wide open internally. Your first job is to confirm you can talk to it, fingerprint version and features, then pull stats that tell you whether key dumping is possible and whether the instance is worth deeper work.
Nmap discovery and fingerprinting
11211/udp open unknown | memcached-info: | Process ID: 18568 | Uptime: 6950 seconds | Server time: 2018-03-02T03:35:09 | Architecture: 64 bit | Used CPU (user): 0.172010 | Used CPU (system): 0.200012 | Current connections: 10 | Total connections: 78 | Maximum connections: 1024 | TCP Port: 11211 | UDP Port: 11211 |_ Authentication: no
Raw connection sanity check
Use CRLF. If you send only \n, you will get inconsistent behavior.
VERSION 1.6.22
Interpretation that matters:
If you get a
VERSION, the text protocol is reachable.If the connection closes or you get only
ERROR, consider TLS-wrapped memcached or SASL/binary-only deployments. See the SASL/TLS pages.
High-signal stats pulls
Global stats
What to look for:
versionfor fingerprinting.curr_itemsandbytesto decide if this cache is active and worth key work.cmd_get,cmd_set,get_hits,get_missesto confirm real application traffic.
Settings that change your options
What to look for:
maxbytes,maxconns,tcpport,udpportfor exposure and capacity clues.If dumping commands are disabled server-side, your key-dump techniques will fail even if the service is reachable.
Item and slab overview
STAT items:1:number 42 STAT items:2:number 3
How you use it:
The slab IDs drive legacy
stats cachedumpenumeration.A spread across many slabs usually means mixed key sizes and a busy cache.
How you use it:
Confirms which slab classes are active and how memory is distributed.
Useful for deciding which slabs to target first when doing legacy dumps.
Safe read/write validation
You want to know if you can write keys (cache poisoning risk) without being destructive. Use a short TTL and a unique key name.
Interpretation:
If
STOREDand thegetreturns your value, the instance is writable from your position.Next move is usually application mapping: identify what the target app stores in memcached and whether keys are guessable or dumpable.
References
-
memcached-info NSE scriptnmap.org/nsedoc/scripts/memcached-info.html (opens in new tab)
usage and expected output fields.
-
Memcached Basic Text Protocoldocs.memcached.org/protocols/basic (opens in new tab)
command format and CRLF behavior.
Was this helpful?
Your feedback helps improve this page.