diff --git a/lib/msf/core/auxiliary/crawler.rb b/lib/msf/core/auxiliary/crawler.rb index 13f76a1a4e..6694533d25 100644 --- a/lib/msf/core/auxiliary/crawler.rb +++ b/lib/msf/core/auxiliary/crawler.rb @@ -111,10 +111,11 @@ module Auxiliary::HttpCrawler :pass => datastore['BasicAuthPass'], :info => "" }) - + t[:site] = report_web_site(:wait => true, :host => t[:host], :port => t[:port], :vhost => t[:vhost], :ssl => t[:ssl]) print_status("Crawling #{t.to_url}...") + begin @current_vhost = t[:vhost] @current_site = t[:site] diff --git a/lib/msf/core/db.rb b/lib/msf/core/db.rb index aec68c8da2..7812b2536c 100644 --- a/lib/msf/core/db.rb +++ b/lib/msf/core/db.rb @@ -1330,6 +1330,9 @@ class DBManager if not (addr and port) raise ArgumentError, "report_web_site requires service OR host/port/ssl" end + + # Force addr to be the address and not hostname + addr = Rex::Socket.getaddress(addr) end ret = {} diff --git a/modules/auxiliary/scanner/http/crawler.rb b/modules/auxiliary/scanner/http/crawler.rb index b78f3a820c..4c281c7782 100644 --- a/modules/auxiliary/scanner/http/crawler.rb +++ b/modules/auxiliary/scanner/http/crawler.rb @@ -48,7 +48,7 @@ class Metasploit3 < Msf::Auxiliary # - The occurence of any form (web.form :path, :type (get|post|path_info), :params) # def crawler_process_page(t, page, cnt) - msg = "[#{"%.5d" % cnt}/#{"%.5d" % max_page_count}] #{page.code || "ERR"} - #{@current_site.vhost} - #{page.url}" + msg = "[#{"%.5d" % cnt}/#{"%.5d" % max_page_count}] #{page.code || "ERR"} - #{t[:vhost]} - #{page.url}" case page.code when 301,302 if page.headers and page.headers["location"] @@ -74,7 +74,7 @@ class Metasploit3 < Msf::Auxiliary # info = { - :web_site => @current_site, + :web_site => t[:site], :path => page.url.path, :query => page.url.query, :code => page.code, @@ -122,7 +122,7 @@ class Metasploit3 < Msf::Auxiliary # Continue processing forms # forms = [] - form_template = { :web_site => @current_site } + form_template = { :web_site => t[:site] } form = {}.merge(form_template) # This page has a query parameter we can test with GET parameters