metasploit-framework/modules/auxiliary/scanner/steam/server_info.rb

67 lines
1.7 KiB
Ruby
Raw Normal View History

##
2017-07-24 13:26:21 +00:00
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'rex/proto/steam'
2016-03-08 13:02:44 +00:00
class MetasploitModule < Msf::Auxiliary
include Msf::Auxiliary::Report
include Msf::Auxiliary::UDPScanner
include Rex::Proto::Steam
def initialize(info = {})
super(
update_info(
info,
2014-11-10 21:27:12 +00:00
'Name' => 'Gather Steam Server Information',
'Description' => %q(
2014-11-10 21:27:12 +00:00
This module uses the A2S_INFO request to obtain information from a Steam server.
),
2014-11-18 19:50:01 +00:00
'Author' => 'Jon Hart <jon_hart[at]rapid7.com>',
'References' =>
[
2014-11-10 21:27:12 +00:00
# TODO: add more from https://developer.valvesoftware.com/wiki/Server_queries,
# perhaps in different modules
['URL', 'https://developer.valvesoftware.com/wiki/Server_queries#A2S_INFO']
],
'License' => MSF_LICENSE
)
)
register_options(
[
2014-11-10 21:27:12 +00:00
Opt::RPORT(27015)
])
end
def build_probe
@probe ||= a2s_info
end
def scanner_process(response, src_host, src_port)
info = a2s_info_decode(response)
return unless info
@results[src_host] ||= []
if datastore['VERBOSE']
print_good("#{src_host}:#{src_port} found '#{info.inspect}'")
else
print_good("#{src_host}:#{src_port} found '#{info[:name]}'")
end
@results[src_host] << info
end
def scanner_postscan(_batch)
2014-11-10 21:27:12 +00:00
@results.each_pair do |host, info|
report_host(host: host)
report_service(
host: host,
proto: 'udp',
port: rport,
2014-11-10 21:27:12 +00:00
name: 'Steam',
info: info
)
end
end
end