exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

sa2001_02.txt

sa2001_02.txt
Posted May 17, 2001
Site nsfocus.com

NSFOCUS Security Advisory SA2001-02 - The nsfocus team has found a vulnerability in filename processing of CGI program in MS IIS4.0/5.0, as discussed in ms01-026. CGI filename is decoded twice by error. Exploitation of this vulnerability leads to intruders being able to run arbitrary system commands with IUSER_machinename account privilege. Exploit URL's included.

tags | exploit, arbitrary, cgi
SHA-256 | 1f24fde1bac96def60ac10c00a6e82940ada309470835ba73f5d78b25c6f6fec

sa2001_02.txt

Change Mirror Download
NSFBUGTRAQOCUS Security Advisory(SA2001-02)

Topic: Microsoft IIS CGI Filename Decode Error Vulnerability

Release Date£º 2001-5-15

CVE Candidate Numbers: CAN-2001-0333
BUGTRAQ ID : 2708

Affected system:
================

- Microsoft IIS 4.0
- Microsoft IIS 5.0

Not affected system:
====================

- Microsoft IIS 4.0
+ Microsoft Windows NT 4 + SP6/SP6a(without any new hotfix)

Impact:
=========

NSFOCUS Security Team has found a vulnerability in filename processing
of CGI program in MS IIS4.0/5.0. CGI filename is decoded twice by error.
Exploitation of this vulnerability, intruder may run arbitrary system
command.

Description£º
============

When loading executable CGI program, IIS will decode twice. First, CGI
filename will be decoded to check if it is an executable file (for
example, '.exe' or '.com' suffix check-up). Successfully passing the
filename check-up, IIS will run another decode process.
Normally, only CGI parameters should be decoded in this process. But
this time IIS mistakenly decodes both CGI parameters and the decoded
CGI filename. In this way, CGI filename is decoded twice by error.

With a malformed CGI filename, attacker can get round IIS filename
security check-ups like '../' or './' check-up. In some cases, attacker
can run arbitrary system command.

For example, a character '\' will be encoded to "%5c". And the corresponding
code of these 3 characters is:
'%' = %25
'5' = %35
'c' = %63

encode this 3 characters for another time, we can get many results such as:
%255c
%%35c
%%35%63
%25%35%63
...

Thereby, '..\' can be represented by '..%255c' and '..%%35c', etc.
After first decoding, '..%255c' is turned into '..%5c'. IIS will take it as a
legal character string that can pass security check-up. But after a second
decode process, it will be reverted to '..\'. Hence, attacker can use '..\'
to carry out directory traversal and run arbitrary program outside of Web
directory.


Exploit:
==========

For example, TARGET has a virtual executable directory (e.g. "scripts")
that is located on the same driver of Windows system. Submit request like
this:

http://TARGET/scripts/..%255c..%255cwinnt/system32/cmd.exe?/c+dir+c:\

Directory list of C:\ will be revealed.

Of course, same effect can be achieved by this kind of processing to '/'
and '.'.
For example: "..%252f", ".%252e/"...

Note: Attacker can run commands of IUSER_machinename account privilege only.


Workaround:
===================

1¡¢If executable CGI is not integrant, delete the executable virtual
directory like /scripts etc.
2¡¢If executable virtual directory is needed, we suggest you to assign a
separate local driver for it.
3¡¢Move all command-line utilities to another directory that could be used
by an attacker, and forbid GUEST group access those utilities.


Vendor Status:
==============

2001.3.27 We informed Microsoft of this vulnerability.
2001.4.01 Microsoft replied that the bug has been reproduced.
2001.4.16 Microsoft supplied private patches for testing and the
problem had been solved.
2001.4.23 For further testing, Microsoft requested us to hold off the
release of the advisory for 2 weeks.
2001.4.30 Microsoft informed us that we should put off the release
for another week.
2001.5.14 Microsoft has released one security bulletin(MS01-026)
concerning this flaw.

The bulletin is live at :

http://www.microsoft.com/technet/security/bulletin/MS01-026.asp

Patches are available at:

Microsoft IIS 4.0:
http://www.microsoft.com/Downloads/Release.asp?ReleaseID=29787

Microsoft IIS 5.0:
http://www.microsoft.com/Downloads/Release.asp?ReleaseID=29764

Additional Information:
========================

The Common Vulnerabilities and Exposures (CVE) project has
assigned the name CAN-2001-0333 to this issue. This is a
candidate for inclusion in the CVE list (http://cve.mitre.org),
which standardizes names for security problems. Candidates
may change significantly before they become official CVE entries.

DISCLAIMS:
==========
THE INFORMATION PROVIDED IS RELEASED BY NSFOCUS "AS IS" WITHOUT WARRANTY
OF ANY KIND. NSFOCUS DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED,
EXCEPT FOR THE WARRANTIES OF MERCHANTABILITY. IN NO EVENTSHALL NSFOCUS
BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT,
INCIDENTAL,CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES,
EVEN IF NSFOCUS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
DISTRIBUTION OR REPRODUTION OF THE INFORMATION IS PROVIDED THAT THE
ADVISORY IS NOT MODIFIED IN ANY WAY.

Copyright 1999-2001 NSFOCUS. All Rights Reserved. Terms of use.


NSFOCUS Security Team <security@nsfocus.com>
NSFOCUS INFORMATION TECHNOLOGY CO.,LTD
(http://www.nsfocus.com)



Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    8 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    11 Files
  • 23
    Apr 23rd
    68 Files
  • 24
    Apr 24th
    23 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close