what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

iis-unicode.txt

iis-unicode.txt
Posted Oct 17, 2000
Authored by rain forest puppy | Site wiretrip.net

rain forest puppy's investigation of the recent Microsoft IIS remote command execution vulnerability which was first mentioned in a ms00-078. UNICODE character translation on foreign IIS 4.0 and 5.0 servers allows additional ways of encoding '/' and '\', allowing commands to be executed under the IUSR_machine context.

tags | exploit, remote
SHA-256 | 2b1c446965eae66c719dc5275df8c83c036b0c35b914f77fa9b14f18472713f1

iis-unicode.txt

Change Mirror Download

Recently I received an email from Par Osterberg that directed my attention
to a post in the Packetstorm forums:

http://209.143.242.119/cgi-bin/cbmc/forums.cgi?authkey=anonymous&uname=anonymous&datopic=Windows&mesgcheck=defined&gum=474&editoron=

An anonymous person posts that they can run arbitrary commands on IIS 5
(Win 2000) using the following URL:

http://address.of.iis5.system/scripts/..%c1%1c../winnt/system32/cmd.exe?/c+dir+c:\

They also gave a sample site that appeared to be vulnerable. Following
the thread shows various people trying (unsuccessfully) to recreate the
problem.

So is the site listed a fake, meant to *appear* vulnerable? Was it due to
a misconfiguration?

First I tried my IIS5/Win2K test server--and it wasn't vulnerable.
However, the sample site was in China (hence the .cn), and they were using
a UNICODE character set different than mine.

So doing a quick search on a search engine for sites hosting the default
IIS5 web page, I found a dozen that had foreign UNICODE fonts--and all of
them were vulnerable.

Checking a few other US-font sites resulted in them being not vulnerable.
So at this point there is enough confirmation that there is a problem. I
can only speculate 'why' this is a vulnerability, and I figure it has to
do something with UNICODE translation.

However, it's still odd. And I'm not satisfied. Pulling up vi (yes,
Marissa, vi--not pico (anymore)), I coded a quick little perl script that
will check all 65535 combinations in place of the %c1%1c in the 'exploit'
URL. Sorry, but I'm not going to post the script, since it's built on
whisker v2.0 code, which I'm not ready to release. :)

Anyways, the script chugged through all 65535, kicking back various errors
from 'Not Found', 'Authentication Required' (?!?), 'Read Access
Forbidden', and various API error messages ('The parameter is incorrect.'
and 'The file, directory name, or syntax is invalid.').

But there in the output, in two particular instances, I had a directory
listing. Yikes.

It seems the values of %c0%af and %c1%9c work for IIS 5. Curiousity
getting the better of me, I tried it on IIS 4. Uh oh, works there too.

So is it UNICODE based? Yes. %c0%af and %c1%9c are overlong UNICODE
representations for '/' and '\'. There may even be longer (3+ byte)
overlong representations too. IIS seems to decode UNICODE at the wrong
instance (after path checking, rather than before). I didn't learn this
until later on (after doing some research on UTF-8).

Obviously, since this was initially posted to a public forum, I take no
credit for the original find--all I did was further develop the research.
Thanks again to Par Osterberg for sending me the URL.

Microsoft has released MS00-078 to warn of the problem. The patch from
MS00-057 ("File permission canonicalization") fixes this problem. Note to
world: MS had a 2 hour turn-around on contact (at 1am, no less), and about
12 hours for talking with the developers, going over the problem, and
deciding a gameplan. I think that's worth a kudos. Thanks to Scott Culp
and David LeBlanc for putting up with me and wasting their weekends. :)

- rain forest puppy

ps. while I thought this was going to be bigger than RDS, it turns out the
program execution happens under IUSR_machine context, so you're limited
(e.g. you can't just grab the SAM, etc).

Login or Register to add favorites

File Archive:

May 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    May 1st
    44 Files
  • 2
    May 2nd
    5 Files
  • 3
    May 3rd
    11 Files
  • 4
    May 4th
    0 Files
  • 5
    May 5th
    0 Files
  • 6
    May 6th
    28 Files
  • 7
    May 7th
    3 Files
  • 8
    May 8th
    4 Files
  • 9
    May 9th
    54 Files
  • 10
    May 10th
    12 Files
  • 11
    May 11th
    0 Files
  • 12
    May 12th
    0 Files
  • 13
    May 13th
    17 Files
  • 14
    May 14th
    11 Files
  • 15
    May 15th
    17 Files
  • 16
    May 16th
    13 Files
  • 17
    May 17th
    22 Files
  • 18
    May 18th
    0 Files
  • 19
    May 19th
    0 Files
  • 20
    May 20th
    0 Files
  • 21
    May 21st
    0 Files
  • 22
    May 22nd
    0 Files
  • 23
    May 23rd
    0 Files
  • 24
    May 24th
    0 Files
  • 25
    May 25th
    0 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

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close