make protocolstate.IsHostAllowed check the domaincontroller, not the domain

This commit is contained in:
5amu 2024-01-20 00:39:29 +01:00
parent 44745cb0c9
commit a167e6c57b

View File

@ -55,9 +55,9 @@ func (c *LdapClient) CollectLdapMetadata(domain string, controller string) (LDAP
domainController: controller,
}
if !protocolstate.IsHostAllowed(domain) {
if !protocolstate.IsHostAllowed(controller) {
// host is not valid according to network policy
return LDAPMetadata{}, protocolstate.ErrHostDenied.Msgf(domain)
return LDAPMetadata{}, protocolstate.ErrHostDenied.Msgf(controller)
}
conn, err := c.newLdapSession(opts)
@ -230,9 +230,9 @@ func (c *LdapClient) GetKerberoastableUsers(domain, controller string, username,
password: password,
}
if !protocolstate.IsHostAllowed(domain) {
if !protocolstate.IsHostAllowed(controller) {
// host is not valid according to network policy
return nil, protocolstate.ErrHostDenied.Msgf(domain)
return nil, protocolstate.ErrHostDenied.Msgf(controller)
}
conn, err := c.newLdapSession(opts)