Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/auxiliary/scanner/dcerpc/management.rb
Views: 11784
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Auxiliary67# Exploit mixins should be called first8include Msf::Exploit::Remote::DCERPC910include Msf::Auxiliary::Report1112# Scanner mixin should be near last13include Msf::Auxiliary::Scanner1415def initialize16super(17'Name' => 'Remote Management Interface Discovery',18'Description' => %q{19This module can be used to obtain information from the Remote20Management Interface DCERPC service.21},22'Author' => 'hdm',23'License' => MSF_LICENSE24)2526register_options(27[28Opt::RPORT(135)29])30end3132# Obtain information about a single host33def run_host(ip)34begin3536ids = dcerpc_mgmt_inq_if_ids(rport)37return if not ids38ids.each do |id|39print_status("UUID #{id[0]} v#{id[1]}")4041reportdata = ""4243stats = dcerpc_mgmt_inq_if_stats(rport)44if stats45print_status("\t stats: " + stats.map{|i| "0x%.8x" % i}.join(", "))46reportdata << "stats: " + stats.map{|i| "0x%.8x" % i}.join(", ") + " "47end4849live = dcerpc_mgmt_is_server_listening(rport)50if live51print_status("\t listening: %.8x" % live)52#reportdata << "listening: %.8x" % live + " "53end5455dead = dcerpc_mgmt_stop_server_listening(rport)56if dead57print_status("\t killed: %.8x" % dead)58#reportdata << "killed: %.8x" % dead + " "59end6061princ = dcerpc_mgmt_inq_princ_name(rport)62if princ63print_status("\t name: #{princ.unpack("H*")[0]}")64#reportdata << "name: #{princ.unpack("H*")[0]}"65end6667# Add Report68report_note(69:host => ip,70:proto => 'tcp',71:port => datastore['RPORT'],72:type => "DCERPC UUID #{id[0]} v#{id[1]}",73:data => reportdata74)7576end7778rescue ::Interrupt79raise $!80rescue ::Exception => e81print_error("Error: #{e}")82end83end84end858687