Skip to content

Instantly share code, notes, and snippets.

@wumb0
Created July 13, 2016 19:05
Show Gist options
  • Save wumb0/fb0f48f410f074ceafc60c6e3fd07339 to your computer and use it in GitHub Desktop.
Save wumb0/fb0f48f410f074ceafc60c6e3fd07339 to your computer and use it in GitHub Desktop.
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