@@ -563,6 +563,7 @@ def start_service
563
563
proto = ( datastore [ 'SSL' ] ? "https" : "http" )
564
564
srvhost = ( datastore [ 'SRVHOST' ] == '0.0.0.0' ) ? Rex ::Socket . source_address : datastore [ 'SRVHOST' ]
565
565
srvport = datastore [ 'SRVPORT' ]
566
+ port = datastore [ 'URIPORT' ] == 0 ? datastore [ 'SRVPORT' ] : datastore [ 'URIPORT' ]
566
567
service_uri = "#{ proto } ://#{ srvhost } :#{ srvport } #{ get_resource } "
567
568
print_status ( "Please use the following URL for the browser attack:" )
568
569
print_status ( "BrowserAutoPwn URL: #{ service_uri } " )
@@ -654,15 +655,15 @@ def get_exploit_urls(cli, request)
654
655
655
656
exploit_list . each do |mod |
656
657
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`
657
660
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'
661
662
host = datastore [ 'SRVHOST' ]
662
663
else
663
664
host = Rex ::Socket . source_address
664
665
end
665
- port = datastore [ 'URIPORT' ] == 0 ? datastore [ ' SRVPORT' ] : datastore [ 'URIPORT ']
666
+ port = datastore [ 'SRVPORT' ]
666
667
resource = mod . datastore [ 'URIPATH' ]
667
668
url = "#{ proto } ://#{ host } :#{ port } #{ resource } "
668
669
urls << url
0 commit comments