Stale or Inactive Accounts Enabled

User or computer accounts that have not been used for a long time remain enabled, leaving unmonitored accounts that an attacker could take over.

SeverityLow
CVSS 3.13.7 CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N Open in the calculator
CVSS 4.06.3 CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N Open in the calculator
CWECWE-286: Incorrect User Management
OWASP Top 10A06:2025 Insecure Design
MITRE ATT&CKT1078.002 Domain Accounts, T1110.003 Password Spraying
CategorySecurity Misconfiguration

Description

Accounts that are no longer used remain enabled in Active Directory: accounts of staff who have left or changed role, test and temporary accounts, accounts that were created but never used, and computer accounts for machines that have been retired. Because nobody uses them, their passwords are often old, set to a known initial value, or still known to former staff and suppliers, and activity on them is unlikely to be noticed.

Such an account therefore gives an attacker a way in that is less likely to be noticed than a live user's account, and old and initial passwords are good candidates for password spraying. Once in, the attacker has the account's access, which may include group memberships and rights that were never removed, and can use the account to keep access over time. Stale computer accounts carry less risk, but each is another credential that can authenticate to the domain. The rating reflects that the attacker must still obtain or guess the password.

Inactive accounts are identified from the lastLogonTimestamp attribute, which any domain user can read, together with pwdLastSet and the date the account was created. lastLogonTimestamp is replicated between domain controllers but by default is only updated when the stored value is more than 9 to 14 days old, so it is accurate to within about two weeks; the lastLogon attribute is exact but is not replicated and must be read from every domain controller. Accounts with no sign-in for 90 days or more are commonly reported, although the threshold should follow the organisation's own policy. Search-ADAccount -AccountInactive, PingCastle and BloodHound list them.

Remediation

  • Disable user and computer accounts that have not signed in within the period set by policy, commonly 90 days, after confirming with their owners, and delete them after a further retention period. Moving disabled accounts to a separate organisational unit makes them easier to manage.
  • Link account management to the joiners, movers and leavers process, so that accounts are disabled on a leaver's last day, and give contractor and temporary accounts an expiry date (Set-ADAccountExpiration).
  • Record an owner for every service, test and shared account and review them regularly. Service accounts can show little sign-in activity while still in use, so confirm before disabling them.
  • Alert on successful sign-ins to accounts that have been inactive, which is a common sign of misuse.

Automate the review, for example with a scheduled report of inactive accounts that are still enabled:

Search-ADAccount -AccountInactive -TimeSpan 90.00:00:00 | Where-Object Enabled | Select-Object Name, ObjectClass, LastLogonDate

Confirm the fix by running the inactivity query again and checking that no enabled account exceeds the threshold without a documented reason.

References


Add This Finding to Your Library

In Pental this write-up is in Settings, Library. Add to my library copies it into your own, rated in your firm's CVSS version, ready to put in your own words.

Free trial  ·  No card required

Only need the reporting? Our reporting tool is free and open source, with the same library.


More Active Directory Findings

Every Active Directory finding