exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

HTTP Virtual Host Brute Force Scanner

HTTP Virtual Host Brute Force Scanner
Posted Sep 1, 2024
Authored by Jay Turla | Site metasploit.com

This Metasploit module tries to identify unique virtual hosts hosted by the target web server.

tags | exploit, web
SHA-256 | 08261c4bf0143e0854d3c619351a9f5b6242b7465c1d0622634759ab8be05d9f

HTTP Virtual Host Brute Force Scanner

Change Mirror Download
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##


#
# May I reuse some methods?
#
require 'cgi'



class MetasploitModule < Msf::Auxiliary

include Msf::Exploit::Remote::HttpClient
include Msf::Auxiliary::WmapScanServer
include Msf::Auxiliary::Scanner
include Msf::Auxiliary::Report


def initialize(info = {})
super(update_info(info,
'Name' => 'HTTP Virtual Host Brute Force Scanner',
'Description' => %q{
This module tries to identify unique virtual hosts
hosted by the target web server.

},
'Author' => [ 'et [at] cyberspace.org' ],
'License' => BSD_LICENSE))

register_options(
[
OptString.new('PATH', [ true, "The PATH to use while testing", '/']),
OptString.new('QUERY', [ false, "HTTP URI Query", '']),
OptString.new('DOMAIN', [ true, "Domain name", '']),
OptString.new('HEADERS', [ false, "HTTP Headers", '']),
OptPath.new('SUBDOM_LIST', [false, "Path to text file with subdomains"]),
])

end

def run_host(ip)
if datastore['SUBDOM_LIST'] and ::File.file?(datastore['SUBDOM_LIST'])
valstr = IO.readlines(datastore['SUBDOM_LIST']).map {
|e| e.gsub(".#{datastore['DOMAIN']}", "").chomp
}
else
valstr = [
"admin",
"services",
"webmail",
"console",
"apps",
"mail",
"intranet",
"intra",
"spool",
"corporate",
"www",
"web"
]
end

datastore['QUERY'] ? tquery = queryparse(datastore['QUERY']): nil
datastore['HEADERS'] ? thead = headersparse(datastore['HEADERS']) : nil

noexistsres = nil
resparr = []

2.times do |n|

randhost = Rex::Text.rand_text_alpha(5)+"."+datastore['DOMAIN']


begin
noexistsres = send_request_cgi({
'uri' => normalize_uri(datastore['PATH']),
'vars_get' => tquery,
'headers' => thead,
'vhost' => randhost,
'method' => 'GET',
'ctype' => 'text/plain'
}, 20)

print_status("[#{ip}] Sending request with random domain #{randhost} ")

if noexistsres
resparr[n] = noexistsres.body
end

rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout
rescue ::Timeout::Error, ::Errno::EPIPE
end
end

if resparr[0] != resparr[1]
print_error("[#{ip}] Unable to identify error response")
return
end

vprint_status("Running with #{valstr.length} sudomains")
valstr.each do |astr|
thost = astr+"."+datastore['DOMAIN']

begin
res = send_request_cgi({
'uri' => normalize_uri(datastore['PATH']),
'vars_get' => tquery,
'headers' => thead,
'vhost' => thost,
'method' => 'GET',
'ctype' => 'text/plain'
}, 20)


if res and noexistsres

if res.body != noexistsres.body
print_good("[#{ip}] Vhost found #{thost} ")

report_note(
:host => ip,
:proto => 'tcp',
:sname => (ssl ? 'https' : 'http'),
:port => rport,
:type => 'VHOST',
:data => thost,
:update => :unique_data
)

else
vprint_status("NOT Found #{thost}")
end
else
print_status("[#{ip}] NO Response")
end

rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout
rescue ::Timeout::Error, ::Errno::EPIPE
end

end

end
end
Login or Register to add favorites

File Archive:

September 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Sep 1st
    261 Files
  • 2
    Sep 2nd
    17 Files
  • 3
    Sep 3rd
    38 Files
  • 4
    Sep 4th
    52 Files
  • 5
    Sep 5th
    0 Files
  • 6
    Sep 6th
    0 Files
  • 7
    Sep 7th
    0 Files
  • 8
    Sep 8th
    0 Files
  • 9
    Sep 9th
    0 Files
  • 10
    Sep 10th
    0 Files
  • 11
    Sep 11th
    0 Files
  • 12
    Sep 12th
    0 Files
  • 13
    Sep 13th
    0 Files
  • 14
    Sep 14th
    0 Files
  • 15
    Sep 15th
    0 Files
  • 16
    Sep 16th
    0 Files
  • 17
    Sep 17th
    0 Files
  • 18
    Sep 18th
    0 Files
  • 19
    Sep 19th
    0 Files
  • 20
    Sep 20th
    0 Files
  • 21
    Sep 21st
    0 Files
  • 22
    Sep 22nd
    0 Files
  • 23
    Sep 23rd
    0 Files
  • 24
    Sep 24th
    0 Files
  • 25
    Sep 25th
    0 Files
  • 26
    Sep 26th
    0 Files
  • 27
    Sep 27th
    0 Files
  • 28
    Sep 28th
    0 Files
  • 29
    Sep 29th
    0 Files
  • 30
    Sep 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close