gpt4 book ai didi

security - LogonUser 对于已禁用的帐户返回 true

转载 作者:行者123 更新时间:2023-12-02 21:15:32 24 4
gpt4 key购买 nike

我正在打电话LogonUser尝试验证一组凭据:

LogonUser("forest", "avatopia.com" "stapler", 
LOGON32_LOGON_NETWORK, LOGON32_PROVIDER_WINNT50, out token);

即使帐户已禁用,它也会返回true:

enter image description here

<小时/>

i also tried using SSPI directly to validate credentials, which involves calling:

  • AcquireCredentialsHandle(..., "Negotiate", SECPKG_CRED_OUTBOUND, ..., ["forest", "stapler", "avatopia.com"], ...)
  • InitializeSecurityContext(...)
  • AcquireCredentialsHandle(..., "Negotiate", SECPKG_CRED_INBOUND, ...)
  • AcceptSecurityContext(...)
  • InitializeSecurityContext(...)
  • AcceptSecurityContext(...)

On most machines the initial call to AcquireCredentialsHandle fails if the user account is disabled. But on this particular machine i'm testing it completes the entire cycle and works.

<小时/>

如果我尝试使用无效密码,则LogonUser会(正确)失败:

LogonUser("forest", "avatopia.com" "adf342sdf3", 
LOGON32_LOGON_NETWORK, LOGON32_PROVIDER_WINNT50, out token);

返回falseGetLastError返回1326(登录失败:未知的用户名或密码)

Trying SSPI with an invalid password also (correctly) fails:

  • AcquireCredentialsHandle(..., "Negotiate", SECPKG_CRED_OUTBOUND, ..., ["forest", "adf342sdf3", "avatopia.com"], ...)
  • InitializeSecurityContext(...)
  • AcquireCredentialsHandle(..., "Negotiate", SECPKG_CRED_INBOUND, ...)
  • AcceptSecurityContext(...) fails with 8009030C (The logon attempt failed)

令人恼火的是,这种行为只发生在一台机器上。

为什么 LogonUser 以及整个安全支持提供商界面表明特定加入域的计算机上已禁用帐户的凭据有效?

  • LogonUser(错误)成功加入域的计算机:Windows XP SP2
  • LogonUser(正确)失败的已加入域的计算机:Windows XP SP2
<小时/>

更新:

没有名为 Forest 的本地用户:

enter image description here

也没有任何名为 Forest 的本地用户:

enter image description here

这无关紧要,因为我要求的是 avatopia.com\Forest,而不是 speeder\Forest

oi vay人们只是因为禁用用户被允许访问他们不应该被允许访问的东西而把他们的内裤弄成一堆。

最佳答案

我同意卢克的观点,很可能它正在使用缓存的凭据。能够 ping 通域 Controller 并不意味着它能够正确地与其通信。

您可以尝试的一项测试是使用该森林阿甘正传帐户登录该计算机。是的,您可能需要授予他交互式登录权限才能执行此操作,但这只是出于故障排除目的。

为了证明这是由于凭据缓存问题造成的,您可以做的另一件事是捕获域 Controller 和计算机之间的网络流量。查看是否有任何 NTLM 或 Kerberos 流量。默认情况下,它应该使用 Kerberos 与 KDC 通信。如果失败,它应该使用 NTLM 与 NetLogon 服务器通信。

如果凭据缓存是真正的问题,我怀疑您可以通过在 AcquireCredentialsHandle 调用中使用“kerberos”而不是“协商”来简单地修复它。

关于security - LogonUser 对于已禁用的帐户返回 true,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9771625/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com