SHARE
TWEET

Untitled

a guest Oct 14th, 2019 93 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from scapy.all import sniff
  2. from scapy.all import *
  3. from scapy.utils import hexdump
  4. import base64
  5.  
  6.  
  7. pkts = sniff( filter = "host 192.168.43.42", timeout=10)
  8. text=[]
  9. num=0
  10. for pkt in pkts:
  11.     if not ARP in pkt:
  12.         if pkt[IP].src=='192.168.43.42':
  13.             a= raw(pkt.lastlayer())
  14.             a=base64.b64decode(a)
  15.             text.append(a)
  16.             if pkt[3].id==num:
  17.                 print ("recived packet number", num)
  18.                 num+=1
  19.                 print ("d")
  20.             else:
  21.                 x=sr(IP(dst='192.168.43.42')/UDP(dport=53)/DNS(rd=1, qd=DNSQR(qname="google.com", qtype="A"), id=num))
  22.  
  23.  
  24. with open ('trump.txt', 'wb') as f:
  25.     for string in text:
  26.         f.write(string)
  27.         print ("done")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top