2007-02-18 00:10:39 +00:00
|
|
|
##
|
2008-10-02 05:23:59 +00:00
|
|
|
# $Id$
|
2007-02-18 00:10:39 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
##
|
|
|
|
# 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/projects/Framework/
|
|
|
|
##
|
|
|
|
|
|
|
|
|
2006-08-13 18:03:49 +00:00
|
|
|
require 'msf/core'
|
|
|
|
|
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
class Metasploit3 < Msf::Auxiliary
|
2006-08-13 18:03:49 +00:00
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
include Msf::Exploit::Remote::MSSQL
|
|
|
|
include Msf::Auxiliary::Scanner
|
2006-08-13 18:03:49 +00:00
|
|
|
|
|
|
|
def initialize
|
|
|
|
super(
|
|
|
|
'Name' => 'MSSQL Ping Utility',
|
2007-02-18 00:10:39 +00:00
|
|
|
'Version' => '$Revision$',
|
2006-08-13 18:03:49 +00:00
|
|
|
'Description' => 'This module simply queries the MSSQL instance for information.',
|
|
|
|
'Author' => 'MC',
|
|
|
|
'License' => MSF_LICENSE
|
|
|
|
)
|
|
|
|
|
|
|
|
deregister_options('RPORT', 'RHOST')
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def run_host(ip)
|
|
|
|
|
|
|
|
begin
|
|
|
|
|
|
|
|
info = mssql_ping(2)
|
|
|
|
if (info['ServerName'])
|
|
|
|
print_status("SQL Server information for #{ip}:")
|
|
|
|
info.each_pair { |k,v|
|
|
|
|
print_status(" #{k + (" " * (15-k.length))} = #{v}")
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
rescue Errno::EACCES
|
|
|
|
end
|
|
|
|
end
|
2008-10-19 21:03:39 +00:00
|
|
|
end
|