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

eeye.iishack-1.5.txt

eeye.iishack-1.5.txt
Posted Nov 5, 2000
Authored by eEye Digital Security | Site eEye.com

A buffer overflow has been discovered in the IIS 4.0 and 5.0 .asp file parsing mechanism. When IIS reads a malformed .asp file, code can be executed to take control of the local server as system. This can be exploited remotely by combining with the unicode bug or by paying for a web hosting account.

tags | web, overflow, local, asp
SHA-256 | 55452aba2566040a0d3cd658472e5693c9fb1752803985a1aceccb5a5abe6090

eeye.iishack-1.5.txt

Change Mirror Download
IIS ASP $19.95 hack - IISHack 1.5

Release Date:
November 3rd, 2000

Systems Affected:
Windows NT 4.0 IIS 4.0 sp6 (vulnerable)
Windows NT 5.0 IIS 5.0 (not vulnerable)

Description:
There exists a buffer overflow, that can be exploited to gain SYSTEM level
access, within the IIS (Internet Information Server) .ASP ISAPI file parsing
mechanism.

This is not a remote exploit, it is a local one (However, we will explain
later in the advisory how you _could_ pull this exploit off remotely.). It
is local in the sense that you need to actually create an "evil" .asp file
that when parsed by IIS will cause inetinfo.exe to buffer overflow and
therefore allow you to take control of the local server as SYSTEM.

So who is affected by this? Any web hosting company or internet service
provider that is running multiple clients within the same NT4 IIS 4 web
server. Basically any client (or attacker) who can update their website,
i.e. upload a new default.asp or anything.asp, can then execute code as
SYSTEM and therefore take complete control of your server. They could then
do whatever they want to any of the other client websites hosted on that NT4
server. On the other hand they could install sniffers or crack passwords to
further their control of your network.

Hence the title $19.95 hack... Anyone with $20 dollars to spend can
potentially break into any web hosting company or internet service provider
running NT4+IIS4. Simply buy an account with a web hosting company, upload
your evil.asp and request that evil.asp from your website, I.E.
http://www.badguy.com/evil.asp, and your executing code on that server as
SYSTEM.

Here is an example .asp file that will cause NT4+IIS4's inetinfo.exe to
overflow.

----start-cut-of-example.asp----
<SCRIPT LANGUAGE="[buffer]" RUNAT="Server">
</SCRIPT>
----start-cut-of-example.asp----

Where [buffer] is 2220 characters or more. Yes, this overflow is
exploitable. See section below.

So you don't have $20 dollars to spend, or a server does not host websites?
What then? Well there are going to be situations when a remote attack is
possible.

An example situation would be a server that has a guest book/message board
system that does not strip out SCRIPT comments when it writes to its
returned .asp file. So an attacker could go to a web board and within the
"Enter your message here:" box (or whatever) they could simply paste in the
contents of the script language overflow and submit the message. Then once
they requested the .asp file that has that message (the embedded overflow
msg) it would cause IIS to parse that .asp file, overflow, and execute their
code.

On another note you could couple this attack with the recent IIS Unicode bug
to use cmd.exe to echo the contents of your evil.asp to the remote system
then when you request evil.asp your code is executed as SYSTEM. In fact, we
have created a sample exploit to show how this .asp language overflow and
the IIS Unicode exploit could be used together to remotely compromise any
NT4+IIS4+SP6(or lower) system that is behind in installing hot fixes.

Due to the nature of this attack it is likely and quite possible that
firewalls will not protect you against attacks like this.

The Exploit:
How to remotely exploit a system? Use the IIS Unicode exploit + .asp
language overflow.
For those of you not familiar with the IIS Unicode exploit, it basically
allows you to remotely execute commands against IIS as IUSR_MACHINE. Now
since we can execute commands via cmd.exe we could try to make the remote
web server connect out to an FTP server to grab a file (sort of like the
first IISHack) but you would still be executing code as IUSR_MACHINE. The
way our exploit works is by using the Unicode bug to echo our .asp file
(complete with shell code, to bind cmd.exe to a port ;-]) to a remote server
and then request that .asp file which then causes inetinfo.exe to overflow
resulting in a SYSTEM privileged cmd.exe to be bound to a specified port.
Now, in most circumstances you should have correct acl's on cmd.exe (that
would not allow IUSR_MACHINE to touch it) as well as some other security
precautions in place, so we understand this exploit will not work on a
secured system. However, this is just proof of concept and as most of us
know, most IIS servers do not have proper local security in place. The
exploit basically looks like the following when compiled:

C:\we are still hiring good programmers> iishack1.5.exe
IISHack Version 1.5
eEye Digital Security
http://www.eEye.com
Code By: Ryan Permeh & Marc Maiffret
eEye Digital Security takes no responsibility for use of this code.
It is for educational purposes only.

Usage: IISHack1.5 [server] [server-port] [trojan-port]

C:\send resume to hire@eeye.com> iishack1.5.exe www.[yourowncompany].com 80
6969
IISHack Version 1.5
eEye Digital Security
http://www.eEye.com
Code By: Ryan Permeh & Marc Maiffret
eEye Digital Security takes no responsibility for use of this code.
It is for educational purposes only.

Attempting to find an executable directory...
Trying directory [scripts]
Executable directory found. [scripts]
Path to executable directory is [C:\Inetpub\scripts]
Moving cmd.exe from winnt\system32 to C:\Inetpub\scripts.
Successfully moved cmd.exe to C:\Inetpub\scripts\eeyehack.exe
Sending the exploit...
Exploit sent! Now telnet to www.[yourowncompany].com on port 6969 and you
should get a cmd prompt.
C:\> telnet www.[yourowncompany].com 6969
Trying www.[yourowncompany].com...
Microsoft(R) Windows NT(TM)
(C) Copyright 1985-1996 Microsoft Corp.

C:\WINNT\system32>whoami
NT AUTHORITY\SYSTEM

Download the full exploit from:
http://www.eEye.com/html/advisories/IISHack1.5.zip

Vendor Status:
Microsoft has already fixed this .asp language overflow in prior hot fixes
and applied it to most post service pack 6 hot fixes. This flaw has been
fixed in the latest versions of W3SVC.DLL. Installing any recent hotfix will
fix the problem.
Here is a list of _some_ MS advisories and hotfixes that will fix the .asp
language overflow vulnerability:
MS00-080: Patch Available for "Session ID Cookie Marking" Vulnerability
MS00-060: Patch Available for "IIS Cross-Site Scripting" Vulnerabilities
MS00-057: Patch Available for "File Permission Canonicalization"
Vulnerability
MS00-030: Patch Available for "Malformed Extension Data in URL"
Vulnerability
MS00-023: Patch Available for "Myriad Escaped Characters" Vulnerability
MS00-019: Patch Available for "Virtualized UNC Share" Vulnerability
MS00-018: Patch Available for "Chunked Encoding Post" Vulnerability

W3SVC versions greater than 720 addresses this issue. So if you've been
keeping up to date with your hot fixes then you should not be vulnerable to
this issue.

Copyright (c) 1998-2000 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
mail:info@eEye.com
http://www.eEye.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
    0 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    0 Files
  • 23
    Apr 23rd
    0 Files
  • 24
    Apr 24th
    0 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