如何在php中通过ldap获取活动目录的密码?

发布于 2024-10-16 17:19:28 字数 183 浏览 1 评论 0原文

我在 Active Directory 中遇到密码问题。 我想从用户的“用户名”获取密码 我尝试了“ldap_search”功能,但没有找到正确的密码属性 我尝试过:password、userpassword、userPassword、unicodePwd、unicodepwd,但它们不正确。

我期待着大家的帮助 谢谢大家:D 坦率地

I have problem about password in Active Directory.
I want to get password from "username" of user
I tried function "ldap_search", but I do not find correctly attribute for password
I tried as: password, userpassword, userPassword, unicodePwd, unicodepwd, but they are not correct.

I look forward to helping of everyone
Thanks for all :D
trankinhly

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

小梨窩很甜 2024-10-23 17:19:28

Active Directory 中的密码不可检索。它们也不在大多数目录中。 (eDirectory 有一个密码策略,如果您绑定为指定用户,则可以通过 LDAP 扩展检索密码)

某些目录可能允许您恢复散列版本,但这也不是那么好。

为了跨平台,最好尝试使用提供的值进行绑定,要么成功,要么失败。此外,LDAP 表示使用空白密码的绑定实际上是匿名绑定,这可能会成功,因此您需要过滤这种情况。

一旦绑定为用户,您就可以查看他们的组成员身份(因为通常他们可以看到自己的组成员身份)或查看其他一些属性,如果他们可以读取这些属性,则意味着他们拥有一定级别的权限。 (即实施授权和身份验证)。

Passwords in Active Directory are not retrievable. Nor are they in most directories. (eDirectory has a password policy, that if you bind as the specified user, then you can retrieve passwords via LDAP extensions)

Some directories might let you recover the hashed versions, but that is not that great either.

To be cross platform, it is better to try and bind with the values provided and either succeed or fail. Additionally, LDAP says a bind with a blank password is actually an anonymous bind, which will probably succeed, so you need to filter for that case.

Once bound as the user, you could look at their group memberships (since usually they can see their own) or look at some other attribute, which if they can read it, means they have some level of rights. (I.e. Implement authorization as well as authentication).

萌逼全场 2024-10-23 17:19:28

我刚刚查询了在 MS-Windows Server 2003 上运行的 Active Directory(在 Ubuntu 10.04 中使用 ldapsearch),似乎只能检索到以下内容,并注意密码不存在。

givenName
distinguishedName
instanceType
whenCreated
whenChanged
displayName
uSNCreated
memberOf
uSNChanged
name
objectGUID
userAccountControl
badPwdCount
codePage
countryCode
badPasswordTime
lastLogoff
lastLogon
pwdLastSet
primaryGroupID
objectSid
accountExpires
logonCount
sAMAccountName
sAMAccountType
userPrincipalName

您还可以参考:

I just queried an Active Directory (using ldapsearch in Ubuntu 10.04) running on a MS-Windows Server 2003, and it seem only the following can be retrieved and note that the password is not there.

givenName
distinguishedName
instanceType
whenCreated
whenChanged
displayName
uSNCreated
memberOf
uSNChanged
name
objectGUID
userAccountControl
badPwdCount
codePage
countryCode
badPasswordTime
lastLogoff
lastLogon
pwdLastSet
primaryGroupID
objectSid
accountExpires
logonCount
sAMAccountName
sAMAccountType
userPrincipalName

You may also refer:

神也荒唐 2024-10-23 17:19:28

AD 不以纯文本形式存储密码。密码哈希值存储在 unicodePwd 中。该属性只能使用 ldapi 接口检索。常规 ldap_search 不会返回任何内容。

AD does not store the password in plain text. The password hash is stored in unicodePwd. This attribute can be only retrieved using ldapi interface. The regular ldap_search will not return anything.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文