This repository provides tools for sending, receiving, and logging packets. Consisting of a ping utility and packet sniffer, these tools serve to observe network traffic.
The ping utility sends ICMP Echo Request packets to a specified IP address and listens for ICMP Echo Reply packets.
Pinging a host generates several statistics.
- Packets
- Sent
- Received
- Lost
- RTT
- Minimum
- Maximum
- Average
The packet sniffer intercepts and analyzes IPv4 ICMP packets on a network or pcap file.
Each packet has the following data extracted.
- Timestamp
- Source IP address
- Destination IP address
- Packet Type
- Packet ID
- Sequence Number
- Payload Length
To run the ping utility and packet sniffer on macOS and Linux machines, follow these instructions.
Clone the remote repository.
git clone https://github.com/bcastell/ping-viewer
Enter the root directory of the local repository.
cd location/where/repository/is/saved/ping-viewer
Download the latest version of Python 2 and Python 3.
Install the pypcap and dpkt modules.
pypcap - https://github.com/pynetwork/pypcap dpkt - https://github.com/kbandla/dpkt
To run the ping tool, enter the following command with custom arguments.
sudo python3 pinger.py -p data -c 4 -d 206.190.36.45
-p: payload string
-c: number of packets to send
-d: destination IP address
To run the packet sniffer to listen on a network interface, enter the following command with custom arguments.
sudo python viewer.py -i eth0 -c 10
-i: network interface
-c: number of packets to capture
To run the packet sniffer to analyze a pcap file, enter the following command with custom arguments.
sudo python viewer.py -r icmp.pcap
-r: pcap file
- Brandon Castellanos - GitHub
This project is licensed under the MIT License - see the LICENSE file for details.
