Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from scapy.all import sniff
- from scapy.all import *
- from scapy.utils import hexdump
- import base64
- pkts = sniff( filter = "host 192.168.43.42", timeout=10)
- text=[]
- num=0
- for pkt in pkts:
- if not ARP in pkt:
- if pkt[IP].src=='192.168.43.42':
- a= raw(pkt.lastlayer())
- a=base64.b64decode(a)
- text.append(a)
- if pkt[3].id==num:
- print ("recived packet number", num)
- num+=1
- print ("d")
- else:
- x=sr(IP(dst='192.168.43.42')/UDP(dport=53)/DNS(rd=1, qd=DNSQR(qname="google.com", qtype="A"), id=num))
- with open ('trump.txt', 'wb') as f:
- for string in text:
- f.write(string)
- print ("done")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement