Skip to content

Commit 1992a56

Browse files
committed
Make up our damn mind
1 parent d64f4be commit 1992a56

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/msf/core/exploit/browser_autopwnv2.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,7 @@ def start_service
563563
proto = (datastore['SSL'] ? "https" : "http")
564564
srvhost = (datastore['SRVHOST'] == '0.0.0.0') ? Rex::Socket.source_address : datastore['SRVHOST']
565565
srvport = datastore['SRVPORT']
566+
port = datastore['URIPORT'] == 0 ? datastore['SRVPORT'] : datastore['URIPORT']
566567
service_uri = "#{proto}://#{srvhost}:#{srvport}#{get_resource}"
567568
print_status("Please use the following URL for the browser attack:")
568569
print_status("BrowserAutoPwn URL: #{service_uri}")
@@ -654,15 +655,15 @@ def get_exploit_urls(cli, request)
654655

655656
exploit_list.each do |mod|
656657
proto = datastore['SSL'] ? 'https' : 'http'
658+
# We haven't URIHOST and URIPORT into account here because
659+
# the framework uses them only on `get_uri`
657660
host = ''
658-
if datastore['URIHOST']
659-
host = datastore['URIHOST']
660-
elsif datastore['SRVHOST'] && datastore['SRVHOST'] != '0.0.0.0'
661+
if datastore['SRVHOST'] && datastore['SRVHOST'] != '0.0.0.0'
661662
host = datastore['SRVHOST']
662663
else
663664
host = Rex::Socket.source_address
664665
end
665-
port = datastore['URIPORT'] == 0 ? datastore['SRVPORT'] : datastore['URIPORT']
666+
port = datastore['SRVPORT']
666667
resource = mod.datastore['URIPATH']
667668
url = "#{proto}://#{host}:#{port}#{resource}"
668669
urls << url

0 commit comments

Comments
 (0)