Skip to main content

Python Pcap Parser

Project description

A pcap file parser implemented by Python. libpcap is not needed for this package.

Installation

pip install PacketReader

Usage

1. Import module. import PacketReader

2. Read from a pcap file. read_pcap return a list of packets. packets = PyPcapAnalyzer.read_pcap(pcap_file)

3. You can print the information of each packet. print(packets[0])

4. PacketReader supports IP/TCP/UDP. You can get the MAC address, IP address and flags of packets.

print(packets[0].mac_address)
print(packets[0].tcp_header['SYN'])

Example

::
>>> import PacketReader
>>> pl=PacketReader.read_pcap('test.pcap')
>>> print(len(pl))
179
>>> print(pl[0])
Packet 1 Information:
[1] Epoch Time: 1448157839.796592 seconds
[2] Frame Length: 85 bytes
[3] Destination Mac Address: 28:C2:DD:1D:75:C1
[4] Source Mac Address: 88:25:93:37:60:84
[5] Destination IP Address: 192.168.1.183
[6] Source IP Address: 192.30.252.88
[7] Destination Port: 57747
[8] Source Port :443
[9] Protocol: 6

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PacketReader-1.0.0.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

PacketReader-1.0.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file PacketReader-1.0.0.tar.gz.

File metadata

  • Download URL: PacketReader-1.0.0.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for PacketReader-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c9cdddb277c7a0b2b12e5b65a84eef569f671ac4a6091110bfdcfdcb01f38554
MD5 9d26166a0eaa29ae3448f53c91f1dac3
BLAKE2b-256 ee17a30cf690f4bd091120d248ca485e9da3490cf43dec622e0d645341778705

See more details on using hashes here.

File details

Details for the file PacketReader-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for PacketReader-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7dbc20833178448752394bba1a2c10ea7105799beaa485cb1a78b2a59cb3afe1
MD5 e92bdb181db08b6652faa8fd0e504c96
BLAKE2b-256 7f0f011f25877fe831c9c1824049d1f098d8c58e2c694f0667a5cd30d8a68425

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page