diff --git a/lib/msf/core/exploit/http/client.rb b/lib/msf/core/exploit/http/client.rb index f13b1d926a..793c5c34e1 100644 --- a/lib/msf/core/exploit/http/client.rb +++ b/lib/msf/core/exploit/http/client.rb @@ -312,12 +312,12 @@ module Exploit::Remote::HttpClient end end - # Returns the complete URI including the scheme and host + # Returns the complete URI as string including the scheme, port and host def full_uri uri_scheme = ssl ? 'https' : 'http' - # check if target_uri starts with a / - uri = target_uri.to_s =~ /^\// ? target_uri : "/#{target_uri}" - "#{uri_scheme}://#{rhost}#{uri}" + uri_port = rport.to_s == '80' ? '' : ":#{rport}" + uri = normalize_uri(target_uri.to_s) + "#{uri_scheme}://#{rhost}#{uri_port}#{uri}" end # diff --git a/lib/msf/http/typo3/uris.rb b/lib/msf/http/typo3/uris.rb index 40de8f1255..b699240a59 100644 --- a/lib/msf/http/typo3/uris.rb +++ b/lib/msf/http/typo3/uris.rb @@ -5,14 +5,14 @@ module Msf::HTTP::Typo3::URIs # # @return [String] Typo3 Login URL def typo3_url_login - normalize_uri(target_uri.path, '/typo3/', 'index.php') + normalize_uri(target_uri.path, 'typo3', 'index.php') end # Returns the Typo3 backend URL # # @return [String] Typo3 Backend URL def typo3_url_backend - normalize_uri(target_uri.path, '/typo3/', 'backend.php') + normalize_uri(target_uri.path, 'typo3', 'backend.php') end end diff --git a/modules/auxiliary/scanner/http/typo3_bruteforce.rb b/modules/auxiliary/scanner/http/typo3_bruteforce.rb index 60edaac36b..9e45222c0c 100644 --- a/modules/auxiliary/scanner/http/typo3_bruteforce.rb +++ b/modules/auxiliary/scanner/http/typo3_bruteforce.rb @@ -39,11 +39,11 @@ class Metasploit3 < Msf::Auxiliary end each_user_pass { |user, pass| - enum_user(user,pass) + try_login(user,pass) } end - def enum_user(user, pass) + def try_login(user, pass) vprint_status("#{peer} - Trying username:'#{user}' password: '#{pass}'") cookie = typo3_backend_login(user, pass) if cookie