diff --git a/routes/ui/tools.py b/routes/ui/tools.py index 1ac2b33..966972f 100644 --- a/routes/ui/tools.py +++ b/routes/ui/tools.py @@ -3714,9 +3714,9 @@ def duplicator_page_form(project_id, current_project, current_user): if current_path['network_in']: source_network = db.select_network(current_path['network_in'])[0] network_in = db.select_network_by_ip(destination_project['id'], - source_network['ip'], - source_network['mask'], - source_network['is_ipv6'])[0]['id'] + source_network['ip'], + source_network['mask'], + source_network['is_ipv6'])[0]['id'] # search dublicates dublicate_paths = db.search_path(project_id=destination_project['id'], @@ -5395,12 +5395,144 @@ def nmap_helper_page(project_id, current_project, current_user): tab_name='Nmap Helper') -@routes.route('/project//tools/msfvenom-helper/', methods=['GET']) +@routes.route('/project//tools/pingcastle/', methods=['GET']) +@requires_authorization +@check_session +@check_project_access +@check_project_archived +@send_log_data +def pingcastle_page(project_id, current_project, current_user): + return render_template('project/tools/import/pingcastle.html', + current_project=current_project, + tab_name='PingCastle') + + +@routes.route('/project//tools/pingcastle/', methods=['POST']) @requires_authorization @check_session @check_project_access +@check_project_archived @send_log_data -def msfvenom_helper_page(project_id, current_project, current_user): - return render_template('project/tools/helpers/msfvenom-helper.html', +def pingcastle_page_form(project_id, current_project, current_user): + form = PingCastleForm() + form.validate() + errors = [] + if form.errors: + for field in form.errors: + for error in form.errors[field]: + errors.append(error) + + if not errors: + # prepare issues database + f = open('./routes/ui/tools_files/PingCastle/PingCastleDescription.resx') + s = f.read() + f.close() + issues_database = {} + issues_database_xml = BeautifulSoup(s, 'html.parser') + for issue_obj in issues_database_xml.findAll('data'): + issues_database[issue_obj.attrs['name']] = issue_obj.findAll('value')[0].text + + # xml files + for file in form.xml_files.data: + if file.filename: + scan_result = BeautifulSoup(file.read(), "html.parser") + scan_obj = scan_result.healthcheckdata + + # add DCs + domain_controllers = scan_obj.domaincontrollers + dc_ports_dict = {} + if domain_controllers: + for domain_obj in domain_controllers.findAll('healthcheckdomaincontroller'): + host_description = '' + host_os = '' if not domain_obj.operatingsystem else domain_obj.operatingsystem.text + if domain_obj.dcname: host_description += 'DC name: {}\n'.format(domain_obj.dcname.text) + if domain_obj.lastcomputerlogondate: host_description += 'Last Logon: {}\n'.format(domain_obj.lastcomputerlogondate.text) + if domain_obj.distinguishedname: host_description += 'Distinguished Name: {}\n'.format(domain_obj.distinguishedname.text) + if domain_obj.ownersid: host_description += 'Owner SID: {}\n'.format(domain_obj.ownersid.text) + if domain_obj.ownername: host_description += 'Owner Name: {}\n'.format(domain_obj.ownername.text) + if domain_obj.hasnullsession and domain_obj.hasnullsession == 'true': host_description += 'Has null session!\n' + if domain_obj.supportsmb1 and domain_obj.supportsmb1.text == 'true': + host_description += 'Supports SMB1!\n' + if domain_obj.smb1securitymode and domain_obj.smb1securitymode.text == 'NotTested': + host_description += 'SMB1SecurityMode: {}\n'.format(domain_obj.smb1securitymode.text) + if domain_obj.supportsmb2orsmb3 and domain_obj.supportsmb2orsmb3.text == 'true': host_description += 'Supports SMBv2 or SMBv3.\n' + if domain_obj.smb2securitymode: host_description += 'SMB2 security mode: {}\n'.format(domain_obj.smb2securitymode.text) + if domain_obj.remotespoolerdetected and domain_obj.remotespoolerdetected.text == 'true': host_description += 'Detected remote spooler.\n' + if domain_obj.pwdlastset: host_description += 'Last pwd set: {}.\n'.format(domain_obj.pwdlastset.text) + if domain_obj.rodc and domain_obj.rodc.text == 'true': host_description += 'Read-Only DC\n' + if domain_obj.sysvoloverwrite and domain_obj.sysvoloverwrite == 'true': host_description += 'SYSVOL overwrite\n' + + if domain_obj.fsmo: + fsmo_result = ', '.join([x.text for x in domain_obj.fsmo.findAll("string")]) + if fsmo_result: + host_description += 'FSMO: {}\n'.format(fsmo_result) + + host_description = host_description.strip(' \n\t\r') + # TODO: fields LDAPSProtocols + try: + ip_obj = domain_obj.ip + for host_ip_obj in ip_obj.findAll('string'): + host_ip = host_ip_obj.text + # check for valid ip + ipaddress.ip_address(host_ip) + current_host = db.select_project_host_by_ip(current_project['id'], host_ip) + if current_host: + current_host_id = current_host[0]['id'] + if host_os: + db.update_host_os(current_host_id, host_os) + + else: + current_host_id = db.insert_host(current_project['id'], host_ip, current_user['id'], 'Added from PingCastle', os=host_os) + # add 88 port + current_port = db.select_host_port(current_host_id, port_num=88, is_tcp=True) + if current_port: + current_port_id = current_port[0]['id'] + if host_description: + db.update_port_proto_description(current_port_id, 'kerberos', host_description) + else: + current_port_id = db.insert_host_port(current_host_id, 88, True, 'kerberos', + host_description, current_user['id'], current_project['id']) + dc_ports_dict[current_port_id] = ['0'] + except Exception as e: + pass + + # TODO: ignored fields: Sites, lDAPIPDenyList, PreWindows2000AnonymousAccess, PreWindows2000NoDefault + # PreWindows2000AuthenticatedUsers, DsHeuristicsAnonymousAccess, DsHeuristicsAdminSDExMaskModified + # DsHeuristicsDoListObject, DsHeuristicsAllowAnonNSPI, UsingNTFRSForSYSVOL + + # Issues - RiskRules + risk_rules = scan_obj.riskrules + for risk_obj in risk_rules.findAll('healthcheckriskrule'): + issue_points = int(risk_obj.points.text) + issue_category = risk_obj.category.text # PrivilegedAccounts + issue_model = risk_obj.model.text # AccountTakeOver + issue_riskid = risk_obj.riskid.text.replace('-', '_') # A_AdminSDHolder + issue_briefly = risk_obj.rationale.text + issue_links = issues_database[issue_riskid + '_Documentation'].replace(' ', '') if (issue_riskid + '_Documentation') in issues_database else '' + issue_purpose = issues_database[issue_riskid + '_Description'] if (issue_riskid + '_Description') in issues_database else '' + issue_fix = issues_database[issue_riskid + '_Solution'] if (issue_riskid + '_Solution') in issues_database else '' + issue_technical_description = issues_database[issue_riskid + '_TechnicalExplanation'] if (issue_riskid + '_TechnicalExplanation') in issues_database else '' + issue_name = 'PingCastle: {}'.format(issues_database[issue_riskid + '_Title']) + + issue_full_description = 'Brief: {}\n\nTechnical information: {}\n\nTest purpose: {}\n\nLinks: \n{}'.format( + issue_briefly, + issue_technical_description, + issue_purpose, + issue_links + ) + if issue_points < 1: + issue_cvss = 0 + elif issue_points < 10: + issue_cvss = 3 + elif issue_points < 30: + issue_cvss = 6 + else: + issue_cvss = 9.5 + + issue_id = db.insert_new_issue_no_dublicate(issue_name, issue_full_description, '', issue_cvss, + current_user['id'], dc_ports_dict, 'need to recheck', + current_project['id'], fix=issue_fix) + return render_template('project/tools/import/pingcastle.html', current_project=current_project, - tab_name='MSFvenom Helper') + tab_name='PingCastle', + errors=errors) \ No newline at end of file diff --git a/routes/ui/tools_files/PingCastle/PingCastleDescription.resx b/routes/ui/tools_files/PingCastle/PingCastleDescription.resx new file mode 100644 index 0000000..e7d90c7 --- /dev/null +++ b/routes/ui/tools_files/PingCastle/PingCastleDescription.resx @@ -0,0 +1,4082 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + The purpose is to ensure that the SMB version 2 protocol has the signature enabled when communicating with domain controllers + + + Enable the group policy "Digitally sign communications (if client agrees)" or check for any policy which may alter the server settings. See the <a href="https://docs.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/smbv1-microsoft-network-server-digitally-sign-communications-if-client-agrees">official documentation</a> for more information. + + + {count} Domain Controller(s) have been found where SMB signature is not enabled + + + Domain controller: {0} + + + The purpose is to ensure that the SMB version 2 protocol has the signature enforced when communicating with domain controllers + + + Enable the group policy "Digitally sign communications (always)" or check for any policy which may alter the server settings. See the <a href="https://docs.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/microsoft-network-server-digitally-sign-communications-always">official documentation</a> for more information. + + + {count} Domain Controller(s) have been found where SMB signature is not enforced + + + Domain controller: {0} + + + The purpose is to ensure that the minimum set of subnet(s) has been configured in the domain + + + Locate the IP address which was found as not being part of declared subnet then add this subnet to the "Active Directory Sites" tool. If you have found IPv6 addresses and it was not expected, you should disable the IPv6 protocol on the network card. + + + The subnet declaration is incomplete [{count} IP of DC not found in declared subnets] + + + Domain controller: {0} ip: {1} + + + The purpose is check if the backups are actually up to date in case they are needed. The alert can be triggered when a domain is backed up using non-recommended methods + + + Plan AD backups based on Microsoft standards. These standards depend on the Operating System. For example with the wbadmin utility: <i>wbadmin start systemstatebackup -backuptarget:d:</i> + + + Last AD backup has been performed {count} day(s) ago + + + The purpose is to ensure that the schema has been updated for the creation of Protected Users group. + + + The Protected Users group is automatically created when the PDC (primary DC) emulator role is transferred to Windows 2012 R2 or newer domain controller. The group is then automatically replicated to all other domain controllers. +<b> Warning: Do not add service account into this group as this will result in "authentication failure" messages. Use "protected accounts" instead</b> + + + The Protected Users group doesn't exist on the domain. + + + The purpose is to make sure that there is a proper password policy in place for the native local administrator account. + + + If you don't have any provisioning process or password solution to manage local administrators, you should install the LAPS solution. If you mitigate the risk differently, you should add this rule as an exception, as the risk is covered. + + + LAPS doesn't seem to be installed + + + The purpose is to verify if Domain Controller(s) are vulnerable to the MS17-010 vulnerability + + + To fix the security breach, you should patch the DC as soon as it has been established it was vulnerable. Another good remediation is to disable SMB v1 (see "DC Vulnerability (SMB v1)). You can verify that using the github program in the links: this program will check remotely the last startup time of the DC and evaluate the risk + + + Number of DC(s) vulnerable to MS17-010 = {count} (>0) + + + Domain controller: {0} Reason: {1} + + + The purpose is to verify if Domain Controller(s) are vulnerable to the SMB v1 vulnerability + + + It is highly recommended by Microsoft to disable SMB v1 whenever it is possible on both client and server side. <b>Do note that if you are still not following best practices regarding the usage of deprecated OS (Windows 2000, 2003, XP, CE), regarding Network printer using SMBv1 scan2shares functionalities, or regarding software accessing Windows share with a custom implementation relying on SMB v1, you should consider fixing this issues before disabling SMB v1, as it will generate additional errors</b>. + + + SMB v1 activated on {count} DC + + + Domain controller: {0} + + + The purpose is to verify if Domain Controller(s) are vulnerable to the MS14-068 vulnerability + + + To fix the security breach, you should patch the DC as soon as it has been established it was vulnerable. You can verify that using a program in the links: this program will check remotely the last startup time of the DC and evaluate the risk + + + Number of DC(s) vulnerable to MS14-068 = {count} (>0) + + + Domain controller: {0} Reason: {1} + + + The purpose is to identify if there are restricted groups such as local administrators, terminal server access, … where Authenticated Users or Everyone is being granted access by a GPO + + + In order to correct the issue, you should edit the GPO and remove the "Members" security access rule. Another solution is to change the group to a more targeted one containing a limited set of users. + + + Presence of restricted group where anybody is a member: {count} + + + GPO: {0} MemberOf: {1} User: {2} + + + The purpose is to perform a review of which accounts have ownership rights on a domain controller and can then modify their permissions + + + To solve this security issue, you should change the ownership of the domain controller to match the "Domain Administrators" group. +To control the ownership of domain controller objects, you can use the following PowerShell command: +<i>Get-ADComputer -server my.domain.to.check -LDAPFilter "(&(objectCategory=computer)(|(primarygroupid=521)(primarygroupid=516)))" -properties name, ntsecuritydescriptor | select name,{$_.ntsecuritydescriptor.Owner}</i>. +To change it you can edit the owner of an object using <a href="https://docs.microsoft.com/en-us/sysinternals/downloads/adexplorer">adexplorer.exe</a>. First, locate the DC object then right click to select properties. Open the security tab and press the advanced button. You then have a new dialog with an owner tab. Select the owner and change it for the domain administrators group. You’re done (no reboot needed). + + + {count} domain controller(s) have been found where the owner is not the Domain Admins group or the Enterprise Admins group + + + Domain controller: {0} Owner: {1} + + + The purpose is to ensure that every account having an SID History is part of an active migration. + + + Each security descriptor of the domain (including file shares for example) should be reviewed to be rewritten with the new SID of the account. Then the SID History attribute should be removed. Please note that once the SID History has been removed, it cannot be added back again without doing a real migration. Hopefully hacking tools such as mimikatz can be used to undo a deletion with for example the lsadump::dcshadow attack. + + + {count} unknown domain(s) used in SIDHistory + + + SID: {0} Object(s): {1} + + + The purpose is to ensure that accounts are not linked for more privileged accounts in the same domain + + + It is not possible to have this occurrence except if a user from domain A has been migrated to domain B and then migrated again to domain A. This should be strongly investigated as it may be linked to a compromise of the domain. + + + Account(s) with SID History matching the domain = {count} + + + The purpose is to ensure that basic users cannot register extra computers in the domain + + + To solve the issue, limit the number of extra computers that can be registered by a basic user. It can be reduced by modifying the value of <i>ms-DS-MachineAccountQuota</i> to zero (0). Another solution can be to remove altogether the authenticated users group in the domain controllers policy. Do note that if you need to set delegation to an account so it can add computers to the domain, it can be done through 2 methods: Delegation in the OU or by assigning the <i>SeMachineAccountPrivilege</i> to a special group + + + Non-admin users can add up to {count} computer(s) to a domain + + + Domain controller: {0} Owner: {1} + + + The purpose is to ensure that there is no use of the SHA1 hashing algorithm in Root Certificate + + + To solve the matter, the certificate should be removed from the GPO and if needed, certificates depending on it should be reissued. + + + At least one trusted ROOT certificate found has a SHA1 signature [{count}] + + + GPO: {0} Subject: {1} + + + The purpose is to ensure that there is no use of the SHA0 hashing algorithm in Root Certificate + + + To solve the matter, the certificate should be removed from the GPO and if needed, certificates depending on it should be reissued. + + + At least one trusted ROOT certificate found has a SHA0 signature [{count}] + + + GPO: {0} Subject: {1} + + + The purpose is to ensure that there is no use of the MD5 hashing algorithm in Root Certificate + + + To solve the matter, the certificate should be removed from the GPO and if needed, certificates depending on it should be reissued. + + + At least one trusted ROOT certificate found has a MD5 signature [{count}] + + + GPO: {0} Subject: {1} + + + The purpose is to ensure that there is no use of the MD4 hashing algorithm in Root Certificate + + + To solve the matter, the certificate should be removed from the GPO and if needed, certificates depending on it should be reissued. + + + At least one trusted ROOT certificate found has a MD4 signature [{count}] + + + GPO: {0} Subject: {1} + + + The purpose is to ensure that there is no use of the MD2 hashing algorithm in Root Certificate + + + To solve the matter, the certificate should be removed from the GPO and if needed, certificates depending on it should be reissued. + + + At least one trusted ROOT certificate found has a MD2 signature [{count}] + + + GPO: {0} Subject: {1} + + + The purpose is to ensure that there is no use of a certificate using a weak RSA key + + + To solve the matter, the certificate should be removed from the GPO and if needed, certificates depending on it should be reissued. + + + At least one trusted certificate found has a weak RSA key [{count}] + + + Source: {0} Subject: {1} Module: {2} Expires: {3} + + + The purpose is to ensure that there is no use of the SHA0 hashing algorithm in Intermediate Certificate + + + To solve the matter, the certificate should be removed from the GPO and if needed, certificates depending on it should be reissued. + + + At least one trusted INTERMEDIATE certificate found has a SHA0 signature [{count}] + + + GPO: {0} Subject: {1} + + + The purpose is to ensure that there is no use of the MD2 hashing algorithm in Intermediate Certificate + + + To solve the matter, the certificate should be removed from the GPO and if needed, certificates depending on it should be reissued. + + + At least one trusted INTERMEDIATE certificate found has a MD2 signature [{count}] + + + GPO: {0} Subject: {1} + + + The purpose is to ensure that there is no use of the MD4 hashing algorithm in Intermediate Certificate + + + To solve the matter, the certificate should be removed from the GPO and if needed, certificates depending on it should be reissued. + + + At least one trusted INTERMEDIATE certificate found has a MD4 signature [{count}] + + + GPO: {0} Subject: {1} + + + The purpose is to ensure that the SID History creation is not enabled + + + If a migration is in progress, declare it in PingCastle so this rule won't be triggered. Else, remove this auditing group. You can locate it by using the LDAP query (sAMAccountName=*$$$) + + + The SIDHistory auditing group is present: SID History creation is enabled + + + The purpose is to ensure that a compromised domain cannot use scripts located in it to compromise other domains + + + Copy the login script to a share located inside the domain and not in trusted domains. + + + Number of login scripts hosted in another domain: {count} + + + Script: {0} + + + The purpose is to access without any account, aka NULL Sessions, within the Active Directory. A NULL Session is a session opened anonymously to access the AD, often used by attackers to perform a recon operation on the AD, to identify weaknesses + + + Locate other PingCastle rules such as A-PreWin2000Anonymous or A-DsHeuristicsAnonymous which triggered and apply the solutions. You can use the PingCastle scanner mode to do a manual check and prove the extraction of the data. + + + Number of DC(s) with NULL SESSION enabled: {count} + + + Domain controller: {0} + + + The purpose is to identify domains which allow access without any account because of a Pre-Windows 2000 compatibility + + + Remove the "Everyone" and "Anonymous" from the PreWin2000 group while making sure that the group "Authenticated Users" is present, then reboot each DC + + + The group Everyone and/or Anonymous is present in the Pre-Windows 2000 group. + + + The purpose is to ensure that there is no use of the SHA1 hashing algorithm in Intermediate Certificate + + + To solve the matter, the certificate should be removed from the GPO and if needed, certificates depending on it should be reissued. + + + At least one trusted INTERMEDIATE certificate found has a SHA1 signature [{count}] + + + GPO: {0} Subject: {1} + + + The purpose is to ensure that there is no use of the MD5 hashing algorithm in Intermediate Certificate + + + To solve the matter, the certificate should be removed from the GPO and if needed, certificates depending on it should be reissued. + + + At least one trusted INTERMEDIATE certificate found has a MD5 signature [{count}] + + + GPO: {0} Subject: {1} + + + The purpose is to give information regarding a best practice for the Service Account password policy. Indeed, having a 20+ characters password for this account greatly helps reducing the risk behind Kerberoast attack (offline crack of the TGS tickets) +Note: PSO (Password Settings Objects) will be visible only if the user which collected the information has the permission to view it. + + + The recommended way to handle service accounts is to use "Managed service accounts" introduced since Windows 2008 R2 (search for "msDS-ManagedServiceAccount"). +To solve the anomaly, you should implement a PSO or GPO password guarantying a 20+ length password. + + + No password policy for service account found (MinimumPasswordLength>=20) + + + GPO: {0} + + + The purpose is to identify if accounts without password are allowed to be accessed from the network. This represents a high risk, as an account without a password is essentially an account that cannot be assigned to anyone. + + + Locate the policy having the setting "Limit local account use of blank passwords to console logon only" disabled and enabled the setting. + + + At least one policy has been found where the account having an empty password can be accessed from the network [{count}] + + + GPO: {0} + + + The purpose is to identify domains having a GPO which allows access to the domain without any account + + + In order to remove the anonymous access, we advise to identify the GPO indicated by the program and change the setting restrictanonymous and restrictanonymoussam + + + {count} policies have been found where anonymous accesses can be used + + + GPO: {0} + + + The authentication protocol NTLM v1 can use the LM password hash algorithm which is weak if enabled by a GPO. + + + A GPO explicitly disabled the default security policy LmCompatibilityLevel or NoLMHash. Using the information provided, identify the setting modified in the GPO and fix it. +All security settings should be modified in the Domain GPO Editor and are located in Computer Configuration / Policies / Windows Settings / Security Settings / Local Policies / Security Options +For NoLMHash the setting is located in: Network security: Do not store LAN Manager hash value on next password change +For LmCompatibilityLevel the setting is located in: Network security: LAN Manager authentication level + + + At least one policy has been found where the LM hash can be used [{count}] + + + GPO: {0} Setting: {1} + + + The purpose is to verify if the password policy of the domain enforces users to have at least 8 characters in their password + + + To solve the issue, the best way is to either remove the GPO enabling short password, or to modify it in order to increase the password length to at least 8 characters + + + Policy where the password length is less than 8 characters: {count} + + + GPO: {0} + + + The purpose is to verify if a GPO alters the password policy of the domain to enable reversible passwords + + + In order to remove the anonymous access, we advise to identify the GPO indicated by the program and change the setting "Store passwords using reversible encryption" + + + At least one policy has been found where the reversible encryption has been enabled [{count}] + + + GPO: {0} + + + The purpose is to make sure the requirement of Smart Cards doesn't degrade password rotation + + + There are 3 solutions to fix this issue, the most obvious being to change the user password on a regular basis. The fastest way is to check if the domain has the attribute <i>msDS-ExpirePasswordsOnSmartCardOnlyAccounts</i>, which is available for Windows 2016 and later versions and handle periodically hash change. Another possibility instead of changing the password is to disable the flag "this account requires a smart card" then re-enable it which will trigger internally a password hash change. + + + Number of account(s) using a smart card whose password is not changed: {count} + + + The purpose is to alert when a clear text password has been identified in the GPO. Regardless of whether the password is present or not, both the account and password should be considered compromised + + + In order to solve this issue, you should manually change the password to a new one. If this password is shared on many systems, each system should have a different password. If the GPO was used to define the native local administrator account, it is recommended to install a password solution manager such as the LAPS solution. + + + Number of password(s) found in GPO: {count} + + + GPO: {0} login: {1} password: {2} + + + The purpose is to ensure that there is no rogue admin accounts in the Active Directory + + + These accounts should be reviewed, especially in regards with their past activities and have the admincount attribute removed. In order to identify which accounts are detected by this rule, we advise to run a PowerShell command that will show you all users having this flag set: <i>get-adobject -ldapfilter "(admincount=1)"</i> + Do not forget to look at the section AdminSDHolder below. + + + Suspicious admin activities detected on {count} user(s) + + + The purpose is to alert when the password for the krbtgt account can be used to compromise the whole domain. This password can be used to sign every kerberos ticket. Monitoring it closely often mitigates the risk of golden ticket attacks greatly. + + + The password of the krbtgt account should be changed twice to invalidate the golden ticket attack. +<b>Beware: two changes of the krbtgt password not replicated to domain controllers can break these domain controllers</b> You should wait at least 10 hours between each krbtgt password change. + +There are several possibilities to change the krbtgt password. +First, a <a href="https://github.com/microsoft/New-KrbtgtKeys.ps1/blob/master/New-KrbtgtKeys.ps1">Microsoft script</a> can be run in order to guarantee the correct replication of these secrets. Unfortunately this script supports only English operating systems. +Second, a more manual way is to essentially reset the password manually once, then to wait 3 days, then to reset it again. This is the safest way as it ensures the password is no longer usable by the Golden ticket attack. + + + + Last change of the Kerberos password: {count} day(s) ago + + + The purpose is to verify the presence of dangerous rights when a part of the domain is delegated to a third party + + + Unless there is a strong justification of their presence, these delegations should be removed. In addition, if the origin of this delegation cannot be found, their creation should be investigated as it can be related to a compromise of the domain + + + Presence of dangerous extended right in delegation: {count} + + + DN: {0} Account: {1} Right: {2} + + + The purpose is to verify that there is no delegation granted to "Everyone" and to "Authenticated Users" + + + Review the delegation to remove this permission and if needed, set a more targeted group as recipient of the delegation. + + + Presence of delegation where anybody can act: {count} + + + DN: {0} delegation: {1} right: {2} + + + The purpose is to verify that each delegation are linked to an account which exists + + + To reduce the risk, the easiest way is essentially to remove the delegation + + + Presence of unknown account in delegation: {count} + + + DN: {0} delegation: {1} right: {2} + + + The purpose is to ensure that no account can make unexpected modifications to the schema + + + Remove the accounts or groups belonging to the "schema administrators" group. + + + The group Schema Admins is not empty: {count} account(s) + + + The purpose is to check for "Service Accounts" in the "Domain Administrator" group + + + To mitigate the security risk, it is strongly advised to lower the privileges of the "Service Accounts", meaning that they should be removed from the "Domain Administrator" group, while ensuring that the password of each and every "Service Account" is higher than 20 characters + + + Presence of service accounts in the domain admin group (at least {threshold} accounts have a password which never expire): {count} + + + The purpose is to ensure that all Administrator Accounts have the configuration flag "this account is sensitive and cannot be delegated" (and are not member of the built-in group "Protected Users" when your domain functional level is at least Windows Server 2012 R2). + + + To correct the situation, you should make sure that all your Administrator Accounts has the check-box "This account is sensitive and cannot be delegated" active or add your Administrator Accounts to the built-in group "Protected Users" if your domain functional level is at least Windows Server 2012 R2 (some functionalities may not work properly afterwards, you should check the <a href="https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/how-to-configure-protected-accounts">official documentation</a>). Please note that there is a section below in this report named "Admin Groups" which give more information. + + + Presence of Admin accounts which do not have the flag "this account is sensitive and cannot be delegated": {count} + + + Domain controller: {0} Reason: {1} + + + The purpose is to ensure that the Administrator Accounts in the AD are all necessary and used + + + To correct the situation, you should make sure that all your Administrator Account(s) are "Active", meaning that you should remove Administrator rights if an account is set as not "Active" + + + More than {threshold}% of admins are inactive: {count}% + + + The purpose is to verify if the number of administrator accounts is not disproportionate. Very few users should have domain admin accounts. + + + It is strongly advised to perform a review of which users have domain administrator rights, and to ensure that these rights are actually needed. Indeed, the end goal is to remove as much domain administrator as possible, as very few users actually need these high level rights. + The rule is trigger is the number of cumulated privileged members are 50 accounts or if it represents more than 10 percent of the user accounts. + The rule enabled only if the domain has more than 100 active users. + + + Users in Admins groups = {count} (more than 50 or than 10% of all active users) + + + The purpose is to verify if the Native Administrator account is used. + + + To mitigate the security risk, a good practice is to use the Native Administrator account only for emergency, while the daily work is performed through other accounts. + It is indeed strongly recommended to not use this account but to use nominative account for administrators and dedicated account for services. + Do note that the anomaly will be removed 35 days after the last native administrator login. + + To track where the administrator account has been used for the last time, we recommend to extract the attribute LastLogon of the administrator account on ALL domain controllers. + It can be done with tools such as ADSIEdit or ADExplorer. + Then, for each domain controller, extract the events 4624 at the date matching the LastLogon date. You will identify the computer and the process at the origin of the logon event. + + Please note that PingCastle relies on the attribute LastLogonTimestamp to perform this check. The LastLogonTimestamp attribute is replicated but has a latency of a maximum of 14 days, while LastLogon is updated at each logon and is more accurate but not replicated. + + + + The native administrator account has been used recently: {count} day(s) ago + + + The purpose is to identify domains having a forest setting which allows access to the domain without any account + + + The easiest and fastest way to correct this issue is to <b>replace the seventh (7th) character of the DsHeuristics attribute</b>. If it is a 2, replace by 0 to fix the issue. + + + DsHeuristics has been set to allow anonymous sessions. + + + The purpose is to verify that every trust has a remote domain which is active. + + + Check for network connectivity issues from the remote domain or if the remote domain still exists. If it doesn't exist anymore, the trust should be removed. Indeed the secret used by the trust can be used to issue fake kerberos tickets and be used as a backdoor. + + + At least one inactive trust has been found: {count} + + + Trust: {0} + + + The purpose is to ensure that there is no NT4 compatible trusts + + + Unless the remote party of the trust is a NT4 domain, this trust shouldn't exist. It should be recreated. + + + At least one trust DownLevel has been found. This is a NT4 compatible trust: {count} + + + Trust: {0} + + + The purpose is to ensure that there is no use of the obsolete and vulnerable OS Windows 2003 as Domain Controller within the domain + + + To resolve this security risk, the only way is to decommission DC running Windows 2003 OS, in order to use new versions that are more secured and that are still being patched regarding new security threats + + + Presence of Windows 2003 as DC = {count} + + + The purpose is to ensure that there is no use of the obsolete and vulnerable OS Windows 2000 as Domain Controller within the domain + + + To resolve this security risk, the only way is to decommission DC running Windows 2000 OS, in order to use new versions that are more secured and that are still being patched regarding new security threats + + + Presence of Windows 2000 as DC = {count} + + + The purpose is to ensure that there is no use of the obsolete and vulnerable OS Windows 2003 for the workstations within the domain + + + In order to solve this security issue, you should upgrade all the workstations to a more recent version of Windows, starting from Windows 7. Do note that you can get the full details regarding the OS used with the following PowerShell command: <i>Get-ADComputer -Filter { operatingsystem -like "*Server 2003*" } -Property * | Format-Table Name,OperatingSystem,OperatingSystemServicePack,OperatingSystemVersion -Wrap -Auto</i> + + + Presence of Windows 2003 = {count} + + + The purpose is to ensure that there is no use of the obsolete and vulnerable OS Windows 2000 for the workstations within the domain + + + In order to solve this security issue, you should upgrade all the workstations to a more recent version of Windows, starting from Windows 7. Do note that you can get the full details regarding the OS used with the following PowerShell command: <i>Get-ADComputer -Filter { operatingsystem -like "*Server 2000*" } -Property * | Format-Table Name,OperatingSystem,OperatingSystemServicePack,OperatingSystemVersion -Wrap -Auto</i> + + + Presence of Windows 2000 = {count} + + + The purpose is to ensure that there is no use of the obsolete and vulnerable OS Windows XP for the workstations within the domain + + + In order to solve this security issue, you should upgrade all the workstations to a more recent version of Windows, starting from Windows 7. Do note that you can get the full details regarding the OS used with the following PowerShell command: <i>Get-ADComputer -Filter { operatingsystem -like "*Windows XP*" } -Property * | Format-Table Name,OperatingSystem,OperatingSystemServicePack,OperatingSystemVersion -Wrap -Auto</i> + + + Presence of Windows XP = {count} + + + The purpose is to ensure that there is no use of the obsolete and vulnerable OS Windows NT for the workstations within the domain + + + In order to solve this security issue, you should upgrade all the workstations to a more recent version of Windows, starting from Windows 7. Do note that you can get the full details regarding the OS used with the following PowerShell command: <i>Get-ADComputer -Filter { operatingsystem -like "* NT *" } -Property * | Format-Table Name,OperatingSystem,OperatingSystemServicePack,OperatingSystemVersion -Wrap -Auto</i> + + + Presence of Windows NT = {count} + + + The purpose is to ensure that all the Domain Controllers are updated regularly. This is done by checking if a DC has been rebooted in the past 6 months. If not, it means it has not be patched as well in these 6 monthes + + + Frequently updating the DC should be part of the AD policies, as there should be a dedicated time-slot for the servers to reboot and apply security patches + + + Number of DC not updated = {count} + + + Domain controller: {0} Reason: {1} + + + The purpose is to check if all trusts are protected using the functionality named SID Filtering + + + A trust without SID Filtering means either that a migration is in progress or that the domain can be compromised instantly via the trust. +The solution is to complete existing migration ASAP and enable the SID Filtering feature + +If the trust is a domain trust, you should use netdom /quarantine and set it to yes +If the trust is a forest trust, you should use netdom /enablesidhistory and set it to no +Do not apply /quarantine on a forest trust: you will break the transitivity of the trust. + + + Number of trusts without SID Filtering: {count} + + + Trust: {0} + + + The purpose is to verify if there currently are duplicate accounts within the domain. A duplicate account is essentially a duplicate of two objects having the same attributes. + + + Duplicate accounts often means there are weaknesses in term of processes, that is why they should be monitored and removed. To identify all duplicate accounts, you should use the following PowerShell commands: <i>get-adobject -ldapfilter "(cn=*cnf:*)"</i> ; <i>get-adobject -ldapfilter "(sAMAccountName=$duplicate)"</i> + + + Presence of duplicate accounts = {count} + + + The purpose is to verify if there are accounts currently running with a reversible password + + + To remove this risk, there should be no account(s) with reversible encryption. You should remove them by removing the flag "Store password using reversible encryption" on all accounts, so that the cleartext password is removed at the next password change. You can get a list of all the possibly compromised accounts running the following PowerShell command: <i>get-adobject -ldapfilter "(userAccountControl:1.2.840.113556.1.4.803:=128)" -properties useraccountcontrol</i> + + + Number of computers which have a reversible password: {count} + + + The purpose is to verify if there are user accounts currently running with a reversible password + + + To remove this risk, there should be no account(s) with reversible encryption. You should remove them by removing the flag "Store password using reversible encryption" on all accounts, so that the cleartext password is removed at the next password change. You can get a list of all the possibly compromised accounts running the following PowerShell command: <i>get-adobject -ldapfilter "(userAccountControl:1.2.840.113556.1.4.803:=128)" -properties useraccountcontrol</i> + + + Number of account(s) which have a reversible password: {count} + + + The purpose is to ensure that every account requires a password + + + The best solution to solve the problem is to change the "useraccountcontrol" attribute of all the accounts that have it and that are not used in trusts. If the flag is removed while there is no password set, you will have an error. You can use this to detect accounts without any passwords. Do note that you can manually check all the accounts that need to be worked on using the following PowerShell command: <i>get-adobject -ldapfilter "(&(objectCategory=person)(objectClass=user)(userAccountControl:1.2.840.113556.1.4.803:=32))" -properties useraccountcontrol</i> + + + Number of accounts which can have an empty password (can be overridden by GPO): {count} + + + The purpose is to verify that no weak encryption algorithm such as DES is used as crypto algorithm. + + + It is recommended to disable DES as an encyrption algorithm in the user configuration dialog or in the "msDSSupportedEncryptionTypes" attribute at LDAP level. It has to be disabled in the property of an account by unchecking the box "Use Kerberos DES encryption for this account" + + + Presence of Des Enabled account = {count} + + + The purpose is to check for unusual value in the primarygroupid attribute used to store group membership + + + Unless strongly justified, change the primary group id to its default. 513 or 514 for users, 516 or 521 for domain controllers, 514 or 515 for computers. The primary group can be edited in a friendly manner by editing the account with the "Active Directory Users and Computers" and after selecting the "Member Of" tab, "set primary group". + + + Presence of wrong primary group for computers: {count} + + + The purpose is to check for unusual value in the primarygroupid attribute used to store group membership + + + Unless strongly justified, change the primary group id to its default. 513 or 514 for users, 516 or 521 for domain controllers, 514 or 515 for computers. The primary group can be edited in a friendly manner by editing the account with the "Active Directory Users and Computers" and after selecting the "Member Of" tab, "set primary group". + You can use the following script to list Users with a primary group id different from domain users: + <i>Get-ADUser -Filter * -Properties PrimaryGroup | Where-Object { $_.PrimaryGroup -ne (Get-ADGroup -Identity "Domain Users").DistinguishedName } | Select-Object UserPrincipalName,PrimaryGroup</i> + + + Presence of wrong primary group for users: {count} + + + The purpose is to ensure that there are as few inactive computers as possible within the domain + + + To mitigate the risk, you should monitor the number of inactive accounts and reduce it as much as possible. A list of all inactive accounts is obtainable through the command: <i>Search-ADAccount –AccountInActive –ComputersOnly –TimeSpan 180:00:00:00 –ResultPageSize 2000 –ResultSetSize $null | ?{$_.Enabled –eq $True} | Select-Object Name, SamAccountName, DistinguishedName</i>. + + + Relatively high number of inactive computer accounts: {count}% (more than {threshold}% of all computers) + + + The purpose is to ensure that there are as few inactive accounts as possible within the domain + + + To mitigate the risk, you should monitor the number of inactive accounts and reduce it as much as possible. A list of all inactive accounts is obtainable through the command: <i>Search-ADAccount –AccountInActive –UsersOnly –TimeSpan 180:00:00:00 –ResultPageSize 2000 –ResultSetSize $null | ?{$_.Enabled –eq $True} | Select-Object Name, SamAccountName, DistinguishedName</i>. + + + Relatively high number of inactive user accounts: {count}% (more than {threshold}% of all users) + + + The purpose is to ensure that a migration has been completed correctly and that the SIDHistory attribute has been cleared out from user and computer accounts. This attribute is indeed set when migrating a user or a computer from one domain to another + + + To solve the security issue, you should remove all the SIDHistory attributes. To do so, you can list the objects having an SIDHistory attribute using the command: <i>get-ADObject -ldapfilter "(sidhistory=*)" -properties sidhistory</i>. +Each security descriptor of the domain (including file shares for example) should be reviewed to be rewritten with the new SID of the account. Then, the attribute can be removed of these accounts using the migration tool or a PowerShell snippet <i>Remove-SIDHistory</i> once the migration is completed. Please note that once the SID History has been removed, it cannot be added back again without doing a real migration. Hopefully hacking tools such as mimikatz can be used to undo a deletion with for example the lsadump::dcshadow attack. + + + {count} domain(s) used in SIDHistory + + + SID: {0} Object(s): {1} + + + Check delegations for the recipient's existence + + + Check for Windows 2000 compatibility which allows access to the domain without any account + + + SIDHistory check + + + Check for Short password length in password policy + + + Check if Service Accounts are domain administrators + + + Check for Root Certificates using unsafe hashing algorithm (SHA1) + + + Check for Root Certificates using unsafe hashing algorithm (SHA0) + + + Check for Root Certificates using unsafe hashing algorithm (MD5) + + + Check for Root Certificates using unsafe hashing algorithm (MD4) + + + Check for Root Certificates using unsafe hashing algorithm (MD2) + + + Check for Reversible password used for computer accounts + + + Retrieve data from the domain without any account + + + Check the process of registration of computers to the domain + + + Check for presence of the Protected users group + + + Check that every account requires a password + + + Check the Password Policy for Service Accounts (Information) + + + Find Password GPO + + + Obsolete OS (Windows XP) + + + Obsolete OS (Windows NT) + + + Obsolete OS (Windows 2003) + + + Obsolete OS (Windows 2000) + + + Obsolete Domain Controller (Windows 2003) + + + Obsolete Domain Controller (Windows 2000) + + + Check for Number of Administrator accounts above the baseline + + + Check for Native administrator usage + + + Mitigate golden ticket attack via a regular change of the krbtgt password + + + Check for Intermediate Certificates using unsafe hashing algorithm (SHA1) + + + Check for Intermediate Certificates using unsafe hashing algorithm (SHA0) + + + Check for Intermediate Certificates using unsafe hashing algorithm (MD5) + + + Check for Intermediate Certificates using unsafe hashing algorithm (MD4) + + + Check for Intermediate Certificates using unsafe hashing algorithm (MD2) + + + Inactive computer check + + + Inactive Account check + + + Duplicate Account check + + + Check for Reversible password used for user accounts + + + Domain Controller Update + + + Check the use of Kerberos with weak encryption (DES algorithm) + + + DC Vulnerability (SMB v1) + + + DC Vulnerability (MS17-010) + + + DC Vulnerability (MS14-068) + + + Check if the LAPS tool to handle the native local administrator password is installed + + + Check if access to a restricted group is given to anyone by a GPO + + + Check for the last backup date according to Microsoft standard + + + Check for suspicious account(s) used in administrator activities + + + Check for GPO granting access to the domain without any account + + + Check for GPO enabling the unsafe algorithm LM hash + + + Check for GPO allowing accounts without password to be accessed from the network + + + Check for access without any account via a forest wide setting + + + Check for Certificates using a weak signing algorithm (RSA under 1024 bits) + + + At least one Domain controller is not owned correctly + + + At least one Administrator Account can be delegated + + + Check for inactive Administrator Accounts + + + Check for Accounts using Smart Card with unchanged password for a long time + + + Check for GPO which enable reversible passwords + + + A Delegation is granted to Everyone + + + A check is performed on non-admin accounts in order to identify if they have an attribute <i>admincount</i> set. If they have this attribute, it means that this account, which is not supposed to be admin, has been granted administrator rights in the past. This typically happens when an administrator gives temporary rights to a normal account, off process. + + + It is possible that domains are set to authorize connection without any account, which represents a security breach. It allows potential attackers to enumerate all the users and computers belonging to a domain, in order to identify very efficiently future weak targets. +It is possible to verify the results provided by the PingCastle solution by using a Kali distribution. You should run [rpcclient -U " target_ip_address] and press enter at the password prompt to finally type [enumdomusers]. + + + A verification is done on the backups, ensuring that the backup is performed according to Microsoft standards. Indeed at each backup the DIT Database Partition Backup Signature is updated.  If for any reasons, backups are needed to perform a rollback (rebuild a domain) or to track past changes, the backups will actually be up to date. This check is equivalent to a <i>REPADMIN /showbackup *</i>. + + + The way an Active Directory behaves can be controlled via the attribute <i>DsHeuristics</i> of <i>CN=Directory Service,CN=Windows NT,CN=Services,CN=Configuration</i>. A parameter stored in its attribute and whose value is <i>fLDAPBlockAnonOps</i> can be set to allow access without any account on the <b>whole forest level</b>. +It is possible to verify the results provided by the PingCastle solution by using a Kali distribution. You should run <i>rpcclient -U " target_ip_address</i> and press enter at the password prompt to finally type <i>enumdomusers</i>. + + + Kerberos is an authentication protocol. It is using to sign its tickets a secret stored as the password of the krbtgt account. If the hash of the password of the krbtgt account is retrieved, it can be use to generate authentication tickets at will. +To mitigate this attack, it is recommended to change the krbtgt password between 40 days and 6 months. If it not the case, every backup done until the last password change of the krbtgt account can be used to emit Golden tickets, compromising the entire domain. +Retrieval of this secret is one of the highest priority in an attack, as this password is rarely changed and offer a long term backdoor. +Also this attack can be performed using the former password of the krbtgt account. That's why the krbtgt password should be changed twice to invalidate its leak. + + + LAPS (Local Administrator Password Solution) is the advised solution to handle passwords for the native local administrator account on all workstations, as it is a simple way to handle most of the subject. + + + This rule verifies if there is a GPO with the setting "Limit local account use of blank passwords to console logon only" disabled. + + + LM hash, or LAN Manager hash is a hash algorithm developed by Microsoft since Windows 3.1. Due to flaw design, hashes retrieved from the network can be reverted to the clear text password in a matter of seconds. + + + The MD2 hashing algorithm is not considered as safe. There are design flaws inherent to the algorithm that allow an attacker to generate a hash collision in less than a brute-force time + + + The MD2 hashing algorithm is not considered as safe. There are design flaws inherent to the algorithm that allow an attacker to generate a hash collision in less than a brute-force time. Nevertheless, the root certificate algorithm has no direct impact on the security, but it can be used indirectly to force the use of this algorithm in the issued certificate + + + The MD4 hashing algorithm is not considered as safe. There are design flaws inherent to the algorithm that allow an attacker to generate a hash collision in less than a brute-force time + + + The MD4 hashing algorithm is not considered as safe. There are design flaws inherent to the algorithm that allow an attacker to generate a hash collision in less than a brute-force time. Nevertheless, the root certificate algorithm has no direct impact on the security, but it can be used indirectly to force the use of this algorithm in the issued certificate + + + The MD5 hashing algorithm is not considered as safe. There are design flaws inherent to the algorithm that allow an attacker to generate a hash collision in less than a brute-force time + + + The MD5 hashing algorithm is not considered as safe. There are design flaws inherent to the algorithm that allow an attacker to generate a hash collision in less than a brute-force time. Nevertheless, the root certificate algorithm has no direct impact on the security, but it can be used indirectly to force the use of this algorithm in the issued certificate + + + It is possible that a GPO add local membership of a restricted group. In this case the rule trigger if one is found with "Everyone" or "Authenticated Users" as members. It basically means that the Restricted Group has no restriction on belongs to it. This represents a security risk as Restricted Group are supposed to have more accesses or rights + + + A check is performed to identify if the GPO regarding password policy allows less than 8 characters password. Short passwords represents a high risk because they can fairly easily be brute-forced. Most CERT and agencies advises for at least 8 characters (and often this number goes up to 12) + + + The rule is purely informative, as it gives insights regarding a best practice. It verifies if there is a GPO or PSO enforcing a 20+ characters password for the Service Account. + + + Unless other rules which check for known cause of anonymous access, this rule tries to enumerate accounts from the domain without any account. The program use two methods: MS-SAMR with a NULL connection and MS-LSAT which forces SID resolution with well known SID. +NULL sessions are deactivated by default since Windows 2003 and Windows XP. For compatibility reasons a setting enabling them may be still active years after. +It is possible to verify the results provided by the PingCastle solution by using a Kali distribution. You should run [rpcclient -U " target_ip_address] and press enter at the password prompt to finally type [enumdomusers]. + + + When a Windows 2003 DC is promoted, a pre-Windows 2000 compatibility setting can be enabled through the wizard. If it is enabled, the wizard will add "Everyone" and "Anonymous" to the pre-Windows 2000 compatible access group, and by doing so, it will authorize the domain to be queried without an account (null session) +It is possible to verify the results provided by the PingCastle solution by using a Kali distribution. You should run [rpcclient -U " target_ip_address] and press enter at the password prompt to finally type [enumdomusers]. + + + The Protected Users group is a special group which is a very effective mitigation solution to counter attacks using Credential theft starting with Windows 8.1. Older Operating System must be updated to take this protection in account such as the <b>Windows 7 KB2871997</b> patch. + + + A check is performed to identify passwords in the GPO. If a password is identified through the PingCastle solution, it means that it can be identified through many other means by attackers, and that the account should be considered compromised. +Do note that the AES key used to encrypt passwords in GPOs has been made public for interoperability reasons, which is why even an encrypted password is compromised. It has been revealed in <a href="https://msdn.microsoft.com/en-us/library/cc422924.aspx">this page</a> + + + The policy "Store passwords using reversible encryption" is enabled. In this case, it means that the password is actually stored in clear text in the <i>supplementalCredential</i> attribute of the account and that it can be retrieved using DCSync attack. + + + The SHA0 hashing algorithm is not considered as safe. There are design flaws inherent to the algorithm that allow an attacker to generate a hash collision in less than a brute-force time + + + The SHA0 hashing algorithm is not considered as safe. There are design flaws inherent to the algorithm that allow an attacker to generate a hash collision in less than a brute-force time + + + The SHA1 hashing algorithm is not considered as safe. There are design flaws inherent to the algorithm that allow an attacker to generate a hash collision in less than a brute-force time + + + The SHA1 hashing algorithm is not considered as safe. There are design flaws inherent to the algorithm that allow an attacker to generate a hash collision in less than a brute-force time + + + Using Smart Card to protected sensitive account is a good thing. Nevertheless, when the "Smart Card required" flag is set, the password of the account is not changed anymore by default. Internally the hash of this password is used to sign the user's kerberos tickets, making this account vulnerable to Silver ticket attacks. The rule is triggered 90 days after the last change of the attribute unicodePwd. This value is collected using the replication metadata of the attribute 589914 + + + A RSA key certificate with a modulus under 1024 bits is considered as not safe + + + The Native Administrator account is the main administrator account, and it is sharing its password with Directory Services Restore Mode password. Since it is the same password, it can be used to take control of the domain even if the account is disabled, notably through a DSync attack. The last login date is retrieved through the LastLogonTimestamp LDAP attribute retrieved from the Active Directory. There is an exception for 35 days to avoid this rule to be triggered at the domain creation. + + + Every domain administrator represents a possible security breach, this is why it is strongly advised to have as few domain administrator accounts as possible + + + The right "REANIMATE_TOMBSTONE" used to undelete objects, "UNEXPIRE_PASSWORD" used to undo the expiration of a password, or "SID_HISTORY" used to create an alternate identity is considered dangerous. Indeed this rights can be used to trigger a backdoor. + + + By default, the "Domain Administrators" group or the "Enterprise Administrators" group are set as owners for "Domain Controllers". Nonetheless, in some cases (for instance when the server has been promoted from an existing server), the owner can be a non-admin person which joined the server to the domain. If this person has still rights over this account, it can be used to take ownership over the whole domain. A chain of compromising events can be designed to take control of the domain by including this account. + + + Without the flag "This account is sensitive and cannot be delegated" any account can be impersonated by some service account. It is a best practice to enforce this flag on administrators accounts. + + + To delegate control to a OU, access checks can be modified. In case of a misconfiguration, access can be granted to the group "Everyone" or "Authenticated Users". + + + Accounts within the AD have attributes indicating the creation date of the account and the last login of this account. Accounts which haven't have a login since 6 months or created more than 6 months ago without any login are considered inactive. If an Administrator Account is set as inactive, the reason for having Administrator rights should be strongly justified. + + + The group "Schema Admins" is used to give permissions to alter the schema. Once a modification is performed on the schema such as new objects, it cannot be undone. This can result in a rebuild of the domain. The best practice is to have this group empty and to add an administrator when a schema update is required then to remove this group membership. + + + "Service Accounts" can imply a high security risk as their password are stored in clear text in the LSA database, which can then be easily exploited using Mimikatz or Cain&Abel for instance. In addition, their passwords don't change and can be used in kerberoast attacks. + + + In the case where a delegation has been created where the account can't be translated to a NT account, it means that the delegation is actually from another domain or that the user has been deleted. + + + By default, a basic user can register up to 10 computers within the domain. This default configuration represents a security issue as basic users shouldn't be able to create such accounts and this task should be handled by administrators. + + + Inactive computers often stay in the network because of weaknesses in the decommissioning process. These stale computer accounts can be used as backdoors and therefore represents a possible security breach. + + + In Active Directory, group membership is stored on the "members" attribute and on the "primarygroupid" attribute. + The default primary group value is "Domain Users" for the users, "Domain Computers" for the computers and "Domain Controllers" for the domain controllers. + The primarygroupid contains the RID (last digits of a SID) of the group targeted. It can be used to store hidden membership as this attribute is not often analyzed. + This rule can also be triggered if one domain controller is not in the default container (named "Domain Controllers" and located at the root) which is not a recommended practice. + + + + It is possible that domains have accounts with an encryption that can be reversed. In this case, it means that the password is actually stored in clear text in the <i>supplementalCredential</i> attribute of the account and that it can be retrieved using DCSync attack + + + The OS Windows 2000 as a DC is vulnerable to many publicly known exploits such as MS17-010 or MS14-068 and it can no longer be patched. A domain running this OS version should be considered compromised + + + The OS Windows 2003 as a DC is vulnerable to many publicly known exploits such as MS14-068 and it is very complicated to patch it at this date. A domain running this OS version should be considered compromised + + + Domain Controller needs to be updated regularly because threats to the AD evolve all the time, so assets in the AD should evolve accordingly. The date of last update is computed by getting the <i>StatisticsStartTime</i> from <i>[net statistics workstation]</i>. If not available, the PingCastle solution will use the <i>lastLogonTimestamp</i> attribute which is refreshed based on the LastLogon attribute. Do note that there is a maximum delay for refresh: 14 days. + + + When multiple sites are created in a domain, networks should be declared in the domain in order to optimize processes such as DC attribution. In addition, PingCastle can collect the information to be able to build a network map. This rule has been triggered because at least one domain controller has an IP address which was not found in subnet declaration. These IP addresses have been collected by querying the DC FQDN IP address in both IPv6 and IPv4 format. + + + DES is very weak algorithm and once assigned to an account, it can be used in Kerberos ticket requests, even though it is easily breakable. It represents a security risk for the kerberos ticket, therefore for the whole AD. + + + To migrate accounts to another domain, the attribute SID History should be added to the new account. Despite the fact that numerous hacking tools such as mimikatz allows the creation of the SID History attribute, its official creation requires the presence of a special auditing group named DOMAIN-$$$ such as TEST-$$$ for the TEST domain. + + + In order to identify a duplicate account, a check is performed on the "DN" and the "sAMAccountName". Indeed, when a DC detects a conflict, there is a replacement performed on the second object + + + Inactive accounts often stay in the network because of weaknesses in the decommissioning process. These stale computer accounts can be used as backdoors and therefore represents a possible security breach. + + + The Windows 2000 OS is not supported any longer, as it is vulnerable to many publicly known exploits: Administrator's credentials can be captured, security protocols are weak, etc. + + + The Windows 2003 OS is not supported any longer, as it is vulnerable to many publicly known exploits: Administrator's credentials can be captured, security protocols are weak, etc. + + + The Windows NT OS is not supported any longer, as it is vulnerable to many publicly known exploits: Administrator's credentials can be captured, security protocols are weak, etc. + + + + The Windows XP OS is not supported any longer, as it is vulnerable to many publicly known exploits: Administrator's credentials can be captured, security protocols are weak, etc. + + + In Active Directory, group membership is stored on the "members" attribute and on the "primarygroupid" attribute. The default primary group value is "Domain Users" for the users, "Domain Computers" for the computers and "Domain Controllers" for the domain controllers. The primarygroupid contains the RID (last digits of a SID) of the group targeted. It can be used to store hidden membership as this attribute is not often analyzed. + + + An account can be set without a password if it has the flag "PASSWD_NOTREQD" set as "True" in the "useraccountcontrol" attribute. This represents a high security risk as the account is not protected at all without a password + + + It is possible that domains have accounts with an encryption that can be reversed. In this case, it means that the password is actually stored in clear text in the <i>supplementalCredential</i> attribute of the account and that it can be retrieved using DCSync attack + + + The SIDHistory attribute is useful when doing a migration because it allows to keep the reference to the former account. On the other hand, once the migration is over, it is mandatory that this attribute is removed to evaluate the permissions in regards with the new account and not the former one. + + + The SMB downgrade attack is used to obtain credentials or executing commands on behalf of a user by using SMB v1 as protocol. Indeed, because SMB v1 supports old authentication protocol, the integrity can be bypassed + + + MS14-068 is a critical vulnerability that was published on November, 18th 2014. It can be used to very quickly compromise an entire domain, which is why having DC still vulnerable to this publicly known vulnerability represents a high security risk. + + + MS17-010 is a critical vulnerability that was published on March, 14th 2017. It can be used to compromise an entire domain via DC compromise. This exploit has been revealed by the Shadow brokers (EternalBlue, EternalRomance, EternalSinergy) and it uses the SMB v1 vulnerability + + + A Downlevel trust is a special kind of trust compatible with NT4. The kind of trust can be displayed in the "Active Directory Domains and Trusts" tool. + + + When a trust is active, it is using a shared secret to communicate to a domain. This secret is hold in a special account whose name is the remote domain name. This password is changed every month and as consequence the whenChanged attribute of this account is changed. When there is no modification of the whenChanged attribute, it can be guessed that the secret has not being changed and that there was either a problem with the remote domain or that the remote domain does not exist anymore. + + + Login script can be stored in any file share available in the network and that includes trusted domains shares. If a login script is located in a compromise domain, it can be used to compromise other domains. + + + SID Filtering is a mechanism used to block account presenting a SID History property. SID History is used to link an existing account to another account and can be use to propagate a compromise through trusts. SID Filtering for domain to domain trust is called a quarantine and is disabled by default. SID Filtering to a forest is enabled by default and disabling it is called "enabling SID History". + +The algorithm to compute the SID Filtering is: +get the attribute trustDirection and TrustAttributes of the trust object. +if the direction is 0 or 1 or if the trust is intra forest (trustattributes & 32 != 0) then SID Filtering is not applicable. +Then, if the trust is a forest trust (trusattributes & 8 != 0) then +check if /enablesidhistory has been enabled - trustattributes & 64 != 0. +If enabled: SID Filtering is deactivated. +Else if not a forest trust (trustattributes & 8 == 0) then check for the quarantined attribute (trustattributes & 4 != 0). +If the quarantine flag is set, SID Filtering is enabled. + +You can use the PowerShell command to get its status: +<i>[System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain().GetSidFilteringStatus('my.domain.to.test.local')</i> + + + + SID History is an attribute used in migration to link with a former account. It is not possible to have an account linked with an account belonging to the same domain. This can be analyzed by comparing the domain part of the SID History with the domain SID. + + + When accounts are migrated from one domain to another, the attribute SID History can be appended to the new account to keep track of its former account. The origin can be tracked by removing the last digit of the SID to guess the SID of the origin domain. If the SID of the origin domain cannot be resolved, that means that the domain has been removed and as consequence that the SID History is not needed. This SID History information can be used to give additional rights and thus alter the real security rights. + + + https://msdn.microsoft.com/en-us/library/ms675212(v=vs.85).aspx + + + https://technet.microsoft.com/en-us/library/cc963223.aspx https://technet.microsoft.com/en-us/library/jj852184.aspx + + + https://technet.microsoft.com/en-us/library/jj130668(v=ws.10).aspx + + + https://msdn.microsoft.com/en-us/library/cc223560.aspx +https://support.microsoft.com/en-us/help/326690/anonymous-ldap-operations-to-active-directory-are-disabled-on-windows + + + https://techcommunity.microsoft.com/t5/core-infrastructure-and-security/faqs-from-the-field-on-krbtgt-reset/ba-p/2367838 +https://github.com/microsoft/New-KrbtgtKeys.ps1 +https://github.com/PSSecTools/Krbtgt + + + https://www.microsoft.com/en-us/download/details.aspx?id=46899 + + + https://technet.microsoft.com/en-us/library/jj852174.aspx + + + + + + https://www.ssi.gouv.fr/archive/fr/sciences/fichiers/lcr/mu04c.pdf + + + https://www.ssi.gouv.fr/archive/fr/sciences/fichiers/lcr/mu04c.pdf + + + https://tools.ietf.org/html/rfc6150 + + + https://tools.ietf.org/html/rfc6150 + + + https://www.kb.cert.org/vuls/id/836068 + + + https://www.kb.cert.org/vuls/id/836068 + + + http://social.technet.microsoft.com/wiki/contents/articles/20402.active-directory-group-policy-restricted-groups.aspx + + + https://www.microsoft.com/en-us/research/publication/password-guidance/ + + + https://www.microsoft.com/en-us/research/publication/password-guidance/ + + + https://www.sans.org/reading-room/whitepapers/windows/null-sessions-nt-2000-286 + + + https://msdn.microsoft.com/en-us/library/cc223672.aspx + + + https://docs.microsoft.com/en-us/windows-server/security/credentials-protection-and-management/protected-users-security-group + + + https://msdn.microsoft.com/en-us/library/cc422924.aspx + + + https://docs.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/store-passwords-using-reversible-encryption + + + https://tools.ietf.org/html/rfc6194 + + + https://tools.ietf.org/html/rfc6194 + + + https://tools.ietf.org/html/rfc6194 + + + https://tools.ietf.org/html/rfc6194 + + + https://blogs.technet.microsoft.com/positivesecurity/2017/05/17/smartcard-and-pass-the-hash/ + + + https://www.iad.gov/iad/library/ia-guidance/ia-solutions-for-classified/algorithm-guidance/commercial-national-security-algorithm-suite-factsheet.cfm + https://www.ssi.gouv.fr/guide/cryptographie-les-regles-du-rgs/ + + + https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/plan/security-best-practices/implementing-least-privilege-administrative-models + + + https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/plan/security-best-practices/implementing-least-privilege-administrative-models + + + https://technet.microsoft.com/en-us/library/ff405676.aspx + + + + + + + + + + + + + + + + + + + + + + + + https://docs.microsoft.com/troubleshoot/windows-server/identity/default-workstation-numbers-join-domain +http://prajwaldesai.com/allow-domain-user-to-add-computer-to-domain/ +http://blog.backslasher.net/preventing-users-from-adding-computers-to-a-domain.html + + + + + + + + + + + + + + + + + + + + + + + + https://docs.microsoft.com/en-us/archive/blogs/openspecification/msds-supportedencryptiontypes-episode-1-computer-accounts + + + + + + + + + + + + + + + + + + + + + + + + + + + https://docs.microsoft.com/troubleshoot/windows-server/identity/useraccountcontrol-manipulate-account-properties + + + + + + + + + https://github.com/lgandx/Responder-Windows +https://blogs.technet.microsoft.com/josebda/2015/04/21/the-deprecation-of-smb1-you-should-be-planning-to-get-rid-of-this-old-smb-dialect +https://docs.microsoft.com/windows-server/storage/file-server/troubleshoot/detect-enable-and-disable-smbv1-v2-v3 + + + https://technet.microsoft.com/en-us/library/security/ms14-068.aspx + + + https://blogs.technet.microsoft.com/msrc/2017/04/14/protecting-customers-and-evaluating-risk/ +https://github.com/misterch0c/shadowbroker/tree/master/windows/exploits + + + https://msdn.microsoft.com/en-us/library/cc223771.aspx + + + https://msdn.microsoft.com/fr-fr/library/ms680921(v=vs.85).aspx + + + + + + https://msdn.microsoft.com/en-us/library/cc237940.aspx + + + + + + + + + Check if the file share protocol can sign its network dialog + + + Check if the file share protocol requires its client to sign its network dialog + + + Check for Dangerous rights found in OU delegation + + + Avoid unexpected schema modifications which could result in domain rebuild + + + Check for hidden group membership for computer accounts + + + Check for completeness of network declaration + + + Check if a migration is in progress + + + Check for hidden group membership for user accounts + + + Check for trusts compatible with NT4 + + + Check for inactive trusts + + + Check if login scripts may be located in a trusted domain + + + Check for Trusts whose security is not maximum + + + Check for local backdoor stored in SID History + + + Check if the account has been migrated from a domain which doesn't exist anymore + + + Python responder is a tool used to compromise a domain by listening for SMB connections and injecting rogue data into the communications at the network level. SMB v1 does not provide a mechanism to enforce integrity and thus is compromised easily. SMB v2 (and subsequent version SMB v3) provides a way to guarantee the integrity of the network communication via a signature of each packet. By establishing a SMB v2 dialog with domain controllers, PingCastle checks the signature capability by looking at the SMB options provided by the server. + + + Python responder is a tool used to compromise a domain by listening for SMB connections and injecting rogue data into the communications at the network level. SMB v1 does not provide a mechanism to enforce integrity and thus is compromised easily. SMB v2 (and subsequent version SMB v3) provides a way to guarantee the integrity of the network communication via a signature of each packet. By establishing a SMB v2 dialog with domain controllers, PingCastle checks the signature capability by looking at the SMB options provided by the server. + + + https://msdn.microsoft.com/en-us/library/cc246675.aspx + + + https://msdn.microsoft.com/en-us/library/cc246675.aspx + + + The purpose is to ensure that all accounts do support kerberos pre-authentication + + + http://www.harmj0y.net/blog/activedirectory/roasting-as-reps/ + + + Number of accounts which do not require kerberos pre-authentication: {count} + + + Edit the property of the involved accounts and select the Account tab. Uncheck "Do not require Kerberos preauthentication". For computers which doesn't have the Account tab, you have to manually edit the attribute useraccountcontrol. Subtract from the attribute the value 4194304. + + + Without kerberos pre-authentication, an attacker can request kerberos data from the domain controller and use this data to brute-force the account password. You can search accounts using the ldap query <i>Get-ADObject -LDAPFilter "(userAccountControl:1.2.840.113556.1.4.803:=4194304)"</i> + + + Check if all accounts do support kerberos pre-authentication + + + The purpose is to ensure that standard users cannot modify login scripts + + + + + + Number of login scripts that can be modified by any user: {count} + + + Edit the Access Control List (ACL) of the script object or the directory where the file is located. Then remove any write permission given to the group. + + + When the group Authenticated Users, Everyone or any similar groups have permission to modify a login script, it can be abused to take control of the accounts using this script. It can potentially lead to the compromise of the domain + + + Ensure that all login scripts cannot be modified by any user + + + Script: {0} Account: {1} Right: {2} + + + Ensure that the printer spooler cannot be abused to get the DC Credentials + + + The purpose is to ensure that credentials cannot be extracted from the DC via its printer spooler + + + The spooler service should be deactivated on domain controllers. Please note as a consequence that the Printer Pruning functionality (rarely used) will be unavailable. + + + The spooler service is remotely accessible from {count} DC + + + When there’s an account with unconstrained delegation configured (which is fairly common) and the Print Spooler service running on a computer, you can get that computers credentials sent to the system with unconstrained delegation as a user. With a domain controller, the TGT of the DC can be extracted allowing an attacker to reuse it with a DCSync attack and obtain all user hashes and impersonate them. + + + Domain controller: {0} + + + https://adsecurity.org/?p=4056 +https://www.slideshare.net/harmj0y/derbycon-the-unintended-risks-of-trusting-active-directory + + + Ensure that there are enough DCs to provide basic redundancy + + + The purpose is to ensure the failure of one domain controller will not stop the domain. + + + Increase the number of domain controllers by installing new ones. + + + The number of DCs is too small to provide redundancy: {count} DC + + + A single domain controller failure can lead to a lack of availability of the domain if the number of servers is too low. To have a minimum redundancy, the number of DC should be at least 2. For Labs, this rule can be ignored and you can add this rule into the exception list. + + + https://social.technet.microsoft.com/wiki/contents/articles/14355.capacity-planning-for-active-directory-domain-services.aspx + + + Ensure that no accounts are subject to unconstrained delegation + + + The purpose is to ensure no account can impersonate any account. + + + Replace unconstrained delegation by constrained delegation. In practice, on the account object, tab "delegation", replace "trust this computer for delegation to any service" by "trust this computer for delegation to specified services only". + + + Unconstrained delegations are configured on the domain: {count} account(s) + + + When an unconstrained delegation is configured, the kerberos ticket TGT can be captured. This TGT grant then access to any service the user has access. If the user is an administrator or a domain controller (a connection can be forced using the spooler service), the domain can be compromised. + + + https://blogs.technet.microsoft.com/389thoughts/2017/04/18/get-rid-of-accounts-that-use-kerberos-unconstrained-delegation/ +https://adsecurity.org/?p=1667 + + + DN: {0} Name: {1} + + + Ensure that Exchange did not modify the AdminSDHolder object to introduce vulnerabilities + + + The purpose is to ensure that no weakness has been introduced at Exchange installation. + + + After having carefully studied the possible impact of the following change, alter the AdminSDHolder permissions to remove the Exchange objects. + + + Exchange did alter the AdminSDHolder object + + + At install time, the Exchange Windows Permissions universal security group (USG) was granted the ability to modify the members attribute, the ability to change and reset passwords, and the ability to modify the permissions of any object protected by the AdminSDHolder role. + This security group includes all the Exchange servers. + As a consequence, a malicious administrator could elevate their privileges on one of the servers and thus gain control of the Active Directory forest. + Newest versions of Exchange do not introduce this security vulnerability. + + + https://blogs.technet.microsoft.com/exchange/2009/09/23/exchange-2010-and-resolution-of-the-adminsdholder-elevation-issue/ + + + Ensure that bogus Windows 2016 AD prep did not introduce vulnerabilities + + + The purpose is to ensure that no weaknesses have been introduced following a Windows 2016 installation. + + + After having carefully studied the possible impact of the following change, apply the script made by MSRC and referenced in the documentation below to alter the permission. + + + A bogus Windows 2016 installation has granted too many rights to the Enterprise Key Admins group + + + After performing adprep /domainprep from Windows Server 2016 sources there may be an unwanted AccessControlEntry (ACE) in the DiscretionaryACL (DACL) of the targeted domain-naming-context's SecurityDescriptor (SD) that grants FullControl permission to the Enterprise Key Admins group ( SID = ending with -527 ). +This is s a bug in ADPREP that was fixed in Windows Server 2016 RS3/1709. No official fix for those who used pre-1709. +Note: The SID will only be resolvable after the PDC emulator role is transferred to a Windows Server 2016 domain controller. + + + + DN: {0} Account: {1} Right: {2} + + + https://itpro-tips.com/wp-content/uploads/files/TechnetGallery/Enterprise-Key-Admins-720eb270.zip +https://secureidentity.se/adprep-bug-in-windows-server-2016/ + + + The purpose is to ensure that the operator groups, which can have indirect control to the domain, are empty + + + Group: {0} Members: {1} + + + + + + {count} operator group(s) are not empty + + + It is recommended to have these groups empty. Assign administrators into administrators group. Other accounts should have proper delegation rights in an OU or in the scope they are managing. + + + Operator groups (account operators, server operators, ...) can take indirect control of the domain. Indeed these groups have write access to critical resources of the domain. + + + Check that operators group are empty + + + The purpose is to ensure that standard users cannot modify GPO + + + + + + Number of GPO items that can be modified by any user: {count} + + + Edit the Access Control List (ACL) of the GPO object or the directory where the items is located. Then remove any write permission given to the group. + + + When the group Authenticated Users, Everyone or any similar groups have permission to modify a GPO, it can be abused to take control of the accounts where this GPO applies. It can potentially lead to the compromise of the domain + + + Ensure that GPO items cannot be modified by any user + + + GPO: {0} Item: {1} Account: {2} Right: {3} + + + The purpose is to ensure that standard users are not granted dangerous privileges + + + https://www.romhack.io/slides/RomHack%202018%20-%20Andrea%20Pierini%20-%20whoami%20priv%20-%20show%20me%20your%20Windows%20privileges%20and%20I%20will%20lead%20you%20to%20SYSTEM.pdf +https://www.tarlogic.com/en/blog/abusing-seloaddriverprivilege-for-privilege-escalation/ +https://github.com/decoder-it/psgetsystem +https://twitter.com/0gtweet/status/1303427935647531018?s=20 + + + Number of privileges granted by GPO to any user: {count} + + + Locate the GPO specified in Details and remove the privilege. +Most of the settings are located in : + Computer configuration -> Policies -> Windows Settings ->Security Settings -> Local Policies -> User Rights Assignment. +As an alternative, the file GptTmpl.inf can be manually edited. + + + To perform special operations, the operating system relies on privileges. They can be displayed by running the command: whoami /all. +SeLoadDriverPrivilege can be used to take control of the system by loading a specifically designed driver. This procedure can be performed by low privileged users as the driver can be defined in HKCU. +SeTcbPrivilege is the privilege used to "Act on behalf the operating system". This is the privilege reserved to the SYSTEM user. This procedure allow any users to act as SYSTEM. +SeDebugPrivilege is the privilege used to debug program and to access any program's memory. It can be used to create a new process and set the parent process to a privileged one. +SeRestorePrivilege can be used to modify a service running as local system and startable by all users to a chosen one. +SeBackupPrivilege can be used to backup Windows registry and use third party tools for extracting local NTLM hashes. +SeTakeOwnershipPrivilege can be used to take ownership of any secureable object in the system including a service registry key. Then to change its ACL to define its own service running as LocalSystem. +SeCreateTokenPrivilege can be used to create a custom token with all privileges and thus be abused like SeTcbPrivilege +SeImpersonatePrivilege and SeAssignPrimaryTokenPrivilege can be abused to impersonate privileged tokens. These tokens can be retrieved by establishing security context such as Local DCOM DCE/RPC reflexion. +SeSecurityPrivilege can be use to clear the security event log and shrink it to make events flushed soon. Also read security log and view events where the user inverted the login and its password. +SeManageVolumePrivilege can be use to reset the security descriptor on the C volume and thus, change the inherited permissions to critical files + + + Ensure that dangerous privileges are not granted to everyone by GPO + + + GPO: {0} Account: {1} Privilege: {2} + + + The detail can be found in the <a href="#admincountequalsone">AdminSDHolder User List</a> + + + The detail can be found in <a href="#lsasettings">Security settings</a> + + + The detail can be found in <a href="#backup">Backup</a> + + + The detail can be found in <a href="#certificates">Certificates</a> + + + The detail can be found in <a href="#certificates">Certificates</a> + + + The detail can be found in <a href="#certificates">Certificates</a> + + + The detail can be found in <a href="#certificates">Certificates</a> + + + The detail can be found in <a href="#certificates">Certificates</a> + + + The detail can be found in <a href="#certificates">Certificates</a> + + + The detail can be found in <a href="#certificates">Certificates</a> + + + The detail can be found in <a href="#certificates">Certificates</a> + + + The detail can be found in <a href="#certificates">Certificates</a> + + + The detail can be found in <a href="#certificates">Certificates</a> + + + The detail can be found in <a href="#certificates">Certificates</a> + + + The detail can be found in <a href="#domaincontrollersection">Domain controllers</a> + + + The detail can be found in <a href="#krbtgt">Krbtgt</a> + + + The detail can be found in <a href="#laps">LAPS</a> + + + The detail can be found in <a href="#lsasettings">Security settings</a> + + + The detail can be found in <a href="#passwordpolicies">Password policies</a> + + + The detail can be found in <a href="#domaincontrollersection">Domain controllers</a> + + + The detail can be found in <a href="#domaincontrollersection">Domain controllers</a> and <a href="#nullsession">Null Session</a> + + + The detail can be found in the <a href="#gpoobfuscatedpassword">Obfuscated Passwords</a> + + + The detail can be found in <a href="#lsasettings">Security settings</a> + + + The detail can be found in <a href="#lsasettings">Security settings</a> + + + The schema version is indicated in <a href="#domaininformation">Domain Information</a> + + + The detail can be found in <a href="#passwordpolicies">Password Policies</a> + + + The detail can be found in <a href="#smartcardmandatorywithnopasswordchange">Smart Card and Password</a> + + + The detail can be found in <a href="#domaincontrollersection">Domain controllers</a> + + + The detail can be found in <a href="#domaincontrollersection">Domain controllers</a> + + + The detail can be found in <a href="#admingroups">Admin Groups</a> + + + The detail can be found in <a href="#admindelegation">Delegations</a> + + + The detail can be found in <a href="#domaincontrollersection">Domain controllers</a> + + + The detail can be found in <a href="#admingroups">Admin Groups</a> + + + The detail can be found in <a href="#admindelegation">Delegations</a> + + + The detail can be found in <a href="#admindelegation">Delegations</a> + + + The detail can be found in <a href="#gpologin">GPO Login script</a> + + + The detail can be found in <a href="#admindelegation">Delegations</a> + + + The detail can be found in <a href="#admingroups">Admin Groups</a> + + + The detail can be found in <a href="#gpoprivileges">Privileges</a> + + + The detail can be found in <a href="#admingroups">Admin Groups</a> + + + The detail can be found in <a href="#admingroups">Admin Groups</a> + + + The detail can be found in <a href="#useraccountanalysis">User information</a> and <a href="#computeraccountanalysis">Computer information</a> + + + The detail can be found in <a href="#admindelegation">Delegations</a> + + + The detail can be found in <a href="#domaincontrollersection">Domain controllers</a> + + + The detail can be found in <a href="#domaincontrollersection">Domain controllers</a> + + + The detail can be found in <a href="#useraccountanalysis">User information</a> and <a href="#computeraccountanalysis">Computer information</a> + + + The detail can be found in <a href="#useraccountanalysis">User information</a> and <a href="#computeraccountanalysis">Computer information</a> + + + The detail can be found in <a href="#useraccountanalysis">User information</a> and <a href="#computeraccountanalysis">Computer information</a> + + + The detail can be found in <a href="#useraccountanalysis">User information</a> and <a href="#computeraccountanalysis">Computer information</a> + + + The startup time of domain controllers can be found in <a href="#domaincontrollersection">Domain controllers</a> + + + The startup time of domain controllers can be found in <a href="#domaincontrollersection">Domain controllers</a> + + + The detail can be found in <a href="#operatingsystems">Operating Systems</a> + + + The detail can be found in <a href="#operatingsystems">Operating Systems</a> + + + The operating system of domain controllers can be found in <a href="#domaincontrollersection">Domain controllers</a> + + + The operating system of domain controllers can be found in <a href="#domaincontrollersection">Domain controllers</a> + + + The detail can be found in <a href="#operatingsystems">Operating Systems</a> + + + The detail can be found in <a href="#operatingsystems">Operating Systems</a> + + + The detail can be found in <a href="#useraccountanalysis">User information</a> and <a href="#computeraccountanalysis">Computer information</a> + + + The detail can be found in <a href="#useraccountanalysis">User information</a> and <a href="#computeraccountanalysis">Computer information</a> + + + The detail can be found in <a href="#useraccountanalysis">User information</a> and <a href="#computeraccountanalysis">Computer information</a> + + + The detail can be found in <a href="#useraccountanalysis">User information</a> and <a href="#computeraccountanalysis">Computer information</a> + + + The detail can be found in <a href="#useraccountanalysis">User information</a> and <a href="#computeraccountanalysis">Computer information</a> + + + The SIDHistory detail can be found in <a href="#useraccountanalysis">User information</a> and <a href="#computeraccountanalysis">Computer information</a> and a quick summary in <a href="#sidhistory">SID History</a> + + + The detail can be found in <a href="#domaincontrollersection">Domain controllers</a> + + + The detail can be found in <a href="#discovereddomains">Trusts section</a> + + + The detail can be found in <a href="#discovereddomains">Trusts section</a> + + + The detail can be found in <a href="#gpologin">GPO Login script</a> and in <a href="#logonscripts">Logon Scripts</a> + + + The detail can be found in <a href="#discovereddomains">Trusts section</a> + + + The SIDHistory detail can be found in <a href="#useraccountanalysis">User information</a> and <a href="#computeraccountanalysis">Computer information</a> and a quick summary in <a href="#sidhistory">SID History</a> + + + The SIDHistory detail can be found in <a href="#useraccountanalysis">User information</a> and <a href="#computeraccountanalysis">Computer information</a> and a quick summary in <a href="#sidhistory">SID History</a> + + + The purpose is to ensure that Exchange Installation did not introduce privilege escalation vulnerabilites by modifying domain permissions + + + https://github.com/gdedrouas/Exchange-AD-Privesc/blob/master/DomainObject/Fix-DomainObjectDACL.ps1 +https://blogs.technet.microsoft.com/exchange/2019/02/12/released-february-2019-quarterly-exchange-updates/ +https://support.microsoft.com/en-us/help/4490059/using-shared-permissions-model-to-run-exchange-server + + + The group Exchange Windows Permissions has the right to change the security descriptor of the domain root + + + Edit the root domain security descriptor. Identify the ACE giving the right ModifyDACL to the principal Exchange Windows Permissions. Go to the advanced settings and set the inheritance to Inherit Only. + +Or run the powershell script Fix-DomainObjectDACL.ps1 referenced below. + + + When Exchange is installed, a set of permissions is modified to allow a deep Windows integration. A dependancy analysis has shown that the permissions that Exchange set introduce privilege escalation. + The most basic exploitation is that a member of the group Exchange Windows Permissions can modified the security permission of the domain, granting itself the right Ds-Replication-Get-Changes-All. + This right allows the account to perform an attack named DCSync which retrieve the hash of the krbtgt account. With this hash, the attacker can then create a golden ticket and impersonate silently any user of the domain. + + + + Ensure that Exchange did not introduce security vulnerabilities + + + The purpose is to ensure that standard users cannot login to Domain Controllers + + + https://docs.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/allow-log-on-locally +https://docs.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/allow-log-on-through-remote-desktop-services +https://support.hpe.com/hpsc/doc/public/display?docId=emr_na-c04197764-1 + + + Anyone can interactively or remotely login to a DC + + + Locate the GPO specified in Details and remove the privilege "Allow log on locally" or "Allow log on through Remote Desktop Services" to "Everyone", "Authenticated Users", "Domain Users" or "Domain Computers". +The settings are located in : + Computer configuration -> Policies -> Windows Settings ->Security Settings -> Local Policies -> User Rights Assignment. +As an alternative, the file GptTmpl.inf can be manually edited. + + + Domain Controllers are critical components of the Active Directory. If an attacker is able to open a session, he will be able to discover unsecure backup media or perform a local privilege escalation to become the DC admin and thus the AD admin. + Local logon requires usually physical interaction, which explains why network seggregation is a best practice, but this can be bypassed. Indeed VNC or remote server management software is a way to perform local logon remotely. + In addition, remote server management software have been the subject of many vulnerabilites, some of them can be exploited even if this software is disabled. + + + Ensure that the privilege to log on Domain Controllers are not granted to everyone by GPO + + + GPO: {0} Account: {1} Privilege: {2} + + + The detail can be found in <a href="#gpoprivileges">Privileges</a> + + + The purpose is to ensure that the Recycle Bin feature is enabled + + + https://enterinit.com/powershell-enable-active-directory-recycle-bin + + + The Recycle Bin is not enabled + + + First, be sure that the forest level is at least Windows 2008 R2. + You can check it with Get-ADForest or in the <a href="#domaininformation">Domain Information</a> section. + Then you can enable it using the powershell command: +Enable-ADOptionalFeature -Identity 'Recycle Bin Feature' -Scope ForestOrConfigurationSet -Target 'test.mysmartlogon.com' + + + The Recycle Bin avoids immediate deletion of objects (which can still be partially recovered by its tombstone). This lowers the administration work needed to restore. It also extends the period where traces are available when an investigation is needed. + + + Ensure that the Recycle Bin feature is enabled + + + The detail can be found in <a href="#domaininformation">Domain Information</a> + + + The purpose is to ensure that the AdminSDHolder mechanism has not been altered + + + https://www.petri.com/active-directory-security-understanding-adminsdholder-object +https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/e5899be4-862e-496f-9a38-33950617d2c5 + + + The AdminSDHolder safety mechanism has been modified for some privilege groups + + + Find the dsHeuristics configuration which is located in CN=Directory Service,CN=Windows NT,CN=Services,CN=Configuration,DC=ad,DC=contoso,DC=com. + Then edit the 16th character and set it to zero. + + + The AdminSDHolder service is a protection which prohibits an admin to loose control of the domain after a permission change or to introduce a weakness in the permissions. +It proceed by rewriting every 60 minutes the security descriptor of critical objects. + +By modifying the dsHeuristics attribute, this protection can be disabled for one or more critical group. +Each critical group is associated with a value: +Account Operators: 1, +Server Operators: 2, +Print Operators:4, +Backup Operators: 8. +The 16th character of dsHeuristics represents the sum of the values associated to the groups where the AdminSDHolder has been disabled. +To disable it for the 'Backup Operators' and the 'Server Operators', the value is 8 + 2 = 0x0A = 'a'. + + + + Ensure that the AdminSDHolder protection has not been disabled for some critical groups + + + The purpose is to check if the DoListObject feature has been enabled + + + https://dirteam.com/sander/2008/12/09/active-directory-visibility-modes/ +https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/e5899be4-862e-496f-9a38-33950617d2c5 +https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/990fb975-ab31-4bc1-8b75-5da132cd4584 + + + The DoListObject has been enabled + + + This is an informative rule. +If you want to reverse this behavior to its default value, find the dsHeuristics configuration which is located in CN=Directory Service,CN=Windows NT,CN=Services,CN=Configuration,DC=ad,DC=contoso,DC=com. +Then edit the 3rd character and set it to zero. + + + The DoListObject is a feature to probihit account located in an OU to look at another OU. It proceed by checking an special ACL named RIGHT_DS_LIST_OBJECT. + + + + Check if the behavior DoListObject has been enabled + + + The purpose is to check that it is not possible to go into recovery mode without the administrator password + + + https://docs.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/recovery-console-allow-automatic-administrative-logon + + + At least one GPO grant the right to get in the recovery mode without being admin + + + Locate the GPO specified in Details and turn off the setting "Recovery console: Allow automatic administrative logon" +The setting is located in : + Computer configuration -> Policies -> Windows Settings ->Security Settings -> Local Policies -> Security Options. +As an alternative, the file GptTmpl.inf can be manually edited. + + + The recovery mode is a special mode allowing an admin to fix an issue preventing the computer to boot. By pressing F8 in the short time span allowed, the computer boots with just a simple command line. + Usually, the administrator password is requested to avoid that people having physical access get control of it. It can typically be done by creating a new user account and add this account as member of the administrators group. This rule checks if there are any GPO which disable this password prompt. + + + Ensure the "automatic administrative logon" feature of the recovery mode is not enabled + + + GPO: {0} + + + The detail can be found in <a href="#lsasettings">Security settings</a> + + + The purpose is to check that the integrity of the network protocol LDAP as not been explicitly disabled. + + + https://docs.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/network-security-ldap-client-signing-requirements + + + At least one GPO disables explicitly LDAP client signature + + + Locate the GPO specified in Details and change the setting in "Network security: LDAP client signing requirements". + Disable this setting, or set it to "Negotiate signing" or "Require Signature". +The setting is located in : + Computer configuration -> Policies -> Windows Settings ->Security Settings -> Local Policies -> Security Options. +As an alternative, the file GptTmpl.inf can be manually edited. + + + The LDAP signature feature enables the integrity of the network communication between the computer and the domain controller. +Hackers aim at intercepting the communication at the network layer and modify the network dialog to grant themselves admin privileges. +The goal of this feature is to defeat these attacks. +Unfortunately, not all devices support LDAP signature. That's why the best practice is to Require Signature if possible or to, at least, try to negotiate it. +In this case, the LDAP signature feature is configured to None (no negotiation), which can enable hackers to perform their attacks. + + + Ensure LDAP signing requirements is not set to None + + + GPO: {0} + + + The detail can be found in <a href="#lsasettings">Security settings</a> + + + The purpose is to check that the computer account password can be changed as usual. + + + https://docs.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/domain-controller-refuse-machine-account-password-changes + + + At least one GPO disables explicitly the change of the computer account password + + + Locate the GPO specified in Details and change the setting in "Domain controller: Refuse machine account password changes". + Disable this setting, or set it to "Disabled". +The setting is located in : + Computer configuration -> Policies -> Windows Settings ->Security Settings -> Local Policies -> Security Options. +As an alternative, the file GptTmpl.inf can be manually edited. + + + For each computer, there is a hidden user account. This account is used to maintain the computer inside the Active Directory domain. + The password of this account is changed every 30 days automatically except if the Domain Controller prohibits this. + This is the case when the GPO is enabled. + + + Ensure that Domain Controllers don't deny the change of computers account password. + + + GPO: {0} + + + The detail can be found in <a href="#lsasettings">Security settings</a> + + + The purpose is to check that files deployed to computers cannot be changed by everyone. + + + + + + At least one GPO is deploying a file which can be modified by everyone + + + Locate the file mentionned by the GPO specified in Details and change its permissions. + + + Application provided in a msi form or general files can be deployed by a GPO. If an attacker can modify one of this file, it can take control of the user account. + + + Ensure that file deployed by a GPO cannot be modified by everyone. + + + GPO: {0} Type: {1} FileName: {2} Account: {3} Right: {4} + + + The detail can be found in <a href="#gpodeployedfiles">GPO Deployed Files</a> + + + The purpose is to ensure that a compromised domain cannot use file deployed by GPO to compromise other domains + + + Copy the file to a share located inside the domain and not in trusted domains. + + + Number of files deployed hosted in another domain: {count} + + + Server: {0} GPO: {1} File: {2} + + + Files deployed (Application as msi, file copied by GPO, ...) can be stored in any file share available in the network and that includes trusted domains shares. If such file is located in a compromise domain, it can be used to compromise other domains. + + + + + + Check if files deployed may be located in a trusted domain + + + The detail can be found in <a href="#gpodeployedfiles">GPO Deployed Files</a> + + + The purpose is to ensure that local name resolution protocol (LLMNR) cannot be used to collect credentials by performing a network attack + + + Enable the GPO <a href="https://getadmx.com/?Category=Windows_10_2016&Policy=Microsoft.Policies.DNSClient::Turn_Off_Multicast">Turn off multicast name resolution</a> and check that no GPO override this setting. + (if it is the case, the policy involved will be displayed below) + + + No GPO has been found which disables LLMNR or at least one GPO does enable it explicitly + + + GPO: {0} + + + LLMNR is a protocol which translates names such as foo.bar.com into an ip address. LLMNR has been designed to translate name locally in case the default protocol DNS is not available. + Regarding Active Directory, DNS is mandatory which makes LLMNR useless. + LLMNR exploits typo mistakes or faster response time to redirect users to a specially designed share, server or website. + Being trusted, this service will trigger the single sign on procedure which can be abused to retrieve the user credentials. + + LLMNR is enabled by default on all OS except starting from Windows 10 v1903 and Windows Server v1903 where it is disabled. + + + + https://youtu.be/Fg2gvk0qgjM + + + Check if LLMNR can be used to steal credentials + + + The detail can be found in <a href="#lsasettings">Security settings</a> + + + By reusing existing objects, whose credentials may be the same among all objects or stored on configuration files or in memory, a third party can take them over. + + + Patching computers is part of the security process. Unpatched vulnerability is a way to gain control of a computer. + + + Active Directory uses a distributed architecture to have a high level of availability. This architecture replicates each change at a regular interval. Collision of changes can create unexpected objects which can be used later. + + + It is important to control who can create new objects in the Active Directory. Indeed, its owner may introduced an object in which it has a strong control. + + + Cryptography and computer power have evolved during the time and the oldest protocols do not provide the same level of security anymore. They can be broken and used to gain control of the domain. + + + Operating systems have a lifecycle where its manufacturer provides patches. If the operating system is not supported anymore, vulnerabilities are not fixed anymore. + + + By abusing a misconfiguration, an attacker can gain the control of the domain. + + + It is important to have a database of all the assets and control the physical security of the server. If one server is compromised physically, all the secrets of the domain can be exposed. + + + It is important to know how much administrators are in place and to track the use of emergency accounts + + + Privileges are granted to special groups to perform their duty. Sometimes, these privileges can be used to take control of the domain. + + + Delegation is used to perform day to day activities. It is important to control it. + + + Permissions granted to someone can be difficult to analyze. Hackers use this fact to chain multiple permission leaks in order to gain control of the domain. + + + Most of the changes can be reversed. Some not, and it can broke the domain. + + + Isolation of domain is critical to avoid a global compromission. + + + Any trust introduce a risk. The secret used for the trust can be exposed to take control of the domain. + + + A trust is a technical boundary which should not be altered. + + + When doing migrations, a double identity may be attributed. It can have side effects up to the compromission of the domain. + + + NT4 like trusts do not provide an accurate level of security and by the use of its old protocols, put the domain at risk. + + + At the begining of an attack, a hacker try to collect as much data as possible. Leaking information just reduce the time an attacker needs to gain control of the domain. + + + the GPO deploy settings which are applied to computers locally and it can be abuse to take control of individual computers. + + + Passwords stored in clear text or obfuscated can be retrieved. By reusing the user's identity, an attacker does not need to perform attack and it is difficult to detect it. + + + Misprotected credentials can be abused to be retrieved in plain text and then, impersonate the user. + + + Administrators grant sometimes privileged rights to colleagues without any approval from a security officer. + + + Network attacks such as interception or modification can be used to run commands on behalf an administrator. + + + Certificates are an alternative to passwords. Their protection is crucial to avoid any backdoor. + + + If the password is a secret which protects, its derivatives, such as the fingerprint named hash, can be used as if it was the password itself. + + + There are key secrets in Active Directory which provides seed to the cryptographic process. A leak can lead to a total compromise of a domain. + + + Althought Active Directory has been designed for redundancy, a backup process is key for a recovery plan. + + + The default audit policy of Windows does not collect key events, to trace activities or discover past compromise. + + + Delegations are very complex to understand and may grant more privileges than initially thought. + + + The link with Azure Systems may create new compromise methods between the cloud and on premise systems. + + + The purpose is to ensure that a forest cannot be used to compromise another forest using kerberos delegation + + + TGT Delegation on forest trusts should be disabled, except for migrations. +You can use netdom to turn the TGT delegation on forest trust OFF. +Example: netdom.exe trust fabrikam.com /domain:contoso.com /EnableTGTDelegation:No +As an alternative, you can locate the forest trust and change its LDAP trustattribute from the value 8 to the value 520. + +The impact is to have non working services which relies on unconstrained delegation. Resource based delegation is not impacted. + +See the official Microsoft recommandations and a script to find potentially impacted services in the links below. + + + At least one forest trust has been found where TGT delegation over forest trust is allowed + + + Trust: {0} + + + A Forest trust is a link between two forests. By default, this trust is secure and prohibits SID History attacks. +However, it allows kerberos delegation by default. +By configuring an uncontrainst delegation on forest A, an attacker located in forest A can collect admin or domain controller credentials, the TGT of the session, of the forest B. +This collection can be forced by using services such as the printer spooler, enabled by default on all domain controllers. +Having collected this TGT, the attacker can then request access to other systems in forest B, by asking for a TGS given the TGT, and then gain control of the whole forest. + + + http://www.harmj0y.net/blog/redteaming/not-a-security-boundary-breaking-forest-trusts/ +https://techcommunity.microsoft.com/t5/Premier-Field-Engineering/Changes-to-Ticket-Granting-Ticket-TGT-Delegation-Across-Trusts/ba-p/440283/tab/rich +https://support.microsoft.com/en-us/help/4490425/updates-to-tgt-delegation-across-incoming-trusts-in-windows-server + + + Check if kerberos delegation can be used to take control of the forest from a trusted forest + + + The detail can be found in <a href="#discovereddomains">Trusts section</a> + + + Members of administrators' groups are a priority target. By misconfiguring their protection, the password of the account can be retrieved by an attacker or it can leverage internal mechanisms of the AD such authentication to act on its behalf. + + + The purpose is to ensure that the password of admin accounts cannot be retrieved using the kerberoast attack. + + + If the account is a service account, the service should be removed from the privileged group or have a process to change it at a regular basis. +If the user is a person, the SPN attribute of the account should be removed. + + + At least one member of an admin group is vulnerable to the kerberoast attack. + + + Group: {0} User: {1} + + + To access a service using kerberos, a user does request a ticket (named TGS) to the DC specific to the service. +However this ticket is encrypted using a derivative of the service password. This ticket can then be brute-forced to retrieve the original password. +Any account having the attribute SPN populated is considered as a service account. +Given the fact that any user can request a ticket for service account, these accounts can have their password retrieved. +In addition, services are known to have their password not changed at a regular basis and to use well-known words. + +Please note that this program skips service accounts having their password changed for less than 40 days ago to allow a mitigation using a password change process. + + + https://adsecurity.org/?p=3466 + + + Check if admin accounts are vulnerable to the kerberoast attack. + + + The detail can be found in <a href="#admingroups">Admin Groups</a> + + + The purpose is to ensure that no specific delegation has been setup to manage the Microsoft DNS. + + + You should remove the explicit write delegation located in the CN=MicrosoftDNS,CN=System container and do a proper delegation. + First, grant only "Read Property", "List", "List object" and "Read permssions" to CN=MicrosoftDNS,CN=System to enable access to the RPC service. + Then on each zone (the object in the tree below with the class dnsZone), grant "Read Property", "List", "List object", "Read permissions", "Create Child", "Delete Child", "Delete", "Delete Tree". + + + An explicit delegation has been put in place to manage the Microsoft DNS service. + + + Account: {0} Right: {1} + + + Administrators of the DNS Service have the possibility to inject a DLL in this service. +However this service is hosted most of the time in the domain controller and is running as system. +That means that DNS Admins are potentially domain admins. + +The security descriptor used to grant admin rights is located on the nTSecurityDescriptor attribute of the object CN=MicrosoftDNS,CN=System. +The "Write All Prop" access right induces the vulnerability. + +In this case, an explicit delegation has been setup and this delegation is not using the existing DnsAdmins group. + + + https://medium.com/@esnesenon/feature-not-bug-dnsadmin-to-dc-compromise-in-one-line-a0f779b8dc83 +https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-dnsp/007efcd2-2955-46dd-a59e-f83ae88f4678 + + + Check if there is an explicit delegation on DNS servers. + + + The detail can be found in <a href="#admindelegation">Delegations</a> + + + The purpose is to ensure that there is no assignment of the SeTrustedCredManAccessPrivilege privilege. + + + You should edit the GPO and remove the GPO right assignment. + +The setting is located in Computer Policy -> Computer Configuration -> Windows Settings -> Security Settings -> Local Policies -> User Rights Assignment. + + + The privilege "Access Credential Manager as a trusted caller user right" has been explicitly granted. + + + GPO: {0} User: {1} + + + The Credential Manger is a vault where credentials are being stored. +This privilege can be used to retrieve the secret data. + +Please note that, as today, there is no public POC published to exploit this privilege and no supported API needing that privilege. + + + + https://docs.microsoft.com/en-us/windows/win32/secauthn/credentials-management +https://docs.microsoft.com/en-us/windows/win32/secauthn/authentication-functions#credentials-management-functions + + + Check if there is the privilege Access Credential Manager as a trusted caller user right has been explicitly granted. + + + The detail can be found in <a href="#gpoprivileges">Privileges</a> + + + The purpose is to ensure that there is a tier isolation. + + + You should add a GPO prohibing the logon for the specific group: Domain Admins and Administrators. + +The setting is located in Computer Policy -> Computer Configuration -> Windows Settings -> Security Settings -> Local Policies -> User Rights Assignment. +Then Deny log on locally and Deny logon through Remote Desktop Services. + + + No GPO preventing the logon of administrators has been found. + + + + + + A way to collect an administrator credential is to take control of a workstation in the unsecure tiers and expect that an administrator will connect to it. + An attack such as credential theft or kerberos delegation is then performed. + To reduce the impact of such compromise, the best practice is to isolate components (such as admins, DC) in tiers. + Typically, a domain admin should not be allowed to connect to any workstation but login only to perform highly privileged operations. + + To check for this policy, PingCastle looks at all GPO and check if there is a GPO denying logon (SeDenyRemoteInteractiveLogonRight, SeDenyInteractiveLogonRight) of admins (Domain Admins or Administrators) to a specific scope. + + False positives can occurs for this rule: + * if the expected GPO is hidden due to ACL checks + * if the targeted group is not "checked" when saving the GPO. Indeed the group will be saved as is without a convertion to its technical name and it will prohibit a match if there are groups internationalized, aka renamed given a specific language. + + As a consequence, only one deny policy on one group will fulfill this requirements. The program also do not check if the GPO is applied on an Organizational Unit or a Container. + Also this rule is enforced only if there is more than 200 users and 200 computers. + + + + https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/plan/security-best-practices/appendix-f--securing-domain-admins-groups-in-active-directory + + + Check if there is a policy preventing administrators to connect to unsecured workstations. + + + The detail can be found in <a href="#gpologin">GPO Login</a> + + + The purpose is to ensure that there is no control path involving everyone. + + + You should analyze the chart and determine which underlying object is involved and grants write permissions to everyone. + Then edit the permissions and locate the write permission involved. + Then delete it or replace it according to your delegation model. + + + Everyone can take control of a key domain object by abusing targeted permissions. + + + Group: {0} + + + + If you have access to a key server and the helpdesk can reset your password, then the helpdesk has access to the key server. +This is the kind of logic used by hackers to take control of the domain using key infrastructure objects (domain root, ...) or groups (domain administrators, ...). +Permissions are collected and analyzed to produce a control paths analysis. +Only write permissions (and specific ones) are used for this analysis. +Then the program identifies which users or computers, that are not members of known groups, can take control of this object. +To be fast, some tradeoffs have been selected. For example, logged on users on servers are ignored. +The program may also select paths which are not exploitable and ignore paths if it cannot read every permissions. +[Everyone] includes the anonymous, everyone, authenticated users, domain users, domain computers and builtin-users groups. + + + + https://github.com/BloodHoundAD/BloodHound +https://github.com/ANSSI-FR/AD-control-paths + + + Check if there is a control path involving everyone-like groups. + + + The detail can be found in <a href="#controlpath">Control Paths Analysis</a> + + + The purpose is to ensure that there is no control path involving a large number of users. + + + You should analyze the chart and determine which underlying object is involved and grants too much write permissions. + Then edit the permissions and locate the write permission involved. + Then delete it or replace it according to your delegation model. + + + A large number of users or computers can take control of a key domain object by abusing targeted permissions. + + + Group: {0} Number: {1} + + + + If you have access to a key server and the helpdesk can reset your password, then the helpdesk has access to the key server. +This is the kind of logic used by hackers to take control of the domain using key infrastructure objects (domain root, ...) or groups (domain administrators, ...). +Permissions are collected and analyzed to produce a control paths analysis. +Only write permissions (and specific ones) are used for this analysis. +Then the program identifies which users or computers, that are not members of known groups, can take control of this object. +To be fast, some tradeoffs have been selected. For example, logged on users on servers are ignored. +The program may also select paths which are not exploitable and ignore paths if it cannot read every permissions. + + + + https://github.com/BloodHoundAD/BloodHound +https://github.com/ANSSI-FR/AD-control-paths + + + Check if there is a control path involving too much users or computers. + + + The detail can be found in <a href="#controlpath">Control Paths Analysis</a> + + + The purpose is to ensure that the audit policy on domain controllers collect the right set of events. + + + Identify the Audit settings to apply and fix them. + Be aware that there are two places for audit settings. + For "Simple" audit configuration: + in Computer Configuration -> Policies -> Windows Settings -> Security Settings -> Local Policies -> Audit Policies + For "Advanced" audit configuration: + in Computer Configuration -> Policies -> Windows Settings -> Security Settings -> Advanced Audit Policy Configuration + Also be sure that the audit GPO is applied to all domain controllers, as the underlying object may be in a OU where the GPO is not applied. + + + + The audit policy on domain controllers does not collect key events. + + + Type: {0} Audit: {1} Problem: {2} Rationale: {3} Domain controller: {4} + + + To detect and mitigate an attack, the right set of events need to be collected. + The audit policy is a compromise between too much and too few events to collect. + To solve this problem, the suggested audit policy from adsecurity.org is checked against the audit policy in place. + + + + https://adsecurity.org/?p=3299 + + + Check if there is the expected audit policy on domain controllers. + + + The detail can be found in <a href="#auditsettings">Audit settings</a> + <br> + The table below shows the settings that were not found as configured in GPO for a given domain controller. + + + The purpose is to ensure that all DC don't use weak SSL protocols when acting as server. + + + Apply Windows updates and registry tweaks described in the documentation section to disable the weak SSL protocols. + + + + At least one DC uses a weak SSL protocol for server side purposes. + + + DC: {0} Protocol: {1} + + + SSL version 2 and SSL version 3 are considered weak and it is strongly advised to disable them. + The SSL protocols in Windows is provided by the Schannel component. +The Schannel component needs to be tuned in order to not propose these weak protocols. Many guidelines to handle this problem issued by Microsoft do not talk about Schannel but rather IIS. These guidlines are quoted in the documentation section below. + +PingCastle is able to check the SSL version if LDAPS is exposed. LDAPS is automatically exposed once a certificate is available for the DC and the service restarted. +Please note that PingCastle is using the native .Net SSL stack to perform this test. .Net begins to ignore these weak protocols starting the version 4.7 of the framework and as a consequence, PingCasle may miss some weak protocol detection. + +To test these protocol, you can use openssl with the following commands: +openssl s_client -connect dc.domain.local:636 -ssl2 +openssl s_client -connect dc.domain.local:636 -ssl3 + + + + https://social.technet.microsoft.com/wiki/contents/articles/2249.windows-server-20082008r2-how-to-disable-sslv2-on-domain-controller-dsforum2wiki.aspx +https://support.microsoft.com/en-us/help/187498/how-to-disable-pct-1-0-ssl-2-0-ssl-3-0-or-tls-1-0-in-internet-informat +https://adsecurity.org/?p=376 + + + Check if LDAPS is used with weak SSL protocol. + + + The detail can be found in <a href="#domaincontrollersection">Domain controllers</a> + + + The purpose is to ensure that Powershell logging is enabled. + + + Go to Computer Configuration -> Administrative Templates -> Windows Components -> Windows PowerShell +And enable "Turn on Module logging" and "Turn on Powershell Script Block logging" +We recommend to set "*" as the module list. + + + + The powershell audit configuration is not fully enabled. + + + + + + Powershell is a powerful language, also used by hackers because of this quality. Hackers are able to run programs such as mimikatz in memory using obfuscated commands such as Invoke–Mimikatz. + Because there is no artefact on the disk, the incident response task is difficult for the forensic analysts. + For this reason, we recommend to enable Powershell logging via a group policy, despite the fact that these security settings may be part of the workstation or server images. + + + + https://adsecurity.org/?p=2604 +https://docs.microsoft.com/en-us/powershell/scripting/wmf/whats-new/script-logging?view=powershell-6 + + + Check if there is powershell logging enabled. + + + The detail can be found in <a href="#lsasettings">Security settings</a> + + + The purpose is to ensure that there is no use of the obsolete and vulnerable OS Windows Vista for the workstations within the domain + + + In order to solve this security issue, you should upgrade all the workstations to a more recent version of Windows, starting from Windows 10. Do note that you can get the full details regarding the OS used with the following PowerShell command: <i>Get-ADComputer -Filter * -Property * | Format-Table Name,OperatingSystem,OperatingSystemServicePack,OperatingSystemVersion -Wrap -Auto You can replace [-Filter *] by [-Filter {OperatingSystem -Like "Windows Server*"}</i> + + + Presence of Windows Vista = {count} + + + Obsolete OS (Windows Vista) + + + The Windows Vista OS is not supported any longer, as it is vulnerable to many publicly known exploits: Administrator's credentials can be captured, security protocols are weak, etc. + + + + + + The detail can be found in <a href="#operatingsystems">Operating Systems</a> + + + The purpose is to ensure that there is no use of the obsolete and vulnerable OS Windows 2008 as Domain Controller within the domain + + + https://support.microsoft.com/en-us/help/4456235/end-of-support-for-windows-server-2008-and-windows-server-2008-r2 + + + Presence of Windows 2008 as DC = {count} + + + The operating system of domain controllers can be found in <a href="#domaincontrollersection">Domain controllers</a> + + + To resolve this security risk, the only way is to decommission DC running Windows 2008 OS, in order to use new versions that are more secured and that are still being patched regarding new security threats + + + The OS Windows 2008 is not supported anymore by Microsoft (except when migrated to Azure) and any vulnerability found will not be patched unless an expensive support contrat has been purchased. + + + Obsolete Domain Controller (Windows 2008) + + + The purpose is to ensure that there is no use of the obsolete and vulnerable OS Windows 2008 for the workstations within the domain + + + https://support.microsoft.com/en-us/help/4456235/end-of-support-for-windows-server-2008-and-windows-server-2008-r2 + + + Presence of Windows 2008 = {count} + + + The detail can be found in <a href="#operatingsystems">Operating Systems</a> + + + In order to solve this security issue, you should upgrade all the servers to a more recent version of Windows, starting from Windows 2012. Do note that you can get the full details regarding the OS used with the following PowerShell command: <i>Get-ADComputer -Filter * -Property * | Format-Table Name,OperatingSystem,OperatingSystemServicePack,OperatingSystemVersion -Wrap -Auto You can replace [-Filter *] by [-Filter {OperatingSystem -Like "Windows Server*"}</i> + + + The Windows 2008 OS is not supported any longer, as it is vulnerable to many publicly known exploits: Administrator's credentials can be captured, security protocols are weak, etc. + + + Obsolete OS (Windows 2008) + + + The purpose is to ensure that there is no private key that can be recovered from a certificate + + + https://crocs.fi.muni.cz/public/papers/rsa_ccs17 +https://github.com/crocs-muni/roca +https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/ADV190026 +https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/ADV170012 +https://keychest.net/roca + + + At least one private key associated to a certificate can be recovered + + + The detail can be found in <a href="#certificates">Certificates</a> + + + If the certificates listed below are still valid, you have to revoke and re-issue them. If other certificates depends on them, they should be revoked and replaced too. + If the certificates have been expired, they should be removed. + + + "ROCA" is an acronym for "Return of Coppersmith's attack" which enables an attacker to retrieve the private key from a public key. + It is due by a library named RSALib, provided by Infineon Technologies which is incorporated into many smart cards, Trusted Platform Module (TPM), and Hardware Security Modules (HSM) implementations, including YubiKey 4 tokens and used to generate public RSA keys. + This library was generating data in a limited number space, which decreased the number of values that an attacker has to guess. + + + Check for the ROCA vulnerability in certificates + + + Source: {0} Subject: {1} Expires: {2} + + + The purpose is to ensure that there is no use of a certificate using a DSA key for signature + + + GPO: {0} Subject: {1} + + + https://csrc.nist.gov/publications/detail/fips/186/5/draft + + + At least one trusted certificate found has a DSA key [{count}] + + + The detail can be found in <a href="#certificates">Certificates</a> + + + To solve the matter, the certificate should be removed from the GPO and if needed, certificates depending on it should be reissued. + + + Digital Signature Algorithm (DSA), is a NIST standard signature algorithm, part of the 1993 Digital Signature Standard(FIPS 186). The proposed FIPS 186-5 draft deprecates the use of DSA and will forbid its usage for digital signature purposes. + The annex E of FIPS 186-5 specifies: DSA is no longer approved for digital signature generation. DSA may be used to verify signatures generated prior to the implementation date of this standard. + + + Check for Certificates using the DSA algorithm for signature + + + The purpose is to ensure that there is no use of a certificate with a weak RSA exponent + + + GPO: {0} Subject: {1} Exponent: {2} + + + + + + At least one trusted certificate found has a weak RSA exponent [{count}] + + + The detail can be found in <a href="#certificates">Certificates</a> + + + To solve the matter, the certificate should be removed from the GPO and if needed, certificates depending on it should be reissued. + + + The RSA public key is composed of two parts: the modulus and the exponent. The exponent has to be a prime number and its value is usually 65537. + It is not recommended to have a exponent larger than 65537 for compatibility reasons as for example older Windows handle the exponent in 4 bytes. + Having a lower exponent, such as 3, give a significant performance boost (up to 8 times), but it is considered less secure. + + + Check for Certificates using a weak RSA exponent + + + The purpose is to ensure that there is no use of a certificate using a relatively weak RSA key + + + Source: {0} Subject: {1} Module: {2} Expires: {3} + + + https://www.iad.gov/iad/library/ia-guidance/ia-solutions-for-classified/algorithm-guidance/commercial-national-security-algorithm-suite-factsheet.cfm + https://www.ssi.gouv.fr/guide/cryptographie-les-regles-du-rgs/ + + + At least one trusted certificate found has a relatively weak RSA key [{count}] + + + The detail can be found in <a href="#certificates">Certificates</a> + + + To solve the matter, the certificate should be removed from the GPO and if needed, certificates depending on it should be reissued. + + Please note that this rule is the companion of the rule A-WeakRSARootCert which checks for unsecured certificates (key lower than 1024 bits). + + + A RSA key certificate with a modulus under 1024 bits is considered as not safe. This is checked by the rule A-WeakRSARootCert. + This rule checks for certificates having a key under 2048 bits which is considered as having a lower level of security and under 3072 bits for certificates valid after 2030. + + + Check for Certificates using a relatively weak signing algorithm (RSA between 1024 bits and 2048) + + + The purpose is to identify domains having the NSPI protocol exposed without any required account + + + https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/e5899be4-862e-496f-9a38-33950617d2c5 +https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-nspi/6dd0a3ea-b4d4-4a73-a857-add03a89a543 + + + DsHeuristics has been set to allow anonymous access to the NSPI protocol + + + The easiest and fastest way to correct this issue is to <b>replace the eighth (8th) character of the DsHeuristics attribute</b>. If it is not a 0, replace by 0 to fix the issue. + + + The way an Active Directory behaves can be controlled via the attribute <i>DsHeuristics</i> of <i>CN=Directory Service,CN=Windows NT,CN=Services,CN=Configuration</i>. A parameter stored in its attribute and whose value is <i>fAllowAnonNSPI</i> can be set to allow access to the NSPI protocol without any account. +The NSPI protocol is used internally by Exchange to resolve addresses, and thus can be used to dump all the users of the forest. It can be exposed to the internet via RPC over HTTP. + + + Check for access without any account to the Name Service Provider Interface (NSPI) protocol + + + The purpose is to ensure that the Allowed RODC Password Replication Group group is empty. + + + Member: {0} + + + + + + The Allowed RODC Password Replication Group group is not empty + + + + + + This group should be emptied, and dedicated groups should only be added to the Password Replication Policy of each relevant RODC. + + + Accounts belonging to the Allowed RODC Password Replication Group group have their password hashes revealed on all RODCs. + + + Check the Allowed RODC Password Replication Group group + + + The purpose is to ensure that the Denied RODC Password Replication Group group has at least its default members. + + + Missing: {0} + + + https://docs.microsoft.com/en-us/services-hub/health/remediation-steps-ad/review-the-removal-of-default-members-from-the-denied-rodc-password-replication-group + + + The Denied RODC Password Replication Group group has some of its default members missing + + + + + + Add the items which have been identified as missing to the Denied RODC Password Replication Group group. + + + + A set of critical objects are being forbidden to replicate in RODC for security reasons. + This permission is set using the Denied RODC Password Replication Group group. + Removing one of the default members of this group remove this protection, and thus, the isolation of RODC. + + + Check the Denied RODC Password Replication Group group + + + The purpose is to ensure that the old NTFRS protocol is not used to replicate the SYSVOL share. + + + + + + https://docs.microsoft.com/en-us/windows-server/storage/dfs-replication/migrate-sysvol-to-dfsr +https://support.microsoft.com/en-us/help/312862/recovering-missing-frs-objects-and-frs-attributes-in-active-directory +https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-frs1/d18cc589-677e-4133-97e5-113641792c5e +https://docs.microsoft.com/en-us/troubleshoot/windows-server/networking/sysvol-dfsr-migration-fails-after-in-place-upgrade + + + The old protocol NTFRS is used to replicate the SYSVOL share + + + + + + You have to migrate from NTFRS to DFS replication. See the documentation below for more details. + + + + NTFRS is an old protocol and is not considered as secure. + The SYSVOL share is mainly hosted on domain controllers to host GPO files and login scripts. + If the content can be modified, it can be used to grant to an hacker the control of the computers reading these configuration files. +To know if the setting is enabled, PingCastle read the following LDAP entry: CN=Domain System Volume (SYSVOL share),CN=File Replication Service,CN=System +If there is any entry found, the program consider that NTFRS is in use for SYSVOL replication. + +Starting in Windows Server 2019, promoting new domain controllers requires the DFS Replication (DFSR) to replicate the contents in the SYSVOL share. +As a consequence this rule become informative if at least one Windows 2019 or more recent is installed as a Domain Controller. + +Please note that at the time of writing, Microsoft supports it until Windows 2022 (see the Open Specification link in the documentation section below) + + + + Check if NTFRS is used to replicate SYSVOL + + + The purpose is to ensure that the DNS Zones are configured to accept only secure update. + + + Zone: {0} + + + https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-dnsp/f97756c9-3783-428b-9451-b376f877319a + https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/dnscmd + + + A DNS Zone is configured with unsecure updates + + + + + + You have to enable secure updates. + Identify the faulty zone in the details below. + Go to the DNS console and select a zone in the "Forward Lookup Zones". + Right click on it and switch to the "General" tab. + Then change Dynamic updates from "Nonsecure and secure" to "Secure only". + You can also run: dnscmd servername /Config zone /AllowUpdate 2 + + + + When the unsecure update mechanism is enabled, an attacker can update a DNS record anonymously. + He can then use this feature to add new entries or perform a man in the middle attack to capture credentials. + + Please note that the rule A-DnsZoneUpdate1 is the companion of A-DnsZoneUpdate2 and it is used to report anomalies related to the local domain zone or the main _msdcs zone. A-DnsZoneUpdate2 reports all the other zones. + + + + Check if DNS Zones are configured with unsecure update. + + + The purpose is to ensure that the DNS Zones are configured to accept only secure update. + + + Zone: {0} + + + https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-dnsp/f97756c9-3783-428b-9451-b376f877319a + https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/dnscmd + + + A DNS Zone is configured with unsecure updates + + + + + + You have to enable secure updates. + Identify the faulty zone in the details below. + Go to the DNS console and select a zone in the "Forward Lookup Zones". + Right click on it and switch to the "General" tab. + Then change Dynamic updates from "Nonsecure and secure" to "Secure only". + You can also run: dnscmd servername /Config zone /AllowUpdate 2 + + + + When the unsecure update mechanism is enabled, an attacker can update a DNS record anonymously. + He can then use this feature to add new entries or perform a man in the middle attack to capture credentials. + + Please note that the rule A-DnsZoneUpdate1 is the companion of A-DnsZoneUpdate2 and it is used to report anomalies related to the local domain zone or the main _msdcs zone. A-DnsZoneUpdate2 reports all the other zones. + + + + Check if DNS Zones are configured with unsecure update. + + + The purpose is to ensure that every DC is active. + + + Domain controller: {0} + + + https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/deploy/demoting-domain-controllers-and-domains--level-200- + + + Number of DC inactive: {count} + + + The detail can be found in <a href="#domaincontrollersection">Domain controllers</a> + + + You have to demote the DC object using the procedure referenced in the documentation section. + + + + Domain Controllers are user accounts with powerfull privileges. + While an active Domain Controller change its password every 30 days, an inactive account can be involved in a domain compromise. + Indeed, another account, which have rights over this object, may reset the password of this account without being noticed. + + + + Check if all DC are active. + + + The purpose is to ensure that the regular change of computer account is active on Domain Controllers. + + + Domain controller: {0} LastChange: {1} + + + https://support.microsoft.com/en-us/help/154501/how-to-disable-automatic-machine-account-password-changes + + + Number of DC without password change: {count} + + + The detail can be found in <a href="#domaincontrollersection">Domain controllers</a> + + + + Some security agencies report the absence of password change as an indicator of compromise. + + If it is not the case, check the following registry keys: +* HKLM\System\CurrentControlSet\Services\Netlogon\Parameters\DisablePasswordChange: must be set to 0 or inexistent; +* HKLM\System\CurrentControlSet\Services\Netlogon\Parameters\MaximumPasswordAge: must be set to 30. + + + + By default, each computers change automatically its password every 30 days. This is the same case for domain controllers. + Changing regularly secrets like passwords ensures that they are not used in side channel attacks. + For exemple, using DCSync to export the hash of a domain controller password, then reusing it in a silver attack to create kerberos tickets. + + This audit program considers this as an anomaly after 45 days. + + + + Check if all DC are using regular password change pratices. + + + The purpose is to ensure that the dangerous SID are not stored in the SIDHistory attribute. + + + Domain: {0} + + + https://support.microsoft.com/en-us/help/243330/well-known-security-identifiers-in-windows-operating-systems + + + Number of dangerous SID in SIDHistory: {count} + + + The SIDHistory detail can be found in <a href="#useraccountanalysis">User information</a> and <a href="#computeraccountanalysis">Computer information</a> and a quick summary in <a href="#sidhistory">SID History</a> + + + + Identify the account, computer or group having these dangerous SID set in SID History, then clean it up by editing directly the SIDHistory attribute of the underlying AD object. + + + + SID History is an attribute used in migration to link with a former account. + This rule checks for SID not coming from a former domain (such as SYSTEM) or from a former domain but having a RID (the last part of the SID) lower than 1000. + Indeed, native privileged accounts have a SID lower than 1000. + A list of Well Known SID is referenced in the documentation below. + + + + Check if dangerous SID are stored in the SIDHistory attribute. + + + The purpose is to ensure that every account has a password which is compliant with password expiration policies + + + https://adsecurity.org/?p=4115 +https://access.redhat.com/discussions/1283873 + + + Number of accounts which has never-expiring passwords: {count} + + + The detail can be found in <a href="#useraccountanalysis">User information</a> + + + In order to make Active Directory enforce periodic password change, accounts must not have the "Password never expires" flag set in the "Account" tab of the user properties. Their passwords should then be rolled immediately. +For services accounts, Windows provide the "managed service accounts" and "group managed service accounts" features to facilite the automatic change of passwords. +Please note that there is a document in the section below which references solutions for service accounts of well known products. +Also Linux servers should be configured with automatic machine account change. + + + Some accounts have passwords which never expire. Should an attacker compromise one of these accounts, he would be able to maintain long-term access to the Active Directory domain. + +We have noted that some Linux servers, domain joined, are configured with a password which never expires. +This is a misconfiguration because a password change can be configured. It was however not the default on some plateform. +See one of the link below for more information. + + + Check that there is no account with never-expiring passwords + + + The purpose is to ensure that DC are well registered. + + + Domain controller: {0} Problem: {1} + + + https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/9164e4e8-f892-4ca2-8067-059f6f9387a4 +https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/8ebf2419-1169-4413-88e2-12a5ad499cf5 + + + Number of DC with a configuration issue: {count} + + + The detail can be found in <a href="#domaincontrollersection">Domain controllers</a> + + + This rule result is either the result of a manual or software based misconfiguration. It can also be the sign of a compromise. + Depending on the anonamly reported, you have to perform the following actions: + - for InvalidUserAccount: + you have to check that the userAccountControl attribute of the AD object is either 0x00082000 for RW DC or 0x05001000 for RODC + - for NoConfiguration: + the DC registration in the Configuration partition is mising. The DC should not be active and need to be demoted. + - for NoNTDS: + the NTDS part of the DC Configuration is missing. Most probably the replication is not working. The DC should be demoted. + + + + To be registered as a domain controller, a computer must be a member of the domain controller group, but also has some specific settings. +The settings are a change of the userAccountControl attribute and a couple of objects in the configuration partition. +This rule is triggered when an inconsistency has been detected between the expected values and the real values. + +The user account control value for Read/Write DC is: +SERVER_TRUST_ACCOUNT (0x00002000) | TRUSTED_FOR_DELEGATION (0x00080000) = 0x00082000 +The user account control value for Read Only DC is: +PARTIAL_SECRETS_ACCOUNT (0x04000000) | TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION (0x01000000) | WORKSTATION_TRUST_ACCOUNT (0x00001000) = 0x05001000 + + + + Check if all DC are well registered. + + + The purpose is to ensure that no contrained delegations are applied to DC + + + Domain controller: {0} Delegate: {1} Identifier: {2} + + + + + + Number of DC with a contrained delegation: {count} + + + The detail can be found in <a href="#domaincontrollersection">Domain controllers</a> + + + You should edit the msDS-AllowedToDelegateTo attribute of the accounts listed below to remove the SPN of the domain controllers involved. + + + + A constrained delegation is a delegation with some limitation. + In this case, it is a limitation of the technical service a delegate can call (SPN). + But in practice, the specific service name is not checked and the delegate can impersonate anyone on all services of a computer. + For the case of a domain controller, that means that the delegate can take the control of the domain by impersonating a domain admin and doing modifications with the LDAP service. + This delegation is set via the attribute msDS-AllowedToDelegateTo and is limited to kerberos + Note: this rule is a companion of the rule P-DelegationDCt2a4d + + + + Check if all DC have no constrained delegation. + + + The purpose is to ensure that no contrained delegations with protocol transition are applied to DC + + + Domain controller: {0} Delegate: {1} Identifier: {2} + + + + + + Number of DC with a contrained delegation with protocol transition: {count} + + + The detail can be found in <a href="#domaincontrollersection">Domain controllers</a> + + + You should edit the msDS-AllowedToDelegateTo attribute of the accounts listed below to remove the SPN of the domain controllers involved. + + + + A constrained delegation with protocol transition is a delegation with some limitation. + In this case, it is a limitation of the technical service a delegate can call (SPN). + But in practice, the specific service name is not checked and the delegate can impersonate anyone on all services of a computer. + For the case of a domain controller, that means that the delegate can take the control of the domain by impersonating a domain admin and doing modifications with the LDAP service. + This delegation is set via the attribute msDS-AllowedToDelegateTo. + The protocol transition is a special feature set in the userAccountControl which does not limit the delegation to the kerberos protocol. + Note: this rule is a companion of the rule P-DelegationDCa2d2 + + + + Check if all DC have no constrained delegation with protocol transition. + + + The purpose is to ensure that no resource based constrained delegations are applied to DC + + + Domain controller: {0} Delegate: {1} Identifier: {2} + + + https://blog.stealthbits.com/resource-based-constrained-delegation-abuse/ + + + Number of DC with a resource based constrained delegation: {count} + + + The detail can be found in <a href="#domaincontrollersection">Domain controllers</a> + + + You should edit the msDS-AllowedToDelegateToattribute attribute of the domain controllers and remove the account involved. + You can do this with the powershell command: + Set-ADComputer COMPUTER -PrincipalsAllowedToDelegateToAccount $Null + + + + Resource based contrained delegation are a new feature of Windows 2012 which tries to handle the limitation of Constrained delegations. + This delegation is defined by setting the msDS-AllowedToDelegateToattribute attribute either using the GUI or a powershell command. + + + + Check if all DC have no resource based constrained delegation. + + + The purpose is check that no additional account has been added to the "Pre-Windows 2000 Compatible Access" group + + + https://msdn.microsoft.com/en-us/library/cc223672.aspx + + + At least one user, computer or group has been added as a member to the PreWin2000 compatible group + + + Remove the members from the PreWin2000 group while making sure that the group "Authenticated Users" is present. Then reboot each DC. + + + The pre-Windows 2000 compatible access group grants access to some RPC calls which should not be available to users or computers. + + + Check that the "Pre-Windows 2000 Compatible Access" group has not being modified from its default + + + The purpose is to ensure that all privileged accounts are in the special group Protected Users + + + User: {0} + + + https://docs.microsoft.com/en-us/windows-server/security/credentials-protection-and-management/protected-users-security-group +https://blog.netwrix.com/2015/02/20/add-sensitive-user-accounts-to-active-directory-protected-users-group/ +https://dirteam.com/sander/2014/11/25/ten-things-you-need-to-be-aware-of-before-using-the-protected-users-group/ +https://blog.andreas-schreiner.de/2018/09/07/active-directory-sicherheit-teil-1-privilegierte-benutzer/ + + + Number of admins not in Protected Users: {count} + + + The detail can be found in <a href="#admingroups">Admin Groups</a> + + + After having reviewed the potential impact on adding users to this group, add the missing privileged accounts to this group. + + + The Protected Users group is a special group which is a very effective mitigation solution to counter attacks using Credential theft starting with Windows 8.1. Older Operating System must be updated to take this protection in account such as the Windows 7 KB2871997 patch. + For admins, it: +- disable NTLM authentication +- reduce Kerberos ticket lifetime +- enforce usage of strong encryption algorthms such as AES +- prevent caching of passwords on workstations +- prevent any type of Kerberos delegation + +Please also note that a few links (see below) recommends that at least one account is kept outside of the group Protected Users in case there is a permission problem. +That's why this rule is not triggered if only one account is not protected. + + + Check if all privileged accounts are in the special group Protected Users. + + + The purpose is to ensure that the regular change of computer account is active + + + Computer: {0} Creation: {1} LastUsed: {2} LastChange: {3} + + + https://support.microsoft.com/en-us/help/154501/how-to-disable-automatic-machine-account-password-changes + + + Number of computer without password change: {count} + + + The detail can be found in <a href="#computeraccountanalysis">Computer information</a> + + + + Some security agencies report the absence of password change as an indicator of compromise. + + If it is not the case, check the following registry keys: +* HKLM\System\CurrentControlSet\Services\Netlogon\Parameters\DisablePasswordChange: must be set to 0 or inexistent; +* HKLM\System\CurrentControlSet\Services\Netlogon\Parameters\MaximumPasswordAge: must be set to 30. + + + + By default, each computers change automatically its password every 30 days. + Changing regularly secrets like passwords ensures that they are not used in side channel attacks. + Also with the default possibility to create up to 10 computers accounts, these accounts may be seen as a backdoor. + + This audit program considers this as an anomaly between 45 days and 90 days. + Also this rule is the companion for the rule S-PwdLastSet-90 + + + + Check if all computers are using regular password change pratices. + + + The purpose is to ensure that all computer accounts have their password changed in the last 3 months + + + Computer: {0} Creation: {1} LastUsed: {2} LastChange: {3} + + + https://support.microsoft.com/en-us/help/154501/how-to-disable-automatic-machine-account-password-changes + + + Number of computer without password change for at least 3 months: {count} + + + The detail can be found in <a href="#computeraccountanalysis">Computer information</a> + + + + Some security agencies report the absence of password change as an indicator of compromise. + + If it is not the case, check the following registry keys: +* HKLM\System\CurrentControlSet\Services\Netlogon\Parameters\DisablePasswordChange: must be set to 0 or inexistent; +* HKLM\System\CurrentControlSet\Services\Netlogon\Parameters\MaximumPasswordAge: must be set to 30. + + + + By default, each computers change automatically its password every 30 days. + Changing regularly secrets like passwords ensures that they are not used in side channel attacks. + Also with the default possibility to create up to 10 computers accounts, these accounts may be seen as a backdoor. + + This audit program considers this as an anomaly starting with 90 days. + Also this rule is the companion for the rule S-PwdLastSet-45 which does the same between 45 and 90 days + + + + Check if all computers have changed their passwords in the last 3 months. + + + The purpose is to ensure that all admins are changing their passwords at least every 3 years + + + Account: {0} Creation: {1} LastChanged: {2} + + + + + + Number of admin with a password older than 3 years: {count} + + + The detail can be found in <a href="#admingroups">Admin Groups</a> + + + We advised to read the ANSSI guidelines about this, which is quoted in the documentation section below. + + + + This rule ensure that passwords of administrator are well managed. + + + Check if all admin passwords are changed on the field. + + + The purpose is to ensure that all admin accounts do support kerberos pre-authentication + + + Account: {0} Created: {1} LastLogon: {2} + + + http://www.harmj0y.net/blog/activedirectory/roasting-as-reps/ + + + Number of admin accounts which do not require kerberos pre-authentication: {count} + + + The detail can be found in <a href="#useraccountanalysis">User information</a> and <a href="#computeraccountanalysis">Computer information</a> + + + Edit the property of the involved accounts and select the Account tab. Uncheck "Do not require Kerberos preauthentication". For computers which doesn't have the Account tab, you have to manually edit the attribute useraccountcontrol. Subtract from the attribute the value 4194304. + + + Without kerberos pre-authentication, an attacker can request kerberos data from the domain controller and use this data to brute-force the account password. You can search accounts using the ldap query <i>(userAccountControl:1.2.840.113556.1.4.803:=4194304)</i> + + + Check if all admin accounts do support kerberos pre-authentication + + + Account: {0} Created: {1} LastLogon: {2} + + + The purpose is to ensure that the Dns Admin group is not used + + + + + + https://medium.com/@esnesenon/feature-not-bug-dnsadmin-to-dc-compromise-in-one-line-a0f779b8dc83 +https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-dnsp/007efcd2-2955-46dd-a59e-f83ae88f4678 + + + Number of members of the Dns Admins group: {count} + + + The detail can be found in <a href="#admingroups">Admin Groups</a> + + + You should remove the members of the DNS admin group and do a proper delegation to the specific DNS Zones. + +First, grant only "Read Property", "List", "List object" and "Read permssions" to CN=MicrosoftDNS,CN=System to enable access to the RPC service. + +Then on each zone (the object in the tree below with the class dnsZone), grant "Read Property", "List", "List object", "Read permissions", "Create Child", "Delete Child", "Delete", "Delete Tree". + + + + Administrators of the DNS Service have the possibility to inject a DLL in this service. +However this service is hosted most of the time in the domain controller and is running as system. +That means that DNS Admins are potentially domain admins. + +The security descriptor used to grant admin rights is located on the nTSecurityDescriptor attribute of the object CN=MicrosoftDNS,CN=System. +The "Write All Prop" access right induces the vulnerability. + +In this case, the DnsAdmins group is not empty and grant to its user, the possibility to interact with the DNS Service. + + + Check if the Dns Admins group is not empty + + + The purpose is to ensure that no privileged group can be revealed on RODC + + + Domain controller: {0} Account: {1} + + + https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/8dfc81be-7461-48f2-8caf-07402bccb0ea + + + At least one privileged group can be revealed on RODC + + + The detail can be found in <a href="#domaincontrollersection">Domain controllers</a> + + + Edit the attribute msDS-RevealOnDemandGroup and remove the privileged user or group identified. + + This can be managed in the Password Replication Policy tab of the computer objecct in the Active Directory Users and Computers console. + + + There is an attribute on each RODC which enumerates the groups that the RODC can retrieve. + When the RODC retrieve the user account, all secrets are integrated into the data, meaning that the RODC can impersonate the user account. + In this case, a user or a group has been identified that have a RID (the last part of the SID) lower than 1000. +All privileged group have a RID lower than 1000, than means that the RODC can get access at any time to that privileged information. + + + Check if a privileged group can be revealed on a RODC + + + The purpose is to ensure that the protection against revealing privileged group is active + + + Domain controller: {0} Group: {1} + + + https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/8dfc81be-7461-48f2-8caf-07402bccb0ea + + + The protection against Privileged Group protection on RODC is not fully enabled + + + The detail can be found in <a href="#domaincontrollersection">Domain controllers</a> + + + Check the value of the attribute msDS-NeverRevealGroup and the presence of the following expected groups: +- Administrators; +- Server Operators; +- Account Operators; +- Backup Operators; +- Denied RODC Password Replication Group + + This can be managed in the Password Replication Policy tab of the computer objecct in the Active Directory Users and Computers console. + + + In addition to the group Denied RODC Password Replication Group there is a custom setting set for RODC in an attribute named msDS-NeverRevealGroup. + This rule check the current value against the default one. + + + Check if the protection against revealing privileged group is active + + + The purpose is to check if privileged users have already been revealed + + + Domain controller: {0} User: {1} + + + https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/8dfc81be-7461-48f2-8caf-07402bccb0ea + + + At least one privileged user has been revealed on a RODC + + + The detail can be found in <a href="#domaincontrollersection">Domain controllers</a> + + + The admin account should have its secrets change (a password reset) and be sure that the account will not be revealed anymore. + + + On Active Directory, all users revealed to a RODC are tracked by an attribute set on the computer object of the RODC named msDS-RevealedUsers. + The program check on the list of revealed users if one is known as a privileged user. + Indeed the RODC is caching the authentication secrets related of this user, which can then be used to impersonate it. +In addition to that, RODC are placed in general on more riskier environment. + + + Check privileged users have been revealed on RODC + + + Read-Only Domain Controllers are used in poor physically secured zones. An incorrect protection level can leak sensitive data. + + + The purpose is to ensure that no RODC has write access to the SYSVOL + + + Domain controller: {0} + + + https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-frs2/3588b343-4076-4776-b5c0-78e2b3d91ed3 + + + At least one RODC has write access to the SYSVOL volume + + + The detail can be found in <a href="#domaincontrollersection">Domain controllers</a> + + + Locate the domain controller object related to the RODC in ADSIEdit. + Then zoom on CN=DFSR-LocalSettings then CN=Domain System Volume. + Edit the attribute msDFSR-ReadOnly and set it from false to true. + + + + The SYSVOL Volume is a special DFS volume used to stored system files such as GPO. + Read Only Controllers (RODC) have a read-only access to it. + If it has a write access, it can change the file locally and propagate them to all writable domain controllers. +And thus enable an attacker to take control of the domain by modifying GPO applied to Domain Controllers. + + + Check if RODC have write access to the SYSVOL volume + + + The purpose is to ensure that mitigations are in place against the Bloodhound tool + + + + + + https://github.com/p0w3rsh3ll/NetCease +https://adsecurity.org/?p=3299 + + + No GPO has been found which implements NetCease + + + The detail can be found in <a href="#lsasettings">Security settings</a> + + + If this mitigation is not part of the computer image, apply the following recommandations: +Run the NetCease PowerShell script (referenced below) on a reference workstation. +Open the Group Policy Management Console. Right-click the Group Policy object (GPO) that should contain the new preference item, and then click Edit . +In the console tree under Computer Configuration, expand the Preferences folder, and then expand the Windows Settings folder. +Right-click the Registry node, point to New, and select Registry Wizard. +Select the reference workstation on which the desired registry settings exist, then click Next . +Browse to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\DefaultSecurity\ +and select the check box for “SrvsvcSessionInfo” from which you want to create a Registry preference item. Select the check box for a key only if you want to create a Registry item for the key rather than for a value within the key. +Click Finish. +The settings that you selected appear as preference items in the Registry Wizard Values collection + + + By default, Windows computers allow any authenticated user to enumerate network sessions to it. +This means an attacker could enumerate network sessions to a file share hosting home directories or a Domain Controller to see who’s connected to SYSVOL (to apply Group Policy) and determine which workstations each user and admin account is logged into. +Bloodhound uses this capability extensively to map out credentials in the network. + +Disabling Net Session Enumeration removes the capability for any user to enumerate net session info (Recon). + + + Check if NetCease has been put in place to mitigate Bloodhound + + + The purpose is to check if password information may be stored in AD attributes + + + User: {0} + + + https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/f3adda9f-89e1-4340-a3f2-1f0a6249f1f8 +https://www.blackhillsinfosec.com/domain-goodness-learned-love-ad-explorer/ + + + At least one user has an attribute set which is known to potentially contains a password + + + The detail can be found in <a href="#unixpasswordsfound">Unix Passwords</a> + + + The attribute unixUserPassword and userPassword should be cleared from the mentionned user account, unless the remote system is known to have a strong cryptographic protocol. + + + To perform Single Sign On (SSO) systems need to share secrets with Active Directory. + This is not the case for all systems such as Unix and Mainframe and designers have found a workaround by storing this secret into a user account attribute. + However not all systems did implement a proper and cryptographically safe protocol and they are checking the password submitted in their system with an AD attribute. +At that time, it was not known that these attributes can be queried by everyone and as consequence, they did not enforce a robust protection. +Looking at the attribute unixUserPassword, the password can be retrieved either in clear text (encoded as ASCII) or with a weak algorithm such as ROT 13. + +In addition to that, the way to change a password in LDAP system is to modify the value of the special attribute userPassword. +This attribute is not supposed to be visible. However Active Directory is using another attribute named unicodePwd (unless the heuristic fUserPwdSupport is set). +That means that the attribute userPassword is not special anymore and that a change of its value is displayed in clear text, considered as a normal attribute. +A misconfigured application can change the user password using this old mechanism, and as a consequence, set the user password in clear text. + + + + Check if attributes unixUserPassword and userPassword are set + + + The purpose is to check that password rotation is in place with AzureAD SSO + + + + + + https://docs.microsoft.com/en-us/azure/active-directory/hybrid/how-to-connect-sso-faq#how-can-i-roll-over-the-kerberos-decryption-key-of-the-azureadssoacc-computer-account +https://itpro-tips.com/wp-content/uploads/files/TechnetGallery/Azure-AD-SSO-Key-Rollover-d2f1604a.zip +https://www.dsinternals.com/en/impersonating-office-365-users-mimikatz/ + + + The password used in AzureAD SSO has not been changed for at least one year + + + The detail can be found in <a href="#azure">Azure</a> + + + Run the script referenced in the documentation below to change the password of the account AZUREADSSOACC. + + + AzureAD SSO is performed using a gateway. This gateway converts a kerbros TGS ticket to SAML ticket. + In short, a connection to the computer account AZUREADSSOACC and the secret of this user account is used as a shared secret with AzureAD. + Despite the fact that computer account should have its password automatically changed every 30 days, this computer account does not have its password changed automatically. +That means that an extraction of its password (using DCSync for example) can lead to an AzureAD compromise. + + + Check if password roation is in place with AzureAD SSO + + + The purpose is to ensure that there is no use of the obsolete and vulnerable OS Windows 7 for the workstations within the domain + + + https://techcommunity.microsoft.com/t5/windows-it-pro-blog/activate-windows-7-esus-on-multiple-devices-with-a-mak/ba-p/1167196 + + + Presence of Windows 7 = {count} + + + The detail can be found in <a href="#operatingsystems">Operating Systems</a> + + + In order to solve this security issue, you should upgrade all the workstations to a more recent version of Windows, starting from Windows 10. Do note that you can get the full details regarding the OS used with the following PowerShell command: <i>Get-ADComputer -Filter * -Property * | Format-Table Name,OperatingSystem,OperatingSystemServicePack,OperatingSystemVersion -Wrap -Auto You can replace [-Filter *] by [-Filter {OperatingSystem -Like "Windows Server*"}</i> + + + The Windows 7 OS is not supported any longer, as it is vulnerable to many publicly known exploits: Administrator's credentials can be captured, security protocols are weak, etc. +PingCastle is trying to guess if support has been purchased from Microsoft. Based on the documentation referenced below, the program checks if the script Activate-ProductOnline.ps1 is present. +If the script is detected, Windows 7 is considered as supported and this rule is not triggered. + + + Obsolete OS (Windows 7) + + + The purpose is to ensure that no DNS Zones are configured with Zone Transfers. + + + Zone: {0} + + + https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-dnsp/f97756c9-3783-428b-9451-b376f877319a + https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/dnscmd + + + A DNS Zone is configured with Zone Transfers enabled + + + + + + You have to disable Zone Transfers. + Identify the faulty zone in the details below. + Go to the DNS console and select a zone in the "Forward Lookup Zones". + Right click on it and switch to the "Zone Transfers" tab. + Then ensure "Allow zone transfers" is not enabled "To any server". + You can also run: dnscmd /zoneresetsecondaries zone /noxfr + + + + When the Zone Transfers mechanims is enabled, an attacker can retrieve all DNS records anonymously. + He can then use this feature to generate network noise to trigger a man in the middle attack and capture credentials. + + This setting is domain wide, meaning that all servers share the same setting. + Please note that PingCastle does this check to only one DNS Server of the zone. + + To test if the Zone Transfers is enabled, issue the following command: + on Linux: <pre>host -t axfr domain.name dns-server</pre> or <pre>dig axfr @dns-server domain.name</pre> + on Windows: <pre>nslookup</pre> then <pre>server dns-server</pre> then <pre>set type=any</pre> then <pre>ls -d domain.name</pre> + + + + Check if DNS Zones are configured with Zone Transfers. + + + The purpose of this rule is to ensure that there is no LAPS permission problems with computers that have been added manually to the domain by a user + + + + + + https://azurecloudai.blog/2019/10/01/laps-security-concern-computers-joiners-are-able-to-see-laps-password/ +https://www.securityinsider-wavestone.com/2020/01/taking-over-windows-workstations-pxe-laps.html + + + The local admin password of at least one computer can be retrieved by the user who joined the computer to the domain + + + The detail can be found in <a href="#laps">LAPS</a> + + + Review the security of the computer objects listed in the LAPS section below to change their ownership (you can give it to the domain admins group). + Check if the creator has also write permissions to change the owner or the security descriptor and if he has the right "all extended rights" on this object. + If it is the case, remove the permissions granted to this user. + + + + By default, every domain user can add up to 10 computers to the domain (see the rule S-ADRegistration for more information). + When a computer is added to the domain, the owner of the computer object is the user who joined the computer. + To trace this insertion, a special attribute mS-DS-CreatorSID is added, whose value is the SID of its creator. + When LAPS is installed, the local admin account has its password stored in a special attribute named, by default, ms-mcs-AdmPwd. Its access is retricted. + Because the user who created it is the owner of the underlying object, it can retrieve the LAPS attribute and get the local admin password. + + In addition to check if the owner of the computer object is the user which added it, this program checks also if this user have an explicit permission on this object to write the owner, write the security descriptor, or "all extended rights". + Indeed, the right "all extended rights" allows to read the LAPS password and write access to these attributes can cancel the security hardening of changing the owner. + + + + Check if LAPS passwords can be retrieved from computers that has been added manually by users. + + + The purpose of this rule is to ensure that there is no certificate template that can be edited by anyone + + + Name: {0} + + + https://posts.specterops.io/certified-pre-owned-d95910965cd2 +https://www.riskinsight-wavestone.com/en/2021/06/microsoft-adcs-abusing-pki-in-active-directory-environment/ + + + At least one certificate template can be modified by everyone [{count}] + + + The detail can be found in <a href="#certificatetemplates">Certificate Templates</a> + + + Review the security permissions of this certificate template and remove the write access to everyone-like group such as domain user, domain computers, everyone, authenticated users, ... + + + + A certificate template is an object whose definition serves as a base to issue certificates. + If a user has the right to edit it, it can manually change obscure attributes such as msPKI-Certificate-Name-Flag. + Doing so will enable him to provide the subject of the certificate and thus having a certificate on behalf other users such as admins. + It can be used to impersonate them and take control of the domain + + + Check if certificate templates can be edited by everyone. + + + The purpose of this rule is to ensure that there is no certificate template with any purpose that can be requested by anyone + + + Name: {0} + + + https://posts.specterops.io/certified-pre-owned-d95910965cd2 +https://www.riskinsight-wavestone.com/en/2021/06/microsoft-adcs-abusing-pki-in-active-directory-environment/ + + + At least one certificate template can be requested by everyone having any purpose [{count}] + + + The detail can be found in <a href="#certificatetemplates">Certificate Templates</a> + + + Review the permissions that allow a wide enrollement of this certificate template automatically or specify a specific purpose (EKU) + + + + A certificate should define restrictions of its use. It is done via extensions known as EKU (extended key usage). + Without a proper purpose or with the global purpose "Any Purpose" it can be used to enroll certificates on behalf other users and impersonate them using it. + + + Check the purpose provided by certificate templates + + + The purpose of this rule is to ensure that there is no agent certificate that can be requested by anyone + + + Name: {0} + + + https://posts.specterops.io/certified-pre-owned-d95910965cd2 +https://www.riskinsight-wavestone.com/en/2021/06/microsoft-adcs-abusing-pki-in-active-directory-environment/ + + + At least one certificate template can be used to issue agent certificate to everyone [{count}] + + + The detail can be found in <a href="#certificatetemplates">Certificate Templates</a> + + + Review the permissions that allow a wide enrollement of this certificate template + + + + An Agent certificate is a special certificate used to request certificate on behalf other users. + A template has been detected with the agent EKU and that can be enrolled by a large number of users. + + + Check the permission of agent certificate templates + + + The purpose of this rule is to ensure that there is no certificate request having an authentication purpose whose subject can be modified + + + Name: {0} + + + https://posts.specterops.io/certified-pre-owned-d95910965cd2 +https://www.riskinsight-wavestone.com/en/2021/06/microsoft-adcs-abusing-pki-in-active-directory-environment/ + + + At least one certificate template used for authentication can have its subject modified when being used [{count}] + + + The detail can be found in <a href="#certificatetemplates">Certificate Templates</a> + + + On the certificate template properties, uncheck in the property sheet "Subject Name" the field "Supply in the request". + Or in alternative, restrict this template to a restricted group. + + + + Usually, the subject of a certificate is generated automatically by the certification authority. + By allowing its manual edition before its issuance, a malicious user can set the subject to match an administrator account, and thus get a certificate representing them. + This certificate can be abuse later to impersonate them. + + + Check the if a custom subject can be pushed on an authentication certificate templates + + + The purpose is check if the "Pre-Windows 2000 Compatible Access" group contains authenticated users + + + https://msdn.microsoft.com/en-us/library/cc223672.aspx + + + The PreWin2000 compatible group contains "authenticated users" + + + Remove "authenticated users" from the PreWin2000 group. + + + The pre-Windows 2000 compatible access group grants access to some RPC calls. + Its default and secure value is the "Authenticated Users" group which allows users to perform group look up using legacy protocols. + + If this group contains "Authenticated Users", it increases the impact on the exploitation vulnerability on legacy protocols such as the printer spooler. + Indeed, in the #PrintNightmare attack, it enables a patch bypass on domain controllers because the property Elevated Token is on when establishing a session to the DC. + Removing the group can have side impacts and as a consequence, this is reported here as a special hardening measure. + + + + Check that the "Pre-Windows 2000 Compatible Access" group does not contain "Authenticated Users" + + + The purpose is to ensure that there is no use of non supported version of Windows 10 within the domain + + + https://docs.microsoft.com/en-us/windows/release-health/release-information + + + Presence of non supported Windows 10 = {count} + + + The detail can be found in <a href="#operatingsystems">Operating Systems</a> + + + In order to solve this security issue, you should upgrade all the Windows 10 to a more recent version. + Do note that you can get the full details regarding the OS used with the following PowerShell command: <i>Get-ADComputer -Filter * -Property * | Format-Table Name,OperatingSystem,OperatingSystemServicePack,OperatingSystemVersion -Wrap -Auto You can replace [-Filter *] by [-Filter {OperatingSystem -Like "Windows 10*"}</i> + + + Some versions of Windows 10 OS is not supported any longer, and may be vulnerable to exploits that are not patched anymore. + + + Obsolete OS (Windows 10) + + + Version: {0} Number: {1} Active: {2} + + + The purpose is to ensure that there is no schema class that can be used to create arbitrary objects + + + +https://bugs.chromium.org/p/project-zero/issues/detail?id=2186 +https://gist.github.com/IISResetMe/399a75cfccabc1a17d0cc3b5ae29f3aa#file-update-msexchstoragegroupschema-ps1 +https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-34470 + + + Presence of vulnerable schema class = {count} + + + + + + For PossSuperiorComputer: + You have to edit the schema to change the value of the attribute possSuperior and remove the "computer" value. + A powershell script in the documentation provides a fix. + +For PossSuperiorUser: + You have to edit the schema to change the value of the attribute possSuperior and remove the "user" value. + A powershell script in the documentation provides a fix. + +Also the class msExchStorageGroup is known to have this vulnerability via the CVE-2021-34470. +In this case, the vulnerability is exploitable even if Exchange has been uninstalled. + + + The Classes added to the schema provide additional object types. If misconfigured, a class can be used to bypass security restriction. + For the vulnerability PossSuperiorComputer: + A class has the attribute possSuperiors containing the class "computer" and this class inherits from "container". + That means that every computer can request this class to be added. + Once this class has been added, it can be used as a container to create additional users or computers without restrictions. + + For the vulnerability PossSuperiorUser: + It is the same vulnerability than PossSuperiorComputer but with the "user" class instead of the "computer" class. + + + + Vulnerable Schema Class check + + + Class: {0} Vulnerability: {1} + + \ No newline at end of file diff --git a/static/images/pingcastle.png b/static/images/pingcastle.png new file mode 100644 index 0000000..4f36150 Binary files /dev/null and b/static/images/pingcastle.png differ diff --git a/system/forms.py b/system/forms.py index 0d3bdea..dd6d96a 100644 --- a/system/forms.py +++ b/system/forms.py @@ -1213,10 +1213,14 @@ class NewPath(FlaskForm): validators=[AnyOf(['connection', 'attack'])], default='connection') direction = StringField('direction', - validators=[AnyOf(['forward', 'backward', 'two_side'])], - default='forward') + validators=[AnyOf(['forward', 'backward', 'two_side'])], + default='forward') class DeletePath(FlaskForm): path_id = StringField('path_id', validators=[UUID(message='Wrong UUID!')]) + + +class PingCastleForm(FlaskForm): + xml_files = MultipleFileField('xml_files') diff --git a/templates/project/tools/import/pingcastle.html b/templates/project/tools/import/pingcastle.html new file mode 100644 index 0000000..f8be00d --- /dev/null +++ b/templates/project/tools/import/pingcastle.html @@ -0,0 +1,92 @@ + + +{% include 'header.html' %} + +
+ {% include 'menu.html' %} +
+
+ {% include 'project/sidebar.html' %} +
+ +
+

PingCastle

+
+
+
+
+ {% if external_img %} + + {% else %} + + {% endif %} +
+
+ PingCastle + +
+ Ping Castle is a tool designed to assess quickly the Active Directory security level with a methodology based on risk assessment and a maturity framework. It does not aim at a perfect evaluation but rather as an efficiency compromise. +
+ +
+
+
+
+

Upload reports

+
+ + +
+ + +
+
+
+ +
+
+
+ {% if errors is defined and errors %} +
+ +
+ There were some errors with host +
+
    + {% for error in errors %} +
  • {{ error }}
  • + {% endfor %} +
+
+ {% elif errors is defined and not errors %} +
+ +
+ Successfully uploaded! +
+
+ {% endif %} +
+
+ {% include 'footer.html' %} +
+
+ + \ No newline at end of file diff --git a/templates/project/tools/list.html b/templates/project/tools/list.html index 3362df9..4f859ff 100644 --- a/templates/project/tools/list.html +++ b/templates/project/tools/list.html @@ -260,6 +260,11 @@

Tools

Fast and customizable vulnerability scanner based on simple YAML based DSL.

Open + +

PingCastle

+

Ping Castle is a tool designed to assess quickly the Active Directory security level with a methodology based on risk assessment and a maturity framework. It does not aim at a perfect evaluation but rather as an efficiency compromise.

+ Open +