Skip to content

Commit 4200f51

Browse files
authored
Merge pull request #20445 from zeroSteiner/feat/lib/ldap-adds/2
Don't look up the local system SID
2 parents e140783 + 90b60c7 commit 4200f51

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/msf/core/exploit/remote/ldap/active_directory.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,9 @@ def adds_sd_grants_permissions?(ldap, security_descriptor, matcher, test_sid: ni
302302
matcher.apply_ace!(ace) if security_descriptor.group_sid == test_sid
303303
when test_sid
304304
matcher.apply_ace!(ace)
305+
when Rex::Proto::Secauthz::WellKnownSids::SECURITY_LOCAL_SYSTEM_SID
306+
# the SECURITY_LOCAL_SYSTEM_SID won't be found if looked up in the next block and if it's not the SID we're checking for, it doesn't apply anyways so just skip it
307+
next
305308
else
306309
ldap_object = adds_get_object_by_sid(ldap, ace.body.sid)
307310
next unless ldap_object && ldap_object[:objectClass].include?('group')

0 commit comments

Comments
 (0)