Show IP for print_*

bug/bundler_fix
wchen-r7 2016-05-24 14:12:54 -05:00
parent 3bc020178f
commit ff4d150449
2 changed files with 13 additions and 13 deletions

View File

@ -691,7 +691,7 @@ module Msf
def on_request_uri(cli, request)
# Check if target is on our whitelist
if @whitelist && !is_ip_targeted?(cli.peerhost)
print_status("Client is trying to connect but not on our whitelist.")
print_status("Client #{cli.peerhost} is trying to connect but not on our whitelist.")
send_not_found(cli)
return
end
@ -755,7 +755,7 @@ module Msf
return datastore['HTMLContent']
end
elsif exploit_list.empty?
print_status("No suitable exploits to send.")
print_status("No suitable exploits to send for #{cli.peerhost}")
if datastore['HTMLContent'].blank?
send_not_found(cli)
return ''

View File

@ -271,12 +271,12 @@ module Msf
if tag.blank?
# Browser probably doesn't allow cookies, plan B :-/
vprint_status("No cookie received, resorting to headers hash.")
vprint_status("No cookie received for #{cli.peerhost}, resorting to headers hash.")
ip = cli.peerhost
os = request.headers['User-Agent']
tag = Rex::Text.md5("#{ip}#{os}")
else
vprint_status("Received cookie '#{tag}'.")
vprint_status("Received cookie '#{tag}' from #{cli.peerhost}")
end
tag
@ -303,7 +303,7 @@ module Msf
when :script
# Gathers target data from a POST request
parsed_body = CGI::parse(Rex::Text.decode_base64(request.body) || '')
vprint_status("Received sniffed browser data over POST:")
vprint_status("Received sniffed browser data over POST from #{cli.peerhost}")
vprint_line("#{parsed_body}.")
parsed_body.each { |k, v| profile[k.to_sym] = (v.first == 'null' ? nil : v.first) }
found_ua_name = parsed_body['ua_name']
@ -549,15 +549,15 @@ module Msf
return
end
print_status("Gathering target information.")
print_status("Gathering target information for #{cli.peerhost}")
tag = Rex::Text.rand_text_alpha(rand(20) + 5)
ua = request.headers['User-Agent'] || ''
print_status("Sending HTML response.")
print_status("Sending HTML response to #{cli.peerhost}")
html = get_detection_html(ua)
send_response(cli, html, {'Set-Cookie' => cookie_header(tag)})
when /#{@flash_swf}/
vprint_status("Sending SWF used for Flash detection")
vprint_status("Sending SWF used for Flash detection to #{cli.peerhost}")
swf = load_swf_detection
send_response(cli, swf, {'Content-Type'=>'application/x-shockwave-flash', 'Cache-Control' => 'no-cache, no-store', 'Pragma' => 'no-cache'})
@ -565,7 +565,7 @@ module Msf
#
# The detection code will hit this if Javascript is enabled
#
vprint_status "Info receiver page called."
vprint_status "Info receiver page called from #{cli.peerhost}"
process_browser_info(:script, cli, request)
send_response(cli, '', {'Set-Cookie' => cookie_header(tag)})
@ -583,13 +583,13 @@ module Msf
# on_request_exploit() to get the target information
#
tag = retrieve_tag(cli, request)
vprint_status("Serving exploit to user with tag #{tag}")
vprint_status("Serving exploit to user #{cli.peerhost} with tag #{tag}")
profile = browser_profile[tag]
if profile.nil?
print_status("Browsing directly to the exploit URL is forbidden.")
print_status("Browsing visiting directly to the exploit URL is forbidden.")
send_not_found(cli)
elsif profile[:tried] && !datastore['Retries']
print_status("Target with tag \"#{tag}\" wants to retry the module, not allowed.")
print_status("Target #{cli.peerhost} with tag \"#{tag}\" wants to retry the module, not allowed.")
send_not_found(cli)
else
profile[:tried] = true
@ -618,7 +618,7 @@ module Msf
end
else
print_error("Target has requested an unknown path: #{request.uri}")
print_error("Target #{cli.peerhost} has requested an unknown path: #{request.uri}")
send_not_found(cli)
end
end