Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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]
- print (url)
- with open("dnslist.csv") as t:
- host = [line.rstrip() for line in t]
- print (host)
- mmm = []
- for y in host:
- for x in url:
- #try:
- w = create_DNS_query(x)
- #timeout = 5.0
- s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
- s.sendto(w, (y, port))
- message,adress = s.recvfrom(1024)
- info = decode_dns_message(message)
- mmm.append((info,y)) #possibly move or append
- print (mmm)
- #except TimeoutError:
- #print ('Server could not be reached')
- webport = 80;
- for i in mmm:
- tcp = socket.socket(socket.AF_INET, socket.SOCK_STREAM )
- start = time.time()
- tcp.connect((i,webport))
- end = time.time() - start
- print (end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement