Memcached Key Dump with lru_crawler
When it’s available, lru_crawler metadump is the cleanest way to enumerate keys at scale. It dumps key metadata asynchronously and avoids the hard limits and heavier impact of stats cachedump.
Check if metadump is enabled
key=session:9f3c... exp=1700000000 la=1699999900 cas=12 fetch=no cls=3 size=248 key=jwt:blacklist:... exp=0 la=1699999800 cas=5 fetch=no cls=2 size=96
Interpretation that matters:
If you get
ERRORor a client error, metadump may be disabled (-X) or not available on this build.If it streams output and doesn’t terminate cleanly, that’s normal. Use
timeoutto cap output.
Dump keys reliably with timeout
Extract just the key names:
Triage keys that usually pay off
Once you have keys.txt, grep for patterns that are commonly sensitive in real environments:
What to do with hits:
Session-like keys: pull values and look for user identifiers, roles, or serialized auth state.
Token/secret keys: treat as immediate credential material and pivot into the matching service.
Pull values for specific keys
Memcached text protocol can fetch multiple keys in one request.
Batch a handful:
Interpretation:
Values may be binary or serialized. If it looks like JSON, JWT, PHP serialize, or pickle-like blobs, save it and handle decoding offline.
Keys expire and rotate. If you see misses, re-run metadump and target fresher keys first.
If metadump is blocked
Some deployments disable dumping commands (-X disables both stats cachedump and lru_crawler metadump). If this is blocked, move to app-informed key guessing or libmemcached tooling with known keys.
References
-
ReleaseNotes 1.4.31github.com/memcached/memcached/wiki/releasenotes1431 (opens in new tab)
introduces lru_crawler metadump all and notes it avoids cachedump limits.
-
describes lru_crawler metadump output and behavior.
-
memcached -X disables cachedump and metadump.manpages.debian.org/unstable/memcached/memcached.1.en.html (opens in new tab)
Was this helpful?
Your feedback helps improve this page.