Adversaries may attempt to access detailed information about the password policy used within an enterprise network. Password policies for networks are a way to enforce complex passwords that are difficult to guess or crack through [Brute Force](https://attack.mitre.org/techniques/T1110). This would help the adversary to create a list of common passwords and launch dictionary and/or brute force attacks which adheres to the policy (e.g. if the minimum password length should be 8, then not trying passwords such as 'pass123'; not checking for more than 3-4 passwords per account if the lockout is set to 6 as to not lock out accounts).Password policies can be set and discovered on Windows, Linux, and macOS systems via various command shell utilities such as
net accounts (/domain)
,chage -l
,cat /etc/pam.d/common-password
, andpwpolicy getaccountpolicies
.(Citation: Superuser Linux Password Policies) (Citation: Jamf User Password Policies)
-
Atomic Test #1 - Examine password complexity policy - Ubuntu
-
Atomic Test #2 - Examine password complexity policy - CentOS/RHEL 7.x
-
Atomic Test #3 - Examine password complexity policy - CentOS/RHEL 6.x
-
Atomic Test #4 - Examine password expiration policy - All Linux
Lists the password complexity policy to console on Ubuntu Linux.
Supported Platforms: Linux
cat /etc/pam.d/common-password
Lists the password complexity policy to console on CentOS/RHEL 7.x Linux.
Supported Platforms: Linux
cat /etc/security/pwquality.conf
if [ $(rpm -q --queryformat '%{VERSION}') -eq "7" ]; then exit /b 0; else exit /b 1; fi;
echo Please run from CentOS or RHEL v7
Lists the password complexity policy to console on CentOS/RHEL 6.x Linux.
Supported Platforms: Linux
cat /etc/pam.d/system-auth
cat /etc/security/pwquality.conf
if [ $(rpm -q --queryformat '%{VERSION}') -eq "6" ]; then exit /b 0; else exit /b 1; fi;
echo Please run from CentOS or RHEL v6
Lists the password expiration policy to console on CentOS/RHEL/Ubuntu.
Supported Platforms: Linux
cat /etc/login.defs
Lists the local password policy to console on Windows.
Supported Platforms: Windows
net accounts
Lists the domain password policy to console on Windows.
Supported Platforms: Windows
net accounts /domain
Lists the password policy to console on macOS.
Supported Platforms: macOS
pwpolicy getaccountpolicies