Skip to content

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Network Globe - Real-Time TCP Packet Sniffer for Network Location Visualization

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.

Network Globe Visualization

See a demo

Features

  • 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

Installation

Prerequisites

  • 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-path flag

Install

Ubuntu

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.zip

macOS

wget https://github.com/amozoss/network-globe/releases/latest/download/network-globe_darwin_arm.zip
unzip network-globe_darwin_arm.zip

Usage

  1. Give read permissions for pcap to read the network packets:

    # for mac
    sudo chmod +r /dev/bpf*
  2. Configure your network interface:

    # List available network devices
    ./network-globe --list-devices
    # Default device is en0
    ./network-globe --device en0
  3. Set the GeoLite2 database path:

    # Default path is GeoLite2-City.mmdb
    ./network-globe --geolite2-path GeoLite2-City.mmdb
  4. Start network-globe:

    # may need to run with sudo on ubuntu
    ./network-globe
  5. Open the browser and navigate to http://localhost:8000

  6. (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 --lat and --lng flags.

    ./network-globe --lat 39.781932 --lng -104.970578
  7. (Optional) Demo uploads to Storj:

    • Sign up for a free trial account at Storj.

    • Obtain an Access Grant

    • Set the --access and --bucket flags with the Access Grant and Bucket name.

    • Use the provided script or your preferred method to upload a file to Storj.

Build

Clone the repository:

git clone https://github.com/amozoss/network-globe.git
cd network-globe

linux

sudo apt install libpcap-dev gcc
CGO_ENABLED=1 go build

macOS

go build

Project Structure

  • public/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.

Contributing

Contributions are welcome! Please submit a pull request or open an issue for any improvements or bug fixes.

License

This project is licensed under the MIT License.

Acknowledgements

About

Real-Time IP Location Visualization for Network TCP Packets

Resources

Stars

13 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages