Skip to content
Go version of a raw socket packet sniffer
Go
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
Readme.md
afpacket.go
config.ini
main.go
pcap.go
sniffer.go
writer.go

Readme.md

Sniffer

Go version of a raw socket packet sniffer. Uses the gopacket library with inspiration from the PacketBeat project.

Configure

  • Install build tools: apt-get install build-essential
  • Install libpcap: apt-get install libpcap-dev
  • Download dependencies: go get
  • Optional: Modify the config.ini values

Build

  • Build the executable: go build

Help

$ ./sniffer -h
Usage of ./sniffer:
  -config="": Path to ini config for using in go flags. May be relative to the current executable path.
  -enableAf=false: Enable afpacket mode
  -iface="eth0": Interface to capture packets
  -pcapOut="": File path to log all packets

Run

  • Without PCAP logging: ./rawsocket
  • With PCAP logging: `./rawsocket -pcapOut="output.pcap"
  • Use config file: `./rawsocket -config="config.ini"

Clean

go clean

You can’t perform that action at this time.