Fix the description

git-svn-id: file:///home/svn/framework3/trunk@8406 4d416f70-5f16-0410-b530-b9f4589650da
unstable
HD Moore 2010-02-08 13:53:50 +00:00
parent c28f15d02c
commit 79c68e3784
1 changed files with 36 additions and 34 deletions

View File

@ -3,7 +3,7 @@
## ##
## ##
# This file is part of the Metasploit Framework and may be subject to # This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit # redistribution and commercial restrictions. Please see the Metasploit
# Framework web site for more information on licensing and terms of use. # Framework web site for more information on licensing and terms of use.
# http://metasploit.com/framework/ # http://metasploit.com/framework/
@ -28,28 +28,29 @@ require 'cgi'
def initialize(info = {}) def initialize(info = {})
super(update_info(info, super(update_info(info,
'Name' => 'HTTP Virtual Host Brute Force Scanner', 'Name' => 'HTTP Virtual Host Brute Force Scanner',
'Description' => %q{ 'Description' => %q{
This module scans a web server for This module tries to identify unique virutal hosts
hosted by the target web server.
}, },
'Author' => [ 'et [at] cyberspace.org' ], 'Author' => [ 'et [at] cyberspace.org' ],
'License' => BSD_LICENSE, 'License' => BSD_LICENSE,
'Version' => '$Revision$')) 'Version' => '$Revision$'))
register_options( register_options(
[ [
OptString.new('PATH', [ true, "The PATH to use while testing", '/']), OptString.new('PATH', [ true, "The PATH to use while testing", '/']),
OptString.new('QUERY', [ false, "HTTP URI Query", '']), OptString.new('QUERY', [ false, "HTTP URI Query", '']),
OptString.new('DOMAIN', [ true, "Domain name", '']), OptString.new('DOMAIN', [ true, "Domain name", '']),
OptString.new('HEADERS', [ false, "HTTP Headers", '']), OptString.new('HEADERS', [ false, "HTTP Headers", '']),
], self.class) ], self.class)
end end
def run_host(ip) def run_host(ip)
valstr = [ valstr = [
"admin", "admin",
"services", "services",
@ -64,63 +65,63 @@ require 'cgi'
"www", "www",
"web" "web"
] ]
datastore['QUERY'] ? tquery = queryparse(datastore['QUERY']): nil datastore['QUERY'] ? tquery = queryparse(datastore['QUERY']): nil
datastore['HEADERS'] ? thead = headersparse(datastore['HEADERS']) : nil datastore['HEADERS'] ? thead = headersparse(datastore['HEADERS']) : nil
noexistsres = nil noexistsres = nil
resparr = [] resparr = []
2.times do |n| 2.times do |n|
randhost = Rex::Text.rand_text_alpha(5)+"."+datastore['DOMAIN'] randhost = Rex::Text.rand_text_alpha(5)+"."+datastore['DOMAIN']
begin begin
noexistsres = send_request_cgi({ noexistsres = send_request_cgi({
'uri' => datastore['PATH'], 'uri' => datastore['PATH'],
'vars_get' => tquery, 'vars_get' => tquery,
'headers' => thead, 'headers' => thead,
'vhost' => randhost, 'vhost' => randhost,
'method' => 'GET', 'method' => 'GET',
'ctype' => 'text/plain' 'ctype' => 'text/plain'
}, 20) }, 20)
print_status("[#{ip}] Sending request with random domain #{randhost} ") print_status("[#{ip}] Sending request with random domain #{randhost} ")
if noexistsres if noexistsres
resparr[n] = noexistsres.body resparr[n] = noexistsres.body
end end
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout
rescue ::Timeout::Error, ::Errno::EPIPE rescue ::Timeout::Error, ::Errno::EPIPE
end end
end end
if resparr[0] != resparr[1] if resparr[0] != resparr[1]
print_error("[#{ip}] Unable to identify error response") print_error("[#{ip}] Unable to identify error response")
return return
end end
valstr.each do |astr| valstr.each do |astr|
thost = astr+"."+datastore['DOMAIN'] thost = astr+"."+datastore['DOMAIN']
begin begin
res = send_request_cgi({ res = send_request_cgi({
'uri' => datastore['PATH'], 'uri' => datastore['PATH'],
'vars_get' => tquery, 'vars_get' => tquery,
'headers' => thead, 'headers' => thead,
'vhost' => thost, 'vhost' => thost,
'method' => 'GET', 'method' => 'GET',
'ctype' => 'text/plain' 'ctype' => 'text/plain'
}, 20) }, 20)
if res and noexistsres if res and noexistsres
if res.body != noexistsres.body if res.body != noexistsres.body
print_status("[#{ip}] Vhost found #{thost} ") print_status("[#{ip}] Vhost found #{thost} ")
report_note( report_note(
:host => ip, :host => ip,
:proto => 'HTTP', :proto => 'HTTP',
@ -128,19 +129,20 @@ require 'cgi'
:type => 'VHOST', :type => 'VHOST',
:data => "#{thost}" :data => "#{thost}"
) )
else else
print_status("NOT Found #{thost}") print_status("NOT Found #{thost}")
end end
else else
print_status("[#{ip}] NO Response") print_status("[#{ip}] NO Response")
end end
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout
rescue ::Timeout::Error, ::Errno::EPIPE rescue ::Timeout::Error, ::Errno::EPIPE
end end
end end
end end
end end