Skip to content

Commit

Permalink
Localmachine analyzer tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
lkarlslund committed Apr 18, 2022
1 parent c4df977 commit 82a90f4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions modules/integrations/localmachine/analyze/analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ func (ld *LocalMachineLoader) ImportCollectorInfo(cinfo localmachine.Info) error
localservicesgroup := ld.ao.AddNew(
activedirectory.ObjectSid, engine.AttributeValueSID(windowssecurity.LocalServiceSID),
engine.DownLevelLogonName, cinfo.Machine.Name+"\\Services",
engine.UniqueSource, uniquesource,
engine.UniqueSource, cinfo.Machine.Name,
)

for _, service := range cinfo.Services {
Expand Down Expand Up @@ -455,7 +455,7 @@ func (ld *LocalMachineLoader) ImportCollectorInfo(cinfo localmachine.Info) error
for _, entry := range sd.Entries {
entrysid := entry.SID
if entry.Type == engine.ACETYPE_ACCESS_ALLOWED {
if entrysid == windowssecurity.AdministratorsSID || entrysid == windowssecurity.SystemSID {
if entrysid == windowssecurity.AdministratorsSID || entrysid == windowssecurity.SystemSID || entrysid.Component(2) == 80 /* Service user */ {
// if we have local admin it's already game over so don't map this
continue
}
Expand Down Expand Up @@ -493,7 +493,9 @@ func (ld *LocalMachineLoader) ImportCollectorInfo(cinfo localmachine.Info) error

if ownersid, err := windowssecurity.SIDFromString(service.ImageExecutableOwner); err == nil {
// Potential translation
// ownersid = MapSID(originalsid, localsid, ownersid)
if ownersid.Component(2) == 80 /* Service user */ {
continue
}

owner := ld.ao.AddNew(
activedirectory.ObjectSid, engine.AttributeValueSID(ownersid),
Expand Down

0 comments on commit 82a90f4

Please sign in to comment.