SHARE
TWEET

dns server

a guest Oct 24th, 2019 92 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.   GNU nano 3.2                                                      dnsFinalserver.py                                                                
  2.  
  3.  1 from scapy.all import sniff
  4.  2 from scapy.all import *
  5.  3 from scapy.utils import hexdump
  6.  4 import base64
  7.  7 packets = sniff( filter = "host 192.168.43.42", timeout = 10)
  8.  8 RecivedText = []
  9.  9 num = 0
  10. 10 for packet in packets:
  11. 11         if not ARP in packet:
  12. 12                 if packet[IP].src == '192.168.43.42':
  13. 13                         c = raw(packet.lastlayer())
  14. 14                         c = base64.b64decode(c)
  15. 15                         RecivedText.append(c)
  16. 16                 if packet[3].id == num:
  17. 17                         print ("You have recived: ", num, "packets")
  18. 18                         num+ = 1
  19. 19                         print ("d")
  20. 20                 else:
  21. 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. 22 with open ('trump.txt', 'wb') as f:
  23. 23         for string in text:
  24. 24         f.write(string)
  25. 25         print ("Package sent! ")
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
 
Top