Advertisement
ibm33a14

Joomla! Automatic Updates Scanner

Oct 11th, 2017
617
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.00 KB | None | 0 0
  1. http://satoshibox.com/ejaoetbgy5zkws374hnw7qaj
  2.  
  3.  
  4. Hello friends.
  5. Help the children this year and get great information from our organization. the address for sending the donation below. after you sent. write to me and I will send you a link to the data you did not see.
  6.  
  7. Children will be happy with any amount.
  8. whether it's $ 1 or $ 100,000
  9.  
  10. 17Z4UNQVj93eNJrUnybvmiEgq6Fg1TLSa2
  11.  
  12. ibm33a14@exploit.im 😎😎😎😎😎😎😎😎
  13.  
  14.  
  15. # Official Repository: https://github.com/D35m0nd142/Joomla-Components-Exploits-Auto-Updating-Scanner
  16.  
  17. # This is a simple auto-updating Joomla! Plugins Scanner which is able to find exploits related to previously found components.
  18. # It uses the csv file provided by the Exploit-DB team and an extra plugins' list from Metasploit, but it is totally indipendent from this last one.
  19. # TOR Proxy tunnel is available.
  20.  
  21. # [FLOODING] If the target is protected by flooding requests the script won't be successful clearly.
  22.  
  23. # Script's Programming Language support: Python 2.7.*
  24.  
  25. # *******************************************************************************************************************************************
  26. # WARNING: You could have not installed some of the required libraries but it will install them for you PROVIDED you run the script as root.
  27. # Besides you need to install pip in order to get missing libraries quickly.
  28. # *******************************************************************************************************************************************
  29. #!/usr/bin/python
  30. # -*- coding: utf-8 -*-
  31. import os
  32. import csv
  33. import sys
  34. import time
  35. import urllib
  36.  
  37. try:
  38. import requests
  39. except ImportError:
  40. print "[!] 'requests' library not found. Installing it automatically using pip.."
  41. time.sleep(0.5)
  42. os.system("pip install requests")
  43. import requests
  44.  
  45. import codecs
  46.  
  47. try:
  48. import socks
  49. except ImportError:
  50. print "[!] socks.pyc not found. Downloading it automatically.."
  51. time.sleep(0.5)
  52. urllib.urlretrieve ("https://github.com/alyssafrazee/randomcalendars/blob/master/httplib2/socks.pyc?raw=true", "socks.pyc")
  53. import socks
  54.  
  55. import socket
  56.  
  57. try:
  58. import shutil
  59. except ImportError:
  60. print "[!] 'shutil' library not found. Installing it automatically using pip.."
  61. time.sleep(0.5)
  62. os.system("pip install shutil")
  63. import shutil
  64.  
  65. import urllib2
  66. import argparse
  67.  
  68. try:
  69. from termcolor import colored
  70. except ImportError:
  71. print "[!] 'termcolor' library not found. Installing it automatically using pip.."
  72. time.sleep(0.5)
  73. os.system("pip install termcolor")
  74. from termcolor import colored
  75.  
  76. useTor = False
  77. Update = True
  78. tor_port = 9150
  79. tor_addr = "127.0.0.1"
  80. compFile = "comptotest.txt"
  81. expFile = "exp-db_files.csv"
  82. csvURL = "https://raw.githubusercontent.com/offensive-security/exploit-database/master/files.csv"
  83. metasploitURL = "https://raw.githubusercontent.com/rapid7/metasploit-framework/master/data/wordlists/joomla.txt"
  84. found = []
  85.  
  86. def getComponents():
  87. global found
  88.  
  89. with open(expFile,"r") as f:
  90. for line in f:
  91. if("com_" in line and "Joomla" in line):
  92. split = line.split(" ")
  93. for w in split:
  94. w = w.strip()
  95. if((w.startswith("com_") or w.startswith("'com_")) and w not in found):
  96. if(w[0] == '\''):
  97. w = w[1:len(w)-1]
  98. found.append(w)
  99. break
  100.  
  101. found = set(found)
  102. of = open(compFile,"w")
  103. i = 0
  104. for f in found:
  105. i += 1
  106. print "[%s] %s" %(i,f)
  107. of.write(f+"\n")
  108. of.close()
  109.  
  110. def getExploitDbList():
  111. response = urllib2.urlopen(csvURL)
  112. of = open(expFile,"w")
  113. cr = csv.reader(response)
  114. for row in cr:
  115. of.write(str(row)+"\n")
  116. of.close()
  117.  
  118. def getMetasploitList():
  119. global found
  120.  
  121. try:
  122. response = requests.get(metasploitURL).text
  123. except:
  124. return
  125.  
  126. nlsplit = response.split("\n")
  127. for s in nlsplit:
  128. if("com_" in s):
  129. start = s.find('com_')
  130. compToAdd = ""
  131. for x in range(start,len(s)):
  132. if(CharOrNumber(s[x])):
  133. compToAdd = "%s%s" %(compToAdd,s[x])
  134. else:
  135. break
  136. found.append(compToAdd)
  137.  
  138. def CharOrNumber(c):
  139. if(c.isalpha() or str(c).isdigit() or c == '_'):
  140. return True
  141. return False
  142.  
  143. def extractExploits(foundComp):
  144. exploits = []
  145.  
  146. with open(expFile,"r") as f:
  147. for line in f:
  148. for comp in foundComp:
  149. if(comp in line and "Joomla" in line and CharOrNumber(line[line.find(comp)+len(comp)]) is False):
  150. exploits.append(line.strip())
  151.  
  152. exploits = set(exploits)
  153. return exploits
  154.  
  155. def checkTor(inp):
  156. global tor_addr
  157. global tor_port
  158.  
  159. if(":" not in inp and "." not in inp):
  160. print "\n[!] Invalid TOR proxy syntax (it must be 'tor_addr:tor_port'). Using '%s:%s' as default." %(tor_addr,tor_port)
  161. time.sleep(1)
  162. return
  163.  
  164. split = inp.split(":")
  165. tor_addr = split[0]
  166. tor_port = split[1]
  167.  
  168.  
  169. print "\nJoomla! Components/Exploits Auto-Updating Scanner"
  170. print "Author: @D35m0nd142, <d35m0nd142@gmail.com>\n"
  171. time.sleep(0.7)
  172.  
  173. parser = argparse.ArgumentParser(description="")
  174. parser.add_argument("--target", type=str, help="Enter the target to scan",required=True)
  175. parser.add_argument("--tor_proxy", type=str, help="Enable the tool to use the TOR proxy",default="None")
  176. parser.add_argument("--no_update",help="Disable the update from github. You need to provide your own comptotest.txt and exp-db_files.csv files",
  177. action='store_true',default=False)
  178. args = parser.parse_args()
  179.  
  180. target = args.target
  181.  
  182. if(args.tor_proxy != "None"):
  183. checkTor(args.tor_proxy)
  184.  
  185. socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, tor_addr, tor_port)
  186. socket.socket = socks.socksocket
  187.  
  188. if("http" not in target[:4]):
  189. target = "http://%s" %target
  190. if(target[len(target)-1] != '/'):
  191. target = "%s/" %target
  192.  
  193. headers = {'User-Agent':'Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0'}
  194. toCheck = ["<h1>Not Found</h1>","<title> 404 - Page not found</title>","\"center error-404\""]
  195. foundComp = []
  196.  
  197. if(args.no_update is False):
  198. print "Downloading Metasploit list.."
  199. getMetasploitList()
  200. print "Downloading Exploit-db csv list.."
  201. getExploitDbList()
  202.  
  203. time.sleep(1)
  204. print "\nUpdating Joomla! components.."
  205. getComponents()
  206. print ""
  207.  
  208. else:
  209. if(os.path.isfile("comptotest.txt") is False):
  210. print "\n[-] '%s' not found. You must provide a file containing the Joomla! components to scan for." %compFile
  211. compFile = raw_input("[*] Components List file -> ")
  212. if(os.path.isfile("exp-db_files.csv") is False):
  213. print "\n[-] '%s not found. You must provide a csv file containing the exploit-db list." %expFile
  214. expFile = raw_input("[*] Exploit-db list file -> ")
  215.  
  216. bad_resp = requests.get("%scomponents/impo5sIblexXxD35" %target).text
  217. i = 0
  218.  
  219. with open(compFile,"r") as f:
  220. for line in f:
  221. i += 1
  222. line = line.strip()
  223. if(len(line) > 0 and line != "com_"):
  224. print "[%s] Testing '%s'" %(i,line)
  225. url = "%scomponents/%s" %(target,line)
  226. #print url
  227. try:
  228. r = requests.get(url,headers=headers,timeout=10)
  229. Valid = True
  230. for c in toCheck:
  231. if(c in r.text):
  232. Valid = False
  233. break
  234. if(r.status_code != 404 and Valid and (r.url == url or r.url == "%s/" %url)
  235. and len(r.text) < 5000 and r.text != bad_resp):
  236. foundComp.append(line)
  237. print "%s [FOUND]" %line
  238. except:
  239. pass
  240.  
  241. print "\nJoomla! components found [%s]: \n" %len(foundComp)
  242. print "----------------------------"
  243. for comp in foundComp:
  244. print comp
  245. print "----------------------------\n"
  246.  
  247. exploits = extractExploits(foundComp)
  248. print "\nJoomla! exploits found [%s]: \n" %len(exploits)
  249.  
  250. for comp in foundComp:
  251. print colored("\n%s:\n" %comp,"red")
  252. for exp in exploits:
  253. if(comp in exp):
  254. split = exp.split(",")
  255. code = split[1].split("/")
  256. code = code[len(code)-1].split(".")[0]
  257. output = "%s [https://www.exploit-db.com/exploits/%s/]" %(split[2],code)
  258. print '-' * len(output)
  259. print output
  260. print '-' * len(output)
  261.  
  262. if(len(foundComp) == 0):
  263. print "\n[-] Probably the website has some kind of Flooding protection or it redirects all the requests we send to /components!"
  264.  
  265. print ""
  266.  
  267. if(Update):
  268. os.remove("%s" %compFile)
  269. os.remove("%s" %expFile)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement