Skip to content

Instantly share code, notes, and snippets.

@juananpe

juananpe/leer.py Secret

Created July 30, 2018 19:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juananpe/97bc4938490721570005e8c9435f5198 to your computer and use it in GitHub Desktop.
Save juananpe/97bc4938490721570005e8c9435f5198 to your computer and use it in GitHub Desktop.
Obtener el payload de ciertos paquetes de un pcap
from __future__ import print_function
from scapy.all import *
# rdpcap comes from scapy and loads in our pcap file
packets = rdpcap('capture.pcap')
newFile = open("payload.bin", "wb")
# Let's iterate through every packet
for packet in packets:
if packet[IP].src == "10.10.0.70":
if len(packet) == 566:
print( packet[TCP].payload , end ="")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment