Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query against port 389 of Microsoft Active Directory gets flummoxed by referrals #4

Open
basezen opened this issue May 28, 2021 · 0 comments

Comments

@basezen
Copy link

basezen commented May 28, 2021

INVALIDATED This repository is out of date and has been subsumed into the main project.

Queries on port 389 using the AD domain as the base (not an inner OU) result in referrals returned by AD along with the valid answer. Referrals are chased down by default, but this causes a failure even though all the necessary attributes have been returned: the useless referral queries, unbound to the original DN, fail and cause a cascading failure.

Queries on port 3268 are not necessarily viable because the Global Catalog view does not include the necessary Unix attributes.

The logged result is vague:

LDAP search use DN 'DC=ad,DC=example,DC=com', filter '(&(objectClass=user)([email protected]))' failed: Operations error

On the command line:

ldapsearch -x -H ldap://example.com:389 -D '...' -w '...' -b 'dc=ad,dc=example,dc=com' -s sub '(userPrincipalName=...)'

# User info
dn: CN=...,DC=ad,DC=example,DC=com
userPrincipalName: ...@...
_all necessary info_

# search reference
ref: ldap://ForestDnsZones.ad.example.com/DC=ForestDnsZones,DC=ad,DC=example,DC=com

# search reference
ref: ldap://DomainDnsZones.ad.example.com/DC=DomainDnsZones,DC=ad,DC=basezen,DC=com

# search reference
ref: ldap://ad.example.com/CN=Configuration,DC=ad,DC=example,DC=com

Referencing https://linux.die.net/man/3/ldap_set_option I believe we need LDAP_OPT_REFERRALS off.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant