Skip to content

Commit

Permalink
Reduced output on many missing groups when resolving from %Computername%
Browse files Browse the repository at this point in the history
  • Loading branch information
lkarlslund committed May 9, 2022
1 parent 6e50c67 commit 777c584
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion modules/integrations/activedirectory/analyze/analyze-ad.go
Original file line number Diff line number Diff line change
Expand Up @@ -1501,6 +1501,7 @@ func init() {
)

Loader.AddProcessor(func(ao *engine.Objects) {
var warnlines int
for _, gpo := range ao.Filter(func(o *engine.Object) bool {
return o.Type() == engine.ObjectTypeGroupPolicyContainer
}).Slice() {
Expand Down Expand Up @@ -1536,7 +1537,10 @@ func init() {
)

if len(targetgroups) == 0 {
log.Warn().Msgf("Could not find group %v", realgroup)
if warnlines < 10 {
log.Warn().Msgf("Could not find group %v", realgroup)
}
warnlines++
} else if len(targetgroups) == 1 {
for _, method := range methods.Methods() {
targetgroups[0].PwnsEx(affected, method, true)
Expand All @@ -1550,6 +1554,10 @@ func init() {

}
}
if warnlines > 0 {
log.Warn().Msgf("%v groups could not be resolved, this could affect analysis results", warnlines)
}

}, "Resolve expanding group names to real names from GPOs",
engine.AfterMerge,
)
Expand Down

0 comments on commit 777c584

Please sign in to comment.