Created
August 7, 2014 19:28
-
-
Save coffeetocode/f2b36b1eb79bf1b2d1d2 to your computer and use it in GitHub Desktop.
Scapy solution for Black Hat MPTCP audience challenge http://labs.neohapsis.com/2014/08/06/blackhat-usa-multipath-tcp-tool-release-audience-challenge/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Uses Nicolas Maitre's MPTCP-capable scapy impl, so that should be | |
# on the python path, or run this from a directory containing that "scapy" dir | |
from scapy.all import * | |
packets = rdpcap("pcaps/neohapsis_mptcp_challenge.pcap") | |
payload_packets = [p for p in packets if TCP in p | |
and p[IP].src in ("192.168.1.26", "192.168.1.33") | |
and TCPOption_MP in p | |
and p[TCPOption_MP].mptcp.subtype == 2 | |
and Raw in p] | |
f = open("out.jpg", "w") | |
for p in sorted(payload_packets, key=lambda p: p[TCPOption_MP].mptcp.dsn): | |
f.write(p.load) | |
f.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment