Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Code by
- #Networking + security
- from utils import *
- import time
- import socket
- import csv
- import sys
- port = 53;
- with open("urllist.csv") as f:
- url = [line.rstrip() for line in f]
- with open("dnslist.csv") as t:
- host = [line.rstrip() for line in t]
- for x in url:
- for y in host:
- #print(x)
- #print(y)
- w = create_DNS_query(x)
- #print(w)
- s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
- s.sendto(w, (host[0], port))
- message,adress = s.recvfrom(1024)
- #print (message)
- info = decode_dns_message(message)
- print (info)
- #tcp = socket.socket(socket.AF_INET, socket.SOCK_STREAM )
- #start = time.time()
- #tcp.connect((host[0],80))
- #print ('time taken ', time.time() - start ,' seconds')
- s.close()
- ####establish connection with websever, not dns here - using tcp socket
- #null is no response from server, include timeout catch as well
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement