Created
July 13, 2016 19:05
-
-
Save wumb0/fb0f48f410f074ceafc60c6e3fd07339 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
from scapy.all import * | |
import sys | |
import base64 | |
# script to extract data from ping padding (http://wumb0.in/ping-exfil.html) | |
try: | |
config.conf.iface = sys.argv[2] | |
except: pass | |
s = sniff(lfilter=lambda x: x.haslayer(ICMP) and x[ICMP].type==8, stop_filter=lambda x: x.haslayer(ICMP) and x[ICMP].type==8 and '\n' in x[ICMP][Raw].load[8:24]) | |
buf = "" | |
for i in s: | |
buf += i[ICMP][Raw].load[8:24] | |
with open(sys.argv[1], "w") as f: | |
f.write(base64.b64decode(buf[:buf.find('\n')])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment