Skip to content

A simple packet sniffer and parsing tool written in C for Linux similar to wireshark using raw sockets

License

Notifications You must be signed in to change notification settings

ImonChakraborty/pack-sniffer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Packet Sniffer and parser using raw sockets

A simple network packet sniffer written in C that captures and analyzes packets. This tool uses raw sockets to intercept and display detailed information about Ethernet, IP, TCP, and UDP headers along with the packet payload in hexadecimal and ASCII formats.

Features

  • Captures packets on a specified network interface.
  • Displays Ethernet, IP, TCP, and UDP header information.
  • Prints packet payload in hexadecimal and ASCII formats.
  • Provides timestamps for captured packets.
  • It uses the Berkeley Packet Filter (BPF) to filter and capture specific types of packets.

Note

  • Ensure you have the necessary permissions to run the program (typically requires sudo access).

  • Modify the network interface (default is wlan0) in the code to match your setup.

  • This tool currently supports only IPv4 packets without options.

Getting Started

  1. Clone the repository
git clone https://github.com/ImonChakraborty/pack-sniffer.git
cd pack-sniffer
  1. Compile the code
gcc -o pack-sniffer pack-sniffer.c
  1. Run the packet sniffer (requires root privileges):
sudo ./pack-sniffer

License

  • This project is licensed under the GPL-3.0 License - see the LICENSE file for details.

Thank you

Releases

No releases published

Packages

No packages published

Languages