Land #16668, HTTP Crawler: don't expect page object for msg

This commit is contained in:
Grant Willcox 2022-07-21 18:35:35 -05:00
commit abe90c1089
No known key found for this signature in database
GPG Key ID: D35E05C0F2B81E83
2 changed files with 4 additions and 2 deletions

View File

@ -243,7 +243,8 @@ module Auxiliary::HttpCrawler
# Specific module implementations should redefine this method
# with whatever is meaningful to them.
def crawler_process_page(t, page, cnt)
msg = "[#{"%.5d" % cnt}/#{"%.5d" % max_page_count}] #{page.code || "ERR"} - #{@current_site.vhost} - #{page.url}"
return if page.nil? # Skip over pages that don't contain any info aka page is nil. We can't process these types of pages since there is no data to process.
msg = "[#{"%.5d" % cnt}/#{"%.5d" % max_page_count}] #{page ? page.code || "ERR" : "ERR"} - #{@current_site.vhost} - #{page.url}"
case page.code
when 301,302
if page.headers and page.headers["location"]

View File

@ -63,7 +63,8 @@ class MetasploitModule < 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"} - #{t[:vhost]} - #{page.url}"
return if page.nil? # Skip over pages that don't contain any info aka page is nil. We can't process these types of pages since there is no data to process.
msg = "[#{"%.5d" % cnt}/#{"%.5d" % max_page_count}] #{page ? page.code || "ERR" : "ERR"} - #{t[:vhost]} - #{page.url}"
if page.error
print_error("Error accessing page #{page.error.to_s}")
elog(page.error)