SHARE
TWEET

Untitled

a guest Jun 15th, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from Queue import Queue
  2. import threading
  3. import socket
  4. dominio = "dominio.com"
  5. lock = threading.lock()
  6. def forca_bruta():
  7.   while not q.empty():
  8.      dns = q.get()+"." + dominio
  9.      try:
  10.         ip = socket.gethostbyname(dns)
  11.         lock.acquire()
  12.         print dns + ":t" + ip
  13.         except socket.gaierror:
  14.           pass
  15.         else:
  16.           lock.release()
  17.         q.task_done()
  18.     q = Queue()
  19.     for i in range(20):
  20.        t = threading.Thread(target=forca_bruta)
  21.        t.daemon = True
  22.        t.start()
  23.     with open("lista.txt")as lista:
  24.        while True:
  25.           nome = lista.readline().strip("n")
  26.           if not nome:
  27.               break
  28.           q.put(nome)
  29.     q.join()
  30.     print "nMapeamento completo"
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