Skip to content

Sniffs memcached-protocol traffic and finds malformed inputs

Notifications You must be signed in to change notification settings

dangermike/go-memcached-sniffer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Memcached sniffer (golang edition)

Listens to memcached protocol (documentation) traffic via pcap. Logs protocol violations and writes the offending tcp session to a file for replay.

Usage

  • --interface or -i: The interface to sniff. Defaults to eth0 in Linux or en0 on a Mac.
  • --filter or -f: Filter on the interface. Documentation here. Defaults to tcp and port 11211.
  • --snaplength or -s: Maximum size to read for each packet. Defaults to 1600.
  • --promiscuous or -p: Puts the interface into promiscuous mode.
  • --timeout or -t: Timeout on a connection. Defaults to BlockForever. Please see the documentation on timeouts here for more information on setting this value safely.

Requirements

Build

This application was written in Go 1.6. Other versions of go have not been tested.

Changes to the memcached protocol parser will not be reflected in the application unless recompiled via Ragel. However, changes outside the protocol parser or simply building the application does not require anything other than the basic Go toolchain and dependencies.

Dependencies

Runtime

This application must be run as root to engage the pcap listener. It will not return any data otherwise.

Acknowledgements

The Python-based memcache-sniffer project is what made the idea of this possible. Having the Ragel State Machine Compiler allowed this to be written in about a day.

About

Sniffs memcached-protocol traffic and finds malformed inputs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published