Reran tests, sorted out strip problem
parent
c25a5d3859
commit
99133deabb
|
@ -51,13 +51,18 @@ class Metasploit3 < Msf::Auxiliary
|
||||||
|
|
||||||
if !res.body.nil?
|
if !res.body.nil?
|
||||||
# Very basic, just match the first title tag we come to.
|
# Very basic, just match the first title tag we come to.
|
||||||
rx = %r{<title>[\n\t\s]*(?<title>.+?)[\s\n\t]*</title>}im.match(res.body.to_s.strip)
|
rx = %r{<title>[\n\t\s]*(?<title>.+?)[\s\n\t]*</title>}im.match(res.body.to_s)
|
||||||
if rx && rx[:title] != ''
|
if rx
|
||||||
rx_title = CGI.unescapeHTML(rx[:title])
|
rx[:title].strip!
|
||||||
print_status("[#{target_host}:#{rport}] [C:#{res.code}] [R:#{location_header}] [S:#{server_header}] #{rx_title}") if datastore['SHOW_TITLES'] == true
|
if rx[:title] != ''
|
||||||
if datastore['STORE_NOTES'] == true
|
rx_title = CGI.unescapeHTML(rx[:title])
|
||||||
notedata = { code: res.code, port: rport, server: server_header, title: rx_title, redirect: location_header }
|
print_status("[#{target_host}:#{rport}] [C:#{res.code}] [R:#{location_header}] [S:#{server_header}] #{rx_title}") if datastore['SHOW_TITLES'] == true
|
||||||
report_note(host: target_host, type: "http.title", data: notedata)
|
if datastore['STORE_NOTES'] == true
|
||||||
|
notedata = { code: res.code, port: rport, server: server_header, title: rx_title, redirect: location_header }
|
||||||
|
report_note(host: target_host, type: "http.title", data: notedata)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
print_error("No webpage title from #{target_host}:#{rport}") if datastore['SHOW_ERRORS'] == true
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
print_error("No webpage title from #{target_host}:#{rport}") if datastore['SHOW_ERRORS'] == true
|
print_error("No webpage title from #{target_host}:#{rport}") if datastore['SHOW_ERRORS'] == true
|
||||||
|
|
Loading…
Reference in New Issue