Change the HOST IP logic again

bug/bundler_fix
wchen-r7 2015-07-14 14:15:32 -05:00
parent 9980e8f285
commit 8efb4df8af
1 changed files with 10 additions and 1 deletions

View File

@ -654,7 +654,16 @@ module Msf
exploit_list.each do |mod|
proto = datastore['SSL'] ? 'https' : 'http'
host = datastore['URIHOST'] || datastore['SRVHOST'] || Rex::Socket.source_address
host = ''
if datastore['URIHOST']
host = datastore['URIHOST']
elsif cli
host = cli.peerhost
elsif datastore['SRVHOST'] != '0.0.0.0'
host = datastore['SRVHOST']
else
host = Rex::Socket.source_address
end
port = datastore['SRVPORT']
resource = mod.datastore['URIPATH']
url = "#{proto}://#{host}:#{port}#{resource}"