Detect Password Policy Discovery in Microsoft Sentinel
Adversaries may attempt to access detailed information about the password policy used within an enterprise network or cloud environment. Password policies enforce complexity requirements that make passwords harder to guess or crack through brute force. By discovering lockout thresholds, minimum length, and complexity rules, adversaries can tailor dictionary and brute force attacks to comply with the policy — maximizing credential testing while avoiding account lockout. Discovery occurs via command-line utilities (net accounts, Get-ADDefaultDomainPasswordPolicy, chage, pwpolicy), cloud APIs (AWS GetAccountPasswordPolicy), and network device CLIs. This technique is commonly observed in the early reconnaissance phase of intrusions by groups including OilRig, Turla, and Chimera.
MITRE ATT&CK
- Tactic
- Discovery
- Technique
- T1201 Password Policy Discovery
- Canonical reference
- https://attack.mitre.org/techniques/T1201/
KQL Detection Query
let PasswordPolicyCommands = dynamic([
"net accounts",
"net.exe accounts",
"Get-ADDefaultDomainPasswordPolicy",
"Get-ADFineGrainedPasswordPolicy",
"Get-PassPol",
"pwpolicy",
"chage -l",
"chage --list",
"pam.d",
"common-password",
"pwquality",
"show aaa",
"NtdsAudit"
]);
let PasswordPolicyCmdlets = dynamic([
"Get-ADDefaultDomainPasswordPolicy",
"Get-ADFineGrainedPasswordPolicy",
"Get-ADFineGrainedPasswordPolicySubject",
"Get-PassPol"
]);
DeviceProcessEvents
| where Timestamp > ago(24h)
| where (
// net accounts and net accounts /domain
(FileName =~ "net.exe" or FileName =~ "net1.exe") and ProcessCommandLine has "accounts"
) or (
// PowerShell AD password policy cmdlets
(FileName =~ "powershell.exe" or FileName =~ "pwsh.exe") and
ProcessCommandLine has_any (PasswordPolicyCmdlets)
) or (
// CrackMapExec or other tools querying password policy via LDAP/WMI patterns
ProcessCommandLine has_any ("NtdsAudit", "--pass-pol", "--password-policy")
) or (
// Linux: chage command reading password aging info
FileName =~ "chage" and (ProcessCommandLine has "-l" or ProcessCommandLine has "--list")
) or (
// macOS: pwpolicy command
FileName =~ "pwpolicy" and ProcessCommandLine has "getaccountpolicies"
)
| extend DiscoveryMethod = case(
ProcessCommandLine has "accounts /domain" or ProcessCommandLine has "accounts", "net accounts",
ProcessCommandLine has_any ("Get-ADDefaultDomainPasswordPolicy", "Get-ADFineGrainedPasswordPolicy"), "PowerShell AD Cmdlet",
ProcessCommandLine has "Get-PassPol", "PoshC2 Get-PassPol",
ProcessCommandLine has "NtdsAudit", "NtdsAudit Utility",
ProcessCommandLine has "chage", "Linux chage",
ProcessCommandLine has "pwpolicy", "macOS pwpolicy",
ProcessCommandLine has_any ("--pass-pol", "--password-policy"), "CrackMapExec-style",
"Other"
)
| extend IsDomainQuery = ProcessCommandLine has "/domain" or ProcessCommandLine has_any ("Get-ADDefaultDomainPasswordPolicy", "Get-ADFineGrainedPasswordPolicy")
| project Timestamp, DeviceName, AccountName, AccountDomain,
FileName, ProcessCommandLine,
InitiatingProcessFileName, InitiatingProcessCommandLine,
DiscoveryMethod, IsDomainQuery
| sort by Timestamp desc Detects password policy discovery activity using Microsoft Defender for Endpoint DeviceProcessEvents. Monitors for net.exe/net1.exe with 'accounts' arguments (local and domain), PowerShell AD password policy cmdlets (Get-ADDefaultDomainPasswordPolicy, Get-ADFineGrainedPasswordPolicy), PoshC2's Get-PassPol, NtdsAudit utility usage, Linux chage -l enumeration, macOS pwpolicy getaccountpolicies, and CrackMapExec-style --pass-pol flags. Enriches events with the discovery method and whether the query targets the domain policy.
Data Sources
Required Tables
False Positives & Tuning
- IT administrators running 'net accounts /domain' for routine password policy audits or compliance checks
- Security tools and vulnerability scanners (Nessus, Qualys, CIS-CAT) that enumerate password policy as part of baseline hardening assessments
- Active Directory management scripts and monitoring agents (e.g., Azure AD Connect health, SIEM onboarding scripts) that periodically query domain password policy
- Help desk staff using net accounts to verify lockout policy before resetting a locked account
- Automated identity governance platforms (SailPoint, Saviynt) querying fine-grained password policies during access reviews
Other platforms for T1201
Testing Methodology
Validate this detection against 4 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1Local Password Policy Discovery via net accounts
Expected signal: Sysmon Event ID 1: Process Create with Image ending in net.exe or net1.exe, CommandLine='net accounts'. Security Event ID 4688 (if command line auditing is enabled) with same details. Parent process will be cmd.exe or the calling shell.
- Test 2Domain Password Policy Discovery via net accounts /domain
Expected signal: Sysmon Event ID 1: Process Create with Image=net.exe, CommandLine='net accounts /domain'. Net.exe internally calls net1.exe which also generates a process creation event. The query contacts the PDC emulator — Sysmon Event ID 3 (Network Connect) may show a connection to the DC on port 445 or 135.
- Test 3Domain Password Policy via PowerShell Get-ADDefaultDomainPasswordPolicy
Expected signal: Sysmon Event ID 1: Process Create with Image=powershell.exe, CommandLine containing 'Get-ADDefaultDomainPasswordPolicy'. PowerShell ScriptBlock Log Event ID 4104 capturing the full command. Sysmon Event ID 7 (Image Load) may show Microsoft.ActiveDirectory.Management.dll being loaded.
- Test 4Linux Password Policy Discovery via PAM configuration
Expected signal: On systems with auditd: syscall audit records for openat()/read() on /etc/security/pwquality.conf and /etc/pam.d/common-password (auditd rule: -w /etc/pam.d/ -p r -k pam_policy_read). Process creation event for chage with -l argument. On MDE Linux agent: DeviceProcessEvents event for chage with ProcessCommandLine containing '-l'.
References (13)
- https://attack.mitre.org/techniques/T1201/
- https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/net-accounts
- https://docs.aws.amazon.com/IAM/latest/APIReference/API_GetAccountPasswordPolicy.html
- https://superuser.com/questions/150675/how-to-display-password-policy-information-for-a-user-ubuntu
- https://www.jamf.com/jamf-nation/discussions/18574/user-password-policies-on-non-ad-machines
- https://www.us-cert.gov/ncas/alerts/TA18-106A
- https://github.com/clymb3r/PowerShell/blob/master/Get-PassHashes/Get-PassHashes.ps1
- https://github.com/byt3bl33d3r/CrackMapExec
- https://github.com/nettitude/PoshC2
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1201/T1201.md
- https://github.com/SigmaHQ/sigma/blob/master/rules/windows/process_creation/proc_creation_win_net_password_policy_discovery.yml
- https://www.fireeye.com/blog/threat-research/2017/12/targeted-attack-in-middle-east-by-apt34.html
- https://research.nccgroup.com/2021/01/12/abusing-cloud-services-to-fly-under-the-radar/
Unlock Pro Content
Get the full detection package for T1201 including response playbook, investigation guide, and atomic red team tests.