never stop questioning

iis.asp.overflow.txt

iis.asp.overflow.txt
Posted Apr 11, 2002
Authored by Marc Maiffret | Site eEye.com

A vulnerability in the ASP (Active Server Pages) ISAPI filter, loaded by default on all NT4 and Windows 2000 server systems (running IIS), can be exploited to remotely execute code of an attackers choice. Example which causes an application error included. Microsoft advisory on this vulnerability here.

tags | exploit, asp
systems | windows, 2k
MD5 | 4cdf305e59b0d7ba7de3156cc1e0c3c2

iis.asp.overflow.txt

Change Mirror Download
Windows 2000 and NT4 IIS .ASP Remote Buffer Overflow

Release Date:
00/00/2002

Severity:
High (Remote code execution)
IWAM_MACHINE Privilege Level

Systems Affected:
Microsoft Windows NT 4.0 Internet Information Services 4.0
Microsoft Windows 2000 Internet Information Services 5.0

Description:

A vulnerability in the ASP (Active Server Pages) ISAPI filter, loaded by
default on all NT4 and Windows 2000 server systems (running IIS), can be
exploited to remotely execute code of an attackers choice. The fault lies
within the decoding and interpretation of form data received by malicious
clients. By chunk encoding form data we can force IIS to overwrite 4 bytes
of arbitrary memory with data we supply.

This is a very serious vulnerability and eEye suggests that administrators
install the Microsoft supplied patch as soon as possible.

The following example will show the vulnerable condition. We will use a
default .asp page left after install on a Windows 2000 server with the
latest service packs.

Example:


**************Begin Session****************
POST /iisstart.asp HTTP/1.1
Accept: */*
Host: eeye.com
Content-Type: application/x-www-form-urlencoded
Transfer-Encoding: chunked

10
PADPADPADPADPADP
4
DATA
4
DEST
0
[enter]
[enter]
**************End Session******************

Technical Description:

The example session above causes the default exception handler to execute
from within the dllhost child process. When the default exception handler
executes a window will open with this message:


DLLHOST.EXE - Application error
The instruction at 0x77fcb397 referenced memory at 0x54534544

Notice that 0x54534544 is the hex representation of "TSED", or the value
"DEST" in little endian format. The DLLHOST.EXE process is trying to copy
"DATA" to "DEST". Because there isn't writeable memory at 0x54534544, an
access violation occurs and the structured exception handling (SEH) within
the NT kernel catches it and kills the child dllhost.exe process.

The crux of this problem lies in the fact that the memory we overwrite with
our data contains Heap Management header structures, in our case being used
by AllocateHeap(). Specifically, as we overwrote the header, we control two
four byte addresses within it. These addresses are associated with the
population and use of lookaside lists. The first four-byte address, which in
our example is overwritten by "DATA", is an address that gets copied to the
second four-byte address specified in header. We have also overwritten the
second address, this time with "DEST". By overwriting these two addresses,
we can put four bytes anywhere in memory that the child dllhost.exe has
privileges to write to. This allows us to overwrite function pointers,
saved instruction pointers, exception handlers, or anything else that will
allow us to control the flow of execution into our payload. We have been
most successful in exploitation by overwriting a structured exception
handler address on the stack. Due to the fact that we supplied addresses
that aren't associated with valid lookaside lists, an exception handler will
be called, and when it does, it will call our modified routine, which points
directly into payload code.

It should be noted that while this vulnerability exists in the .ASP ISAPI, a
mechanism is still required to get the malicious request to hit the
vulnerable functions within the .ASP ISAPI. Although pages with form
submissions make it easier to demonstrate this vulnerability, there are
other methods for causing code to execute beyond the form variable
referencing. In the above example we used a default .asp file that has
script code within it that deals with .ASP Server Variables. When the .ASP
ISAPI performs processing on the Server Variables, we are able to cause an
overflow and execute code. There are .asp files by default in IIS that allow
processing of Server Variables, which make it possible to demonstrate the
existence of this vulnerability on default installations.

Like most of the IIS vulnerabilities eEye has discovered in the past,
firewalls and intrusion detection systems do not protect from this
vulnerability.

SecureIIS - Application Firewall for Microsoft IIS

It should be noted that clients using SecureIIS 1.2.5 and above are secure
from this vulnerability. This vulnerability was discovered by the eEye team
while testing a new version of SecureIIS to help further its protection
abilities. To learn more visit http://www.eeye.com/SecureIIS

Vendor Status:
Microsoft has released a security bulletin and patch:
http://www.microsoft.com/technet/security/bulletin/MS02-018.asp

Credit:
Discovery: Riley Hassell
Exploitation Research: Riley Hassell and Ryan Permeh

Greetings:
To all the people who continue to make the security industry more exciting
with innovative research. Also to the rest of eEye, who help make all this
magic possible.

Copyright (c) 1998-2002 eEye Digital Security
Permission is hereby granted for the redistribution of this alert
electronically. It is not to be edited in any way without express consent of
eEye. If you wish to reprint the whole or any part of this alert in any
other medium excluding electronic medium, please e-mail alert@eEye.com for
permission.

Disclaimer
The information within this paper may change without notice. Use of this
information constitutes acceptance for use in an AS IS condition. There are
NO warranties with regard to this information. In no event shall the author
be liable for any damages whatsoever arising out of or in connection with
the use or spread of this information. Any use of this information is at the
user's own risk.

Feedback
Please send suggestions, updates, and comments to:

eEye Digital Security
http://www.eEye.com
info@eEye.com

Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

May 2012

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    May 1st
    37 Files
  • 2
    May 2nd
    53 Files
  • 3
    May 3rd
    33 Files
  • 4
    May 4th
    4 Files
  • 5
    May 5th
    10 Files
  • 6
    May 6th
    17 Files
  • 7
    May 7th
    19 Files
  • 8
    May 8th
    36 Files
  • 9
    May 9th
    34 Files
  • 10
    May 10th
    35 Files
  • 11
    May 11th
    20 Files
  • 12
    May 12th
    18 Files
  • 13
    May 13th
    11 Files
  • 14
    May 14th
    27 Files
  • 15
    May 15th
    58 Files
  • 16
    May 16th
    54 Files
  • 17
    May 17th
    25 Files
  • 18
    May 18th
    53 Files
  • 19
    May 19th
    9 Files
  • 20
    May 20th
    15 Files
  • 21
    May 21st
    25 Files
  • 22
    May 22nd
    32 Files
  • 23
    May 23rd
    35 Files
  • 24
    May 24th
    26 Files
  • 25
    May 25th
    25 Files
  • 26
    May 26th
    0 Files
  • 27
    May 27th
    0 Files
  • 28
    May 28th
    0 Files
  • 29
    May 29th
    0 Files
  • 30
    May 30th
    0 Files
  • 31
    May 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2012 Packet Storm. All rights reserved.

close