henriqueholanda / sniffer

Go version of a raw socket packet sniffer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Go version of a raw socket packet sniffer


Languages

Language:Go 100.0%