Skip to main content

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

Project description

Scapy Socket Logger

Build PyPI Snyk

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.1.tar.gz (16.9 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.1-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: scapy_socketlogger-0.0.1.tar.gz
  • Upload date:
  • Size: 16.9 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.1.tar.gz
Algorithm Hash digest
SHA256 43960fedda501b51f15ddb68b676db66888c2e50c3bb22286e27a22d7b2a745a
MD5 591c49fdf8d8062546ea61c3730be406
BLAKE2b-256 0f3033d1a959b6c5892b9ccf32cd86947cde4cf87f06fefed2002981d9c79ad5

See more details on using hashes here.

Provenance

The following attestation bundles were made for scapy_socketlogger-0.0.1.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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for scapy_socketlogger-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 54ead860ca6eafa00cdbc060a9574ab8a1637dbe452396edfc81aa337b6ce185
MD5 2f2a7fcd350bf37b8dd703becbf4b0dc
BLAKE2b-256 e8fbfae9be29cba381ca9a18f37f5f44082b78e8d63f6a84f400dfaf95eef83c

See more details on using hashes here.

Provenance

The following attestation bundles were made for scapy_socketlogger-0.0.1-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