Skip to content

Commit 8efb4df

Browse files
committed
Change the HOST IP logic again
1 parent 9980e8f commit 8efb4df

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

lib/msf/core/exploit/browser_autopwnv2.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,16 @@ def get_exploit_urls(cli, request)
654654

655655
exploit_list.each do |mod|
656656
proto = datastore['SSL'] ? 'https' : 'http'
657-
host = datastore['URIHOST'] || datastore['SRVHOST'] || Rex::Socket.source_address
657+
host = ''
658+
if datastore['URIHOST']
659+
host = datastore['URIHOST']
660+
elsif cli
661+
host = cli.peerhost
662+
elsif datastore['SRVHOST'] != '0.0.0.0'
663+
host = datastore['SRVHOST']
664+
else
665+
host = Rex::Socket.source_address
666+
end
658667
port = datastore['SRVPORT']
659668
resource = mod.datastore['URIPATH']
660669
url = "#{proto}://#{host}:#{port}#{resource}"

0 commit comments

Comments
 (0)