Skip to content

Commit

Permalink
Moved computer->machine object creation to early stage of processing,…
Browse files Browse the repository at this point in the history
… and setting role-domaincontroller to hvt
  • Loading branch information
lkarlslund committed Dec 12, 2024
1 parent 2f47b52 commit 3671804
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions modules/integrations/activedirectory/analyze/analyze-ad.go
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,7 @@ func init() {
DomainJoinedSID, sid,
engine.IgnoreBlanks,
engine.Name, computeraccount.Attr(engine.Name),
activedirectory.Type, "Machine",
activedirectory.Type, ObjectTypeMachine.ValueString(),
DnsHostName, computeraccount.Attr(DnsHostName),
)
// ui.Debug().Msgf("Added machine for SID %v", sid.String())
Expand All @@ -980,7 +980,7 @@ func init() {
})
},
"creating Machine objects (representing the machine running the OS)",
engine.BeforeMerge)
engine.BeforeMergeLow)

LoaderID.AddProcessor(func(ao *engine.Objects) {
// Ensure everyone has a family
Expand Down Expand Up @@ -1238,12 +1238,6 @@ func init() {
)

LoaderID.AddProcessor(func(ao *engine.Objects) {
DCsyncObject, _ := ao.FindTwoOrAdd(
engine.Type, engine.ObjectTypeCallableServicePoint.ValueString(),
engine.Name, engine.NewAttributeValueString("DCsync"),
)
DCsyncObject.Tag("hvt")

// Generate member of chains
everyonesid, _ := windowssecurity.ParseStringSID("S-1-1-0")
everyone := FindWellKnown(ao, everyonesid)
Expand All @@ -1264,6 +1258,12 @@ func init() {
ui.Fatal().Msgf("Could not get needed domain information (%v), aborting", err)
}

DCsyncObject, _ := ao.FindTwoOrAdd(
engine.Type, engine.ObjectTypeCallableServicePoint.ValueString(),
engine.Name, engine.NewAttributeValueString("DCsync"),
)
DCsyncObject.Tag("hvt")

dnsroot = strings.ToLower(dnsroot)
TrustMap.Store(TrustPair{
SourceNCName: ncname,
Expand Down Expand Up @@ -1407,6 +1407,7 @@ func init() {
ui.Warn().Msgf("Can not find machine object for RODC %v", object.DN())
} else {
machine.Tag("role-readonly-domaincontroller")
machine.Tag("hvt")
}

// Figure out what hashes this machine has cached - FIXME!
Expand Down Expand Up @@ -1880,6 +1881,8 @@ func init() {
); found {
ca.Tag("role-certificate-authority")
ca.Tag("hvt")
} else {
ui.Warn().Msgf("Couldn't locate dnsHostName %v acting as enrollmentservice", cadns)
}
}

Expand Down

0 comments on commit 3671804

Please sign in to comment.