@@ -6,11 +6,11 @@ function Invoke-Scans {
66 . PARAMETER Scans
77 Specifies the type of scans to perform. Multiple scan options can be provided as an array. The default value is 'All'.
88 The available scan options are: 'Auditing', 'ESC1', 'ESC2', 'ESC3', 'ESC4', 'ESC5', 'ESC6', 'ESC8', 'ESC11',
9- 'ESC13', 'ESC15, 'EKUwu', 'All', 'PromptMe'.
9+ 'ESC13', 'ESC15, 'EKUwu', 'ESC16', ' All', 'PromptMe'.
1010
1111 . NOTES
1212 - The script requires the following functions to be defined: Find-AuditingIssue, Find-ESC1, Find-ESC2, Find-ESC3C1,
13- Find-ESC3C2, Find-ESC4, Find-ESC5, Find-ESC6, Find-ESC8, Find-ESC11, Find-ESC13, Find-ESC15
13+ Find-ESC3C2, Find-ESC4, Find-ESC5, Find-ESC6, Find-ESC8, Find-ESC11, Find-ESC13, Find-ESC15, Find-ESC16
1414 - The script uses Out-GridView or Out-ConsoleGridView for interactive selection when the 'PromptMe' scan option is chosen.
1515 - The script returns a hash table containing the results of the scans.
1616
@@ -48,7 +48,7 @@ function Invoke-Scans {
4848 [string ]$SafeUsers ,
4949 [Parameter (Mandatory )]
5050 [string ]$SafeOwners ,
51- [ValidateSet (' Auditing' , ' ESC1' , ' ESC2' , ' ESC3' , ' ESC4' , ' ESC5' , ' ESC6' , ' ESC7' , ' ESC8' , ' ESC11' , ' ESC13' , ' ESC15' , ' EKUwu' , ' All' , ' PromptMe' )]
51+ [ValidateSet (' Auditing' , ' ESC1' , ' ESC2' , ' ESC3' , ' ESC4' , ' ESC5' , ' ESC6' , ' ESC7' , ' ESC8' , ' ESC11' , ' ESC13' , ' ESC15' , ' EKUwu' , ' ESC16 ' , ' All' , ' PromptMe' )]
5252 [array ]$Scans = ' All' ,
5353 [Parameter (Mandatory )]
5454 [string ]$UnsafeUsers ,
@@ -102,7 +102,7 @@ function Invoke-Scans {
102102 [array ]$ESC6 = Find-ESC6 - ADCSObjects $ADCSObjects - UnsafeUsers $UnsafeUsers
103103 }
104104 ESC7 {
105- Write-Host ' Identifying Issuing CAs with ESC7...'
105+ Write-Host ' Identifying Issuing CAs with Non-Standard Admins ( ESC7) ...'
106106 [array ]$ESC7 = Find-ESC7 - ADCSObjects $ADCSObjects - UnsafeUsers $UnsafeUsers - SafeUsers $SafeUsers
107107 }
108108 ESC8 {
@@ -125,6 +125,10 @@ function Invoke-Scans {
125125 Write-Host ' Identifying AD CS templates with dangerous ESC15/EKUwu configurations...'
126126 [array ]$ESC15 = Find-ESC15 - ADCSObjects $ADCSObjects - SafeUsers $SafeUsers
127127 }
128+ ESC16 {
129+ Write-Host ' Identifying Issuing CAs with szOID_NTDS_CA_SECURITY_EXT disabled (ESC16)...'
130+ [array ]$ESC16 = Find-ESC16 - ADCSObjects $ADCSObjects - UnsafeUsers $UnsafeUsers
131+ }
128132 All {
129133 Write-Host ' Identifying auditing issues...'
130134 [array ]$AuditingIssues = Find-AuditingIssue - ADCSObjects $ADCSObjects
@@ -141,7 +145,7 @@ function Invoke-Scans {
141145 [array ]$ESC5 = Find-ESC5 - ADCSObjects $ADCSObjects - SafeUsers $SafeUsers - DangerousRights $DangerousRights - SafeOwners $SafeOwners - SafeObjectTypes $SafeObjectTypes - UnsafeUsers $UnsafeUsers
142146 Write-Host ' Identifying Certificate Authorities with EDITF_ATTRIBUTESUBJECTALTNAME2 enabled (ESC6)...'
143147 [array ]$ESC6 = Find-ESC6 - ADCSObjects $ADCSObjects - UnsafeUsers $UnsafeUsers
144- Write-Host ' Identifying Certificate Authorities with ESC7...'
148+ Write-Host ' Identifying Certificate Authorities with Non-Standard Admins ( ESC7) ...'
145149 [array ]$ESC7 = Find-ESC7 - ADCSObjects $ADCSObjects - UnsafeUsers $UnsafeUsers - SafeUsers $SafeUsers
146150 Write-Host ' Identifying HTTP-based certificate enrollment interfaces (ESC8)...'
147151 [array ]$ESC8 = Find-ESC8 - ADCSObjects $ADCSObjects - UnsafeUsers $UnsafeUsers
@@ -151,11 +155,12 @@ function Invoke-Scans {
151155 [array ]$ESC13 = Find-ESC13 - ADCSObjects $ADCSObjects - SafeUsers $SafeUsers - ClientAuthEKUs $ClientAuthEkus - UnsafeUsers $UnsafeUsers
152156 Write-Host ' Identifying AD CS templates with dangerous ESC15 configurations...'
153157 [array ]$ESC15 = Find-ESC15 - ADCSObjects $ADCSObjects - SafeUsers $SafeUsers - UnsafeUsers $UnsafeUsers
154- Write-Host
158+ Write-Host ' Identifying Certificate Authorities with szOID_NTDS_CA_SECURITY_EXT disabled (ESC16)...'
159+ [array ]$ESC16 = Find-ESC16 - ADCSObjects $ADCSObjects - UnsafeUsers $UnsafeUsers
155160 }
156161 }
157162
158- [array ]$AllIssues = $AuditingIssues + $ESC1 + $ESC2 + $ESC3 + $ESC4 + $ESC5 + $ESC6 + $ESC7 + $ESC8 + $ESC11 + $ESC13 + $ESC15
163+ [array ]$AllIssues = $AuditingIssues + $ESC1 + $ESC2 + $ESC3 + $ESC4 + $ESC5 + $ESC6 + $ESC7 + $ESC8 + $ESC11 + $ESC13 + $ESC15 + $ESC16
159164
160165 # If these are all empty = no issues found, exit
161166 if ($AllIssues.Count -lt 1 ) {
@@ -178,5 +183,6 @@ function Invoke-Scans {
178183 ESC11 = $ESC11
179184 ESC13 = $ESC13
180185 ESC15 = $ESC15
186+ ESC16 = $ESC16
181187 }
182188}
0 commit comments