Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from Queue import Queue
- import threading
- import socket
- dominio = "dominio.com"
- lock = threading.lock()
- def forca_bruta():
- while not q.empty():
- dns = q.get()+"." + dominio
- try:
- ip = socket.gethostbyname(dns)
- lock.acquire()
- print dns + ":t" + ip
- except socket.gaierror:
- pass
- else:
- lock.release()
- q.task_done()
- q = Queue()
- for i in range(20):
- t = threading.Thread(target=forca_bruta)
- t.daemon = True
- t.start()
- with open("lista.txt")as lista:
- while True:
- nome = lista.readline().strip("n")
- if not nome:
- break
- q.put(nome)
- q.join()
- print "nMapeamento completo"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement