2007-04-14 05:22:22 +00:00
|
|
|
##
|
2008-10-02 05:23:59 +00:00
|
|
|
# $Id$
|
2007-04-14 05:22:22 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
##
|
2010-04-30 08:40:19 +00:00
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
2007-04-14 05:22:22 +00:00
|
|
|
# redistribution and commercial restrictions. Please see the Metasploit
|
|
|
|
# Framework web site for more information on licensing and terms of use.
|
2009-04-13 14:33:26 +00:00
|
|
|
# http://metasploit.com/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
|
|
|
|
|
|
|
# Exploit mixins should be called first
|
2008-10-02 05:23:59 +00:00
|
|
|
include Msf::Exploit::Remote::DCERPC
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2007-04-14 05:22:22 +00:00
|
|
|
# Scanner mixin should be near last
|
2008-10-02 05:23:59 +00:00
|
|
|
include Msf::Auxiliary::Scanner
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2007-04-14 05:22:22 +00:00
|
|
|
def initialize
|
|
|
|
super(
|
|
|
|
'Name' => 'Remote Management Interface Discovery',
|
2007-05-07 04:48:45 +00:00
|
|
|
'Version' => '$Revision$',
|
2007-04-14 05:22:22 +00:00
|
|
|
'Description' => %q{
|
2010-04-30 08:40:19 +00:00
|
|
|
This module can be used to obtain information from the Remote
|
2007-04-14 05:22:22 +00:00
|
|
|
Management Interface DCERPC service.
|
|
|
|
},
|
|
|
|
'Author' => 'hdm',
|
|
|
|
'License' => MSF_LICENSE
|
|
|
|
)
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2007-04-14 05:22:22 +00:00
|
|
|
deregister_options('RHOST')
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2007-04-14 05:22:22 +00:00
|
|
|
register_options(
|
|
|
|
[
|
|
|
|
Opt::RPORT(135)
|
2010-04-30 08:40:19 +00:00
|
|
|
], self.class)
|
2007-04-14 05:22:22 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
# Obtain information about a single host
|
2010-04-30 08:40:19 +00:00
|
|
|
def run_host(ip)
|
2007-04-14 05:22:22 +00:00
|
|
|
begin
|
|
|
|
|
|
|
|
ids = dcerpc_mgmt_inq_if_ids(rport)
|
|
|
|
return if not ids
|
|
|
|
ids.each do |id|
|
|
|
|
print_status("UUID #{id[0]} v#{id[1]}")
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2007-04-14 05:22:22 +00:00
|
|
|
stats = dcerpc_mgmt_inq_if_stats(rport)
|
2007-04-16 01:41:50 +00:00
|
|
|
print_status("\t stats: " + stats.map{|i| "0x%.8x" % i}.join(", ")) if stats
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2007-04-14 05:22:22 +00:00
|
|
|
live = dcerpc_mgmt_is_server_listening(rport)
|
2007-04-16 01:41:50 +00:00
|
|
|
print_status("\t listening: %.8x" % live) if live
|
2007-04-14 05:22:22 +00:00
|
|
|
|
|
|
|
dead = dcerpc_mgmt_stop_server_listening(rport)
|
2007-04-16 01:41:50 +00:00
|
|
|
print_status("\t killed: %.8x" % dead) if dead
|
2007-04-14 05:22:22 +00:00
|
|
|
|
|
|
|
princ = dcerpc_mgmt_inq_princ_name(rport)
|
|
|
|
print_status("\t name: #{princ.unpack("H*")[0]}") if princ
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2007-04-14 05:22:22 +00:00
|
|
|
end
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2007-04-14 05:22:22 +00:00
|
|
|
rescue ::Interrupt
|
|
|
|
raise $!
|
|
|
|
rescue ::Exception => e
|
2008-12-19 07:11:08 +00:00
|
|
|
print_status("Error: #{e}")
|
2007-04-14 05:22:22 +00:00
|
|
|
end
|
|
|
|
end
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2007-04-14 05:22:22 +00:00
|
|
|
|
2008-10-19 21:03:39 +00:00
|
|
|
end
|