Detecting Fake Active Directory Password Changes
好的,我现在需要帮用户总结一篇文章的内容,控制在100个字以内。首先,我得仔细阅读这篇文章,理解它的主要观点。 文章讲的是Active Directory中一种叫做“fake password change”的方法。这种方法通过修改pwdLastSet属性,让账户看起来密码最近被更改过,但实际上密码并没有变。作者提到他曾在2015年的演讲中讨论过这个问题。 接下来,文章解释了为什么会发生这种情况。当服务账户或管理员账户需要更改密码时,有些人可能不想做实际的工作,于是就通过这种方法来欺骗系统。这需要对pwdLastSet属性有修改权限。 然后,文章详细说明了这个方法的工作原理。通过勾选“User must change password at next logon”选项并应用,可以清空pwdLastSet的值,使其看起来像是从未设置过密码。取消勾选后,pwdLastSet会被设置为当前日期和时间,而实际密码并未改变。 最后,文章提供了检测这种假密码更改的方法。通过检查unicodePwd和pwdLastSet属性的最后修改时间,可以发现密码是否真的被更改过。作者还提供了一个PowerShell脚本来大规模检测这种情况。 总结一下,文章主要介绍了如何在Active Directory中进行假密码更改,并解释了其工作原理和检测方法。用户可能需要一个简洁的中文摘要来快速了解内容。 </think> 文章介绍了一种在Active Directory中通过修改`pwdLastSet`属性实现“假密码更改”的方法,即账户看似有新密码但实际未更改,并详细说明了其工作原理、检测方式及提供了一个PowerShell脚本用于大规模检测此类问题。 2026-3-3 01:17:0 Author: adsecurity.org(查看原文) 阅读量:34 收藏

Mar 02 2026

There has been a method that’s been around for many years which changes the password last set date but not the actual password. This is what I call a “fake password change” since the account appears to have a recent password when scanning for old passwords based on password last set, but the underlying password hasn’t actually changed.
I spoke about this in my 2015 BSides Charm talk which was my first conference talk.

Why does this happen?
There are times where service account (or admin accounts) need to have password changes, but someone doesn’t want to do the work to change them. The ability to fake a password change requires modify rights on the pwdLastSet attribute which provides the ability to check/uncheck the setting “User must change password at next logon”. This setting is enabled when you want the user to change their own password when they logon.

The attribute pwdLastSet controls both:

  • Whether the user is forced to change their password at next logon (pwdLastSet = 0)
  • Whether the flag is cleared (pwdLastSet = -1 or any non‑zero timestamp)


How does this work?

To see how this works, we’ll focus on the service account “svcAGPM” in my lab. This account last changed its password on July 31st in 2025.


We open up Active Directory Users and Computers (ADUC), double-click on it to open up the account properties and then click on the Account tab.
From here we check the box for “User must change password at next logon” and click Apply.


What happens to the PasswordLastSet date when this happens?
It is now blank.  Which makes it seem like the account has never had a password set.


We continue with our process where we uncheck the box we checked and then click Apply.


After performing this action, we can see that the password change date has now been set to the current date and time even though the password itself hasn’t been changed since July 2025.

Why does this happen?

This happens because the “User must change password at next logon” option is used to force a user to change their password at next logon. With it checked, Active Directory is waiting for the user to attempt to logon which is when the user is directed to change their password. During this time the PasswordLastSet value is blank since it is waiting for a new password. Once the user changes their password, the checkbox is effectively removed and the current date and time are set for the user’s passwordlastset property (technically this is the “pwdlastset” attribute, but the AD PowerShell cmdlets use that property).

How can we detect a fake password change?

In order to detect a fake password change we need to figure out how this works on a Domain Controller. We have already identified that the pwdlastset attribute is what shows the date the password is last set. We have to look at another attribute called unicodePwd which is used to store the account’s password on the Domain Controller.

We can use the Active Directory PowerShell module cmdlet “Get-ADReplicationAttributeMetadata” to get AD replication metadata about the account. Running this cmdlet provides the following replication metadata about the account that continues beyond the screenshot.


Let’s scope this down to the 2 attributes that we care about, unicodepwd and pwdlastset.


The attribute we care about in this output is “LastOriginatingChangeTime”. I have highlighted the values for this attribute in the following screenshot.


Here we can clearly see that while the pwdlastset date is 2/26/2026, the date for unicodepwd remains 7/31/2025. This means that the password hasn’t changed, only the value that’s supposed to show when it has last changed.

Detect fake Active Directory password changes at scale

I wrote a PowerShell script that will scan either the Active Directory Admins or all users in the domain to see if there’s a fake password change that has been performed on them.
https://github.com/PyroTek3/ActiveDirectory/blob/main/Get-FakePWChanges.ps1

Note that there may be scenarios where an account could be flagged but an admin wasn’t responsible for faking the password change. This does identify when a password shows it changed, but actually has not.

(Visited 31 times, 31 visits today)

Sean Metcalf

I improve security for enterprises around the world working for TrustedSec & I am @PyroTek3 on Twitter.
Read the About page (top left) for information about me. :)
https://adsecurity.org/?page_id=8


文章来源: https://adsecurity.org/?p=4969
如有侵权请联系:admin#unsafe.sh