Skip to content

Commit c243125

Browse files
committed
Land rapid7#18379, Improve ccache hostname matching
The service authenticator was filtering out valid credentials when the hostname wasnt an exact match when credentials for a domain should work on a subdomaini. This PR fixes that issue.
2 parents d8f36d6 + 6a04f5e commit c243125

File tree

1 file changed

+3
-1
lines changed
  • lib/msf/core/exploit/remote/kerberos/service_authenticator

1 file changed

+3
-1
lines changed

lib/msf/core/exploit/remote/kerberos/service_authenticator/base.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -1047,7 +1047,9 @@ def load_credential_from_file(file_path, options = {})
10471047
next
10481048
end
10491049

1050-
unless !sname_hostname || sname_hostname.to_s.casecmp?(credential.server.components[1])
1050+
unless !sname_hostname ||
1051+
sname_hostname.to_s.downcase == credential.server.components[1] ||
1052+
sname_hostname.to_s.downcase.ends_with?('.' + credential.server.components[1])
10511053
wlog("Filtered credential #{file_path} ##{index} reason: SPN (#{sname_hostname}) hostname does not match (spn: #{credential.server.components.snapshot.join('/')})")
10521054
next
10531055
end

0 commit comments

Comments
 (0)