Skip to content

A simple packet sniffer written by Python (Linux only)

Notifications You must be signed in to change notification settings

yanjiulab/PySniffer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PySniffer

A simple packet sniffer written by Python (Linux only)

Supported packet type:

  • sniff IP packet
  • sniff TCP packet
  • sniff UDP packet

Features

  • Sniff all packet by raw socket
  • Customize filtering rules via socket tuple(src_ip, dst_ip, src_port, dst_port, proto_type)
  • Store the data by session

Classes

  • PacketSniffer: Sniffing packet
  • PacketFilter: Customizing filter rule used by sniffer
  • Pcap: Storing the packet in pcap file

Usage

  1. copy the package packet_sniffer to your own project
  2. import package and use

example use case:

from packet_sniffer import *
f = PacketFilter(proto_type='udp')
sniffer = PacketSniffer(limit=10, packet_filter=f, pcap_enable=True)
sniffer.sniff()

About

A simple packet sniffer written by Python (Linux only)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages