Skip to content

Commit

Permalink
Improvements for pwn analysis CreateComputer and CreateUser
Browse files Browse the repository at this point in the history
  • Loading branch information
lkarlslund committed Dec 13, 2021
1 parent a0c64fa commit 81f9141
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
3 changes: 3 additions & 0 deletions modules/engine/object.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const (
ObjectTypeComputer
ObjectTypeManagedServiceAccount
ObjectTypeOrganizationalUnit
ObjectTypeBuiltinDomain
ObjectTypeContainer
ObjectTypeGroupPolicyContainer
ObjectTypeCertificateTemplate
Expand Down Expand Up @@ -320,6 +321,8 @@ func (o *Object) Type() ObjectType {
o.objecttype = ObjectTypeManagedServiceAccount
case "Organizational-Unit":
o.objecttype = ObjectTypeOrganizationalUnit
case "Builtin-Domain":
o.objecttype = ObjectTypeBuiltinDomain
case "Container":
o.objecttype = ObjectTypeContainer
case "Computer":
Expand Down
19 changes: 10 additions & 9 deletions modules/engine/objecttype_enumer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions modules/integrations/activedirectory/analyze/analyze-ad.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ func init() {
Description: "Permissions that lets someone to create a user object in a container",
ObjectAnalyzer: func(o *engine.Object, ao *engine.Objects) {
// Only for containers and org units
if o.Type() != engine.ObjectTypeContainer && o.Type() != engine.ObjectTypeOrganizationalUnit {
if o.Type() != engine.ObjectTypeContainer && o.Type() != engine.ObjectTypeOrganizationalUnit && o.Type() != engine.ObjectTypeBuiltinDomain {
return
}
sd, err := o.SecurityDescriptor()
Expand Down Expand Up @@ -257,7 +257,7 @@ func init() {
Description: "Permissions that lets someone to create a computer object in a container",
ObjectAnalyzer: func(o *engine.Object, ao *engine.Objects) {
// Only for containers and org units
if o.Type() != engine.ObjectTypeContainer && o.Type() != engine.ObjectTypeOrganizationalUnit {
if o.Type() != engine.ObjectTypeContainer && o.Type() != engine.ObjectTypeOrganizationalUnit && o.Type() != engine.ObjectTypeDomainDNS {
return
}
sd, err := o.SecurityDescriptor()
Expand Down

0 comments on commit 81f9141

Please sign in to comment.