Skip to main content

Log all traffic going through an Scapy socket to a PCAP file.

Project description

Scapy Socket Logger

Build PyPI Snyk License: GPL v3

Log all traffic going through an Scapy socket to a PCAP file.

Installation

Just use pip :)

pip install scapy-socketlogger

Usage

Practical examples can be found in the Examples folder.

For a plain quick usage reference, you may look into the following snippet:

from scapy.all import SuperSocket, PcapWriter
from scapy_socketlogger import SocketLogger

# Create your socket
sock = SuperSocket(...)

# Create a PCAP writer
pcap_writer = PcapWriter("traffic.pcap")

# Wrap the socket with the logger
logger = SocketLogger(sock, pcap_writer)

# Use the socket normally - all traffic will be logged
# ...

# Close the logger when done
logger.close()

Or use as a context manager:

with SocketLogger(sock, pcap_writer) as logger:
    # Use sock here
    pass
# Automatically closes and restores socket methods

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

scapy_socketlogger-0.0.2.tar.gz (17.0 kB view details)

Uploaded Source

Built Distribution

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

scapy_socketlogger-0.0.2-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

Details for the file scapy_socketlogger-0.0.2.tar.gz.

File metadata

  • Download URL: scapy_socketlogger-0.0.2.tar.gz
  • Upload date:
  • Size: 17.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for scapy_socketlogger-0.0.2.tar.gz
Algorithm Hash digest
SHA256 94fae97326f0c9490ed514583c4610a9eb74570e29738c7e954cb6b3c611569e
MD5 43dc5f3e37d9cfd715ccd924e07d795e
BLAKE2b-256 ceec8fcd0116573fe2812bd7027298a055cd3667b32582f4c1df6dacba16194d

See more details on using hashes here.

Provenance

The following attestation bundles were made for scapy_socketlogger-0.0.2.tar.gz:

Publisher: build.yml on antoniovazquezblanco/scapy-socketlogger

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scapy_socketlogger-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for scapy_socketlogger-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8752d4551adb2ff5526a13e7fe0f32987357254b4ee4d8dcfd9f683f750b6ebc
MD5 f76330b00f6224751e0459aefecfb83a
BLAKE2b-256 8ebd4b7e1264b20dfc46de1eca88d5ba584c7c021f1531fb736fab100f8d1006

See more details on using hashes here.

Provenance

The following attestation bundles were made for scapy_socketlogger-0.0.2-py3-none-any.whl:

Publisher: build.yml on antoniovazquezblanco/scapy-socketlogger

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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