Skip to content

Instantly share code, notes, and snippets.

@juananpe

juananpe/leer.py Secret

Created July 30, 2018 19:31
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
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