Skip to content

Commit 0c9cd49

Browse files
authored
Merge pull request #262 from jakehildreth/fix-esc1-false-positives
fix: new logic should resolve ESC1 false positives.
2 parents fa382c7 + 1c8e193 commit 0c9cd49

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

Invoke-Locksmith.ps1

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,12 @@ function Find-ESC1 {
263263
else {
264264
$SID = ($Principal.Translate([System.Security.Principal.SecurityIdentifier])).Value
265265
}
266-
if ( ($SID -notmatch $SafeUsers) -and ( ($entry.ActiveDirectoryRights -match 'ExtendedRight') -or ($entry.ActiveDirectoryRights -match 'GenericAll') ) ) {
266+
if (
267+
($SID -notmatch $SafeUsers) -and
268+
( ( ($entry.ActiveDirectoryRights -match 'ExtendedRight') -and
269+
( $entry.ObjectType -match '0e10c968-78fb-11d2-90d4-00c04f79dc55|00000000-0000-0000-0000-000000000000' ) ) -or
270+
($entry.ActiveDirectoryRights -match 'GenericAll') )
271+
) {
267272
$Issue = [pscustomobject]@{
268273
Forest = $_.CanonicalName.split('/')[0]
269274
Name = $_.Name
@@ -4969,7 +4974,7 @@ function Invoke-Locksmith {
49694974
[System.Management.Automation.PSCredential]$Credential
49704975
)
49714976

4972-
$Version = '2025.8.25'
4977+
$Version = '2025.9.8'
49734978
$LogoPart1 = @'
49744979
_ _____ _______ _ _ _______ _______ _____ _______ _ _
49754980
| | | | |____/ |______ | | | | | |_____|

Locksmith.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
FunctionsToExport = 'Invoke-Locksmith'
99
GUID = 'b1325b42-8dc4-4f17-aa1f-dcb5984ca14a'
1010
HelpInfoURI = 'https://raw.githubusercontent.com/jakehildreth/Locksmith/main/en-US/'
11-
ModuleVersion = '2025.8.25'
11+
ModuleVersion = '2025.9.8'
1212
PowerShellVersion = '5.1'
1313
PrivateData = @{
1414
PSData = @{

Private/Find-ESC1.ps1

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,12 @@
5656
} else {
5757
$SID = ($Principal.Translate([System.Security.Principal.SecurityIdentifier])).Value
5858
}
59-
if ( ($SID -notmatch $SafeUsers) -and ( ($entry.ActiveDirectoryRights -match 'ExtendedRight') -or ($entry.ActiveDirectoryRights -match 'GenericAll') ) ) {
59+
if (
60+
($SID -notmatch $SafeUsers) -and
61+
( ( ($entry.ActiveDirectoryRights -match 'ExtendedRight') -and
62+
( $entry.ObjectType -match '0e10c968-78fb-11d2-90d4-00c04f79dc55|00000000-0000-0000-0000-000000000000' ) ) -or
63+
($entry.ActiveDirectoryRights -match 'GenericAll') )
64+
) {
6065
$Issue = [pscustomobject]@{
6166
Forest = $_.CanonicalName.split('/')[0]
6267
Name = $_.Name

0 commit comments

Comments
 (0)