2007-04-14 05:22:22 +00:00
|
|
|
##
|
2014-10-17 16:47:33 +00:00
|
|
|
# This module requires Metasploit: http://metasploit.com/download
|
2013-10-15 18:50:46 +00:00
|
|
|
# Current source: https://github.com/rapid7/metasploit-framework
|
2007-04-14 05:22:22 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
|
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
class Metasploit3 < Msf::Auxiliary
|
2007-04-14 05:22:22 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
# Exploit mixins should be called first
|
|
|
|
include Msf::Exploit::Remote::DCERPC
|
|
|
|
|
|
|
|
include Msf::Auxiliary::Report
|
|
|
|
|
|
|
|
# Scanner mixin should be near last
|
|
|
|
include Msf::Auxiliary::Scanner
|
|
|
|
|
|
|
|
def initialize
|
|
|
|
super(
|
|
|
|
'Name' => 'Remote Management Interface Discovery',
|
|
|
|
'Description' => %q{
|
|
|
|
This module can be used to obtain information from the Remote
|
|
|
|
Management Interface DCERPC service.
|
|
|
|
},
|
|
|
|
'Author' => 'hdm',
|
|
|
|
'License' => MSF_LICENSE
|
|
|
|
)
|
|
|
|
|
|
|
|
deregister_options('RHOST')
|
|
|
|
|
|
|
|
register_options(
|
|
|
|
[
|
|
|
|
Opt::RPORT(135)
|
|
|
|
], self.class)
|
|
|
|
end
|
|
|
|
|
|
|
|
# Obtain information about a single host
|
|
|
|
def run_host(ip)
|
|
|
|
begin
|
|
|
|
|
|
|
|
ids = dcerpc_mgmt_inq_if_ids(rport)
|
|
|
|
return if not ids
|
|
|
|
ids.each do |id|
|
|
|
|
print_status("UUID #{id[0]} v#{id[1]}")
|
|
|
|
|
|
|
|
reportdata = ""
|
|
|
|
|
|
|
|
stats = dcerpc_mgmt_inq_if_stats(rport)
|
|
|
|
if stats
|
|
|
|
print_status("\t stats: " + stats.map{|i| "0x%.8x" % i}.join(", "))
|
|
|
|
reportdata << "stats: " + stats.map{|i| "0x%.8x" % i}.join(", ") + " "
|
|
|
|
end
|
|
|
|
|
|
|
|
live = dcerpc_mgmt_is_server_listening(rport)
|
|
|
|
if live
|
|
|
|
print_status("\t listening: %.8x" % live)
|
|
|
|
#reportdata << "listening: %.8x" % live + " "
|
|
|
|
end
|
|
|
|
|
|
|
|
dead = dcerpc_mgmt_stop_server_listening(rport)
|
|
|
|
if dead
|
|
|
|
print_status("\t killed: %.8x" % dead)
|
|
|
|
#reportdata << "killed: %.8x" % dead + " "
|
|
|
|
end
|
|
|
|
|
|
|
|
princ = dcerpc_mgmt_inq_princ_name(rport)
|
|
|
|
if princ
|
|
|
|
print_status("\t name: #{princ.unpack("H*")[0]}")
|
|
|
|
#reportdata << "name: #{princ.unpack("H*")[0]}"
|
|
|
|
end
|
|
|
|
|
2015-04-03 11:12:23 +00:00
|
|
|
# Add Report
|
2013-08-30 21:28:54 +00:00
|
|
|
report_note(
|
|
|
|
:host => ip,
|
|
|
|
:proto => 'tcp',
|
|
|
|
:port => datastore['RPORT'],
|
|
|
|
:type => "DCERPC UUID #{id[0]} v#{id[1]}",
|
|
|
|
:data => reportdata
|
|
|
|
)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
rescue ::Interrupt
|
|
|
|
raise $!
|
|
|
|
rescue ::Exception => e
|
|
|
|
print_error("Error: #{e}")
|
|
|
|
end
|
|
|
|
end
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2010-06-21 16:53:52 +00:00
|
|
|
end
|