Skip to content
so1icitxPublic

About

a simple python packet sniffer

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

so1dump: Raw Socket Packet Analyzer

A Linux network packet sniffer and protocol analyzer built with raw sockets (AF_PACKET). Captures and dissects Layer 3/4 headers (IPv4, TCP, UDP, ICMP), generates hex dumps, and queries IP reputation intelligence via AbuseIPDB.

Features

  • Raw Socket Capture: Captures Layer 2 Ethernet frames and Layer 3 IPv4 packets directly using Linux AF_PACKET raw sockets.
  • Protocol Decoding: Unpacks and decodes TCP flags, sequence/ack numbers, window sizes, UDP datagrams, and ICMP control types (Echo Request/Reply, TTL Exceeded, Destination Unreachable).
  • Flexible Export: Formats packet metadata to clean JSON, CSV, or human-readable plaintext logs.
  • Hex Dump Analysis: Optional byte-level hex dump representation of packet payload data.
  • Abuse Intelligence: Automated AbuseIPDB reputation lookups for remote destination IPs.

Prerequisites

  • Linux OS with CAP_NET_RAW capability or root privileges
  • Python 3.8+
  • Dependencies:
    pip install requests hexdump

Usage

Note

Capturing packets with raw sockets requires root privileges. Run with sudo.

Basic Capture

Capture all packets across all available interfaces:

sudo python3 so1dump.py

Protocol Filtering & Hex Dump

Capture only TCP traffic and print full payload hex dumps:

sudo python3 so1dump.py -p tcp -X

JSON Export to File

Capture packets on interface eth0 and export formatted records to JSON:

sudo python3 so1dump.py -i eth0 -f json -n capture.json

Reputation Lookup

Enable AbuseIPDB reputation queries (set ABUSEIPDB_API_KEY in your environment):

export ABUSEIPDB_API_KEY="your_api_key_here"
sudo -E python3 so1dump.py -p all -a

Command-Line Options

Flag Description Default
-p, --protocol Protocol filter (all, tcp, udp, icmp) all
-i, --interface Network interface to bind (e.g. eth0, all) all
-f, --file Export format (json, csv, txt) None
-n, --name Output file path None
-X, --hex-dump Display raw byte hex dump of payload Disabled
-a, --abuse-check Query AbuseIPDB for IP reputation scores Disabled
--quiet Suppress stdout; write only to target file Disabled

License

MIT License. See LICENSE for details.

About

a simple python packet sniffer

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages