Performing Active Directory Security Review
Download the ADMustcheckReports.ps1 script below.
Note: You will need to extract the .ps1 after downloading the zip file, please review the help file.
The ADMustcheckReports.ps1 is a PowerShell scripts gathers basic data from AD Domain/forest that we believe enterprises must review on a regular basis and take necessary actions to remediate any weakness. You can further use CionSystems’ Free AD reporter for detailed AD assessment.
The PowerShell script requires the following:
- PowerShell 5.0 (minimum)
- Windows 7+ or Windows Server 2008 (or newer)
- Active Directory PowerShell Module
- Group Policy PowerShell Module
The PowerShell script gathers domain data using the Active Directory PowerShell & Group Policy modules and displays some results on the screen. The data shown on the screen is also saved to a transcript log file and all captured data is also saved to csv/text files in c:\temp\ADMustcheckReports.
The ADMustcheckReports PowerShell script gathers data for key AD security items in a domain:
- User Account Issues
- Groups
- Trusts
- Duplicate SPNs
- Group Policies
- AD Administration & Privileged Accounts
- KRBTGT Account
- Kerberos Delegation
- Group Policy Object Owners
- Much more…
# | What is it? | Recommendations |
1 | User Account Issues There are several potential issues that Active Directory domain user accounts may have because these accounts can be configured in many different ways. Further they can be in different states with different user access control settings. The script shows the state of all users along with User accounts flags. |
|
2 | Domain Password Policy The Domain Password policy determines how passwords are created and how often they need to be changed, etc. The AD default password minimum is 7 characters. Most AD environments we see have this set to between 8 and 10. Some are set to 0 or 3 or 5.Password Spray attacks are effective against Active Directory due to bad passwords (often with short minimum requirements).Increasing password length can limit Password Spray effectiveness. Fine-Grained Password Policies (FGPP) provides additional flexibility, especially for admin and service accounts. |
You can use CionSystems ADGuardian password protection to audit all passwords, enhance default AD password policies, remove duplicate passwords, force all users to change passwords if they are using passwords that has been breached |
3 | Tombstone Lifetime The AD Tombstone Lifetime determines how long deleted items exist in AD before they are purged. The default value is 180 days starting with new AD forests created with Windows 2003 SP1. While the tombstone lifetime directly affects deleted items, it also has an impact on Domain Controllers. If a DC hasn’t replicated within the tombstone lifetime with another DC, it is effectively orphaned from the domain. Additionally, DC backups are only useful for restoring AD data within this tombstone lifetime – a backup that is 181 days old is no longer useful when the tombstone lifetime is 180 days. |
Systems state DC backups are only useful for restoring AD data within this tombstone lifetime – a backup that is 181 days old is no longer useful when the tombstone lifetime is 180 days. |
4 | Active Directory Backups Microsoft supported backups update a partition attribute to identify the last backup date for that partition. |
Unlike CionSystems ADGuardian plus, not all backup solutions of Active Directory set this attribute since they are likely not using a Microsoft supported method. |
5 | Trusts An Active Directory trust extends the security boundary and include other the systems that may not be in the domain yet they can access resources within the domain, thereby extending the authentication boundary. |
|
6 | Active Directory Duplicate Service Principal Names (SPNs) | Make sure there are no duplicates! |
7 | Group Policy Preference Passwords Group Policy Preferences was released in the 2008 time-frame and included capability to provide and update credentials. These credentials were encrypted using AES256 which sounds good until you realize that a static key is used to encrypt them. The cpassword value in the GPP xml files is the encrypted password. Using a PowerShell function from PowerSploit, we can reverse this encryption and get the plain-text value. Since authenticated users have read access to Group Policies in the SYSVOL share on all DCs, anyone can view this information and get the passwords stored in GPP xml files, even across trusts. |
|
8 | Active Directory Admin Account Checks During standard Active Directory Security Assessment, the focus must be on identifying “AD Admins” which includes members of the domain Administrators group, Domain Admins, Enterprise Admins, and other builtin groups etc. These accounts have full AD rights and require careful protection. Note, there may be other accounts with privilege access that may not show up in this list, if the access was granted using ACL’s modification |
|
9 | AD Admin Accounts Not Member of Protected Users Protected Users is a new group created when the domain PDC Emulator is running Windows Server 2012 R2. Full Domain protection is only available when the domain functional level is 2012 R2. Protected Users group provides additional protections: |
|
10 | AD Admins with Old Passwords AD Admin accounts with old passwords, especially those older than 3 months, are vulnerable to password spraying (and password guessing). |
|
11 | AD Admins with Kerberos Service Principal Names (SPNs) Kerberos Service Principal Name or SPN is effectively the signpost that points to the service account for a service on a server that supports Kerberos authentication. When the client needs to connect to a service, it must request a Kerberos service ticket from a DC and in order to do this it needs to provide a SPN for that service. The DC looks up the account in the AD forest that has that SPN, identifies the account, and uses the account’s password data to encrypt the ticket. Once the service ticket is delivered to the service, it attempts to open the service ticket and if it can, it can assume the DC provided it, so it validates access for the user. |
|
12 | Check Default Domain Administrator Account for Issues |
|
13 | Review AD Default/Built-In Group Membership Reviewing the default privileged groups in Active Directory is important to identify accounts with high-level privileges. |
|
14 | Default AD Groups: Administrators | Default Rights:
|
15 | Default AD Groups: Domain Admins | Default Rights:
|
16 | Default AD Groups: Enterprise Admins | Default Rights:
|
17 | Default AD Groups: Server Operators | This group is effectively “Domain Controller Admins” and members of this group should be scrutinized at a similar level to Domain Admins. This group has no default members. Default Rights:
|
18 | Default AD Groups: Account Operators | This group has no default members. This group should remain empty. Default Rights:
Microsoft recommends this group remain empty. |
19 | Privileged Group: VMWare Admins | Many enterprises have “VMWare Admins” or other such groups.
|
20 | Krbtgt Password Not Changed Recently The krbtgt account is the domain service account. This account is disabled but used for Kerberos Tickets. The password set when created & practically never changes. DC/AD backups contains the KRBTGT account password. If an attacker gains knowledge of this password, they can create Golden Tickets! |
Reference: |
21 | Kerberos Delegation Kerberos Delegation Types:
Resource-based Constrained Delegation: Enables delegation configured on the resource instead of the account |
|
22 | GPO Permissions: Review Owners Group Policy Objects (GPO) has owners which are able to change permissions. Typically when an account creates a GPO, the account that created has delegate modify rights and it is configured as the owner. |
|
23 | Review Domain Permissions Domain permissions should be reviewed to ensure that configuration is appropriate. Security of the domain often depends on proper domain permissions. |
|
24 | Domain Controllers Running Old Versions Domain Controllers must be running Microsoft supported Windows versions. You can run all Windows Server 2012 R2 DCs even with older Windows Server versions in the domain (note that some testing to ensure Windows 2003/XP works with the new DCs, especially for SMB shares). |
All DCs should be running a minimum of Windows Server 2012 R2, preferably 2016/2019 |
25 | AD Forest Functional Level / Domain Functional Level Older than Domain Controller Operating System |
|