Skip to content

Very simple raw network sniffer that outputs a PCAP file

License

Notifications You must be signed in to change notification settings

bitbane/simple_sniffer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

simple_sniffer

Very simple raw network sniffer that outputs a PCAP file

This small C program can be compiled and run on most linux-based embedded systems to enable very simplistic network traffic capture.

Usage:

./simple_sniffer file.pcap [ifname]

The interface name (ifname) is optional. If specified, only capture packets on that interface. If not specified, packets from all interfaces will be captured. This has interesting results if the system has non-ethernet interfaces since the PCAP is written to assume ethernet.

Installation

Compile with an appropriate compiler for your platform. There are no external dependencies or libraries. For example, to compile for an ARMHF target:

arm-none-linux-gnueabihf-gcc simple_sniffer.c -o simple_sniffer

will create the appropriate binary you can then copy onto your target system

Issues:

For reasons unkown, if you specify an interface name, it looks like in some cases the first handful of packets you receive may come from another interface. So if you get some weird results initially, then the rest of the packets are what you expect, it's probably a bug in this program.

About

Very simple raw network sniffer that outputs a PCAP file

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 100.0%