See where your TCP packets are coming from/going to in Real-time!
This repository contains a Real-time TCP packet sniffer for network visualization. See the various locations where TCP packets are sent or received. The application parses IP addresses from packets, looks up their locations (lat and lng) using GeoLite2, and visualizes the packet data on a globe using Globe GL.
See a demo
- Parses IP addresses from TCP packets using pcap
- Performs location lookup using GeoLite2
- Visualizes locations on a globe with Globe GL
- Demo file uploads with Storj
- libpcap (for packet capturing)
- GeoLite2-City.mmdb database from MaxMind
- Obtain the Free GeoLite2-City.mmdb database
- Extract and place the database file (
GeoLite2-City.mmdb) in the project directory or specify path with--geolite2-pathflag
sudo apt install libpcap-dev zip
wget https://github.com/amozoss/network-globe/releases/latest/download/network-globe_linux_amd64.zip
unzip network-globe_linux_amd64.zipwget https://github.com/amozoss/network-globe/releases/latest/download/network-globe_darwin_arm.zip
unzip network-globe_darwin_arm.zip-
Give read permissions for pcap to read the network packets:
# for mac sudo chmod +r /dev/bpf*
-
Configure your network interface:
# List available network devices ./network-globe --list-devices # Default device is en0 ./network-globe --device en0
-
Set the GeoLite2 database path:
# Default path is GeoLite2-City.mmdb ./network-globe --geolite2-path GeoLite2-City.mmdb -
Start network-globe:
# may need to run with sudo on ubuntu ./network-globe -
Open the browser and navigate to http://localhost:8000
-
(Optional) Set the source location (Latitude and Longitude) for the Globe visualization:
The origin is configured to be in the United States. You can set the source location using the
--latand--lngflags../network-globe --lat 39.781932 --lng -104.970578
-
(Optional) Demo uploads to Storj:
-
Sign up for a free trial account at Storj.
-
Obtain an Access Grant
-
Set the
--accessand--bucketflags with the Access Grant and Bucket name. -
Use the provided script or your preferred method to upload a file to Storj.
-
Clone the repository:
git clone https://github.com/amozoss/network-globe.git
cd network-globesudo apt install libpcap-dev gcc
CGO_ENABLED=1 go buildgo buildpublic/index.html: HTML file for the Globe GL visualization and websocket connection.main.go: packet sniffer and IP to lat and lng lookup written in Go using pcap library and MaxMind.server.go: Handles the packets, formats the message for the frontend, and broadcasts them to the client.
Contributions are welcome! Please submit a pull request or open an issue for any improvements or bug fixes.
This project is licensed under the MIT License.
