📖
Building a Windows AD lab
  • Building a Windows AD lab
  • Lab-setup
    • Lab overview
    • Building the lab
      • Prerequisite
      • Creating images
        • Optional: Install software & Settings
      • Network setup
      • Cloning & Creating VM's
      • Creating bank.local
        • Creating Domain Controller - DC01
          • Enable RDP
        • Creating amsterdam.bank.local
          • Creating Domain Controller - DC02
            • Creating a AD structure
            • Create a CA
            • Configure LDAPS
          • Creating Fileserver - FILE01
            • File services
          • Creating W10 client - WS01
            • PSRemoting
          • Creating Webserver - WEB01
            • Web Services
            • SQL Server
              • Create database
      • Creating secure.local
        • Creating Domain Controller - DC03
        • Creating File/SQL Server - DATA01
          • SQL Server
            • Create database
    • Attack Paths
      • Attack path 1 (hard)
        • Configuring
        • Tasks
        • Manual
      • Attack path 2
        • Configuring
        • Task
        • Manual
    • Troubleshooting
    • To-Do
  • Vulnerabilities & Misconfigurations & Attacks
    • Initial Access Attacks
      • Username Enumeration
        • Password Spraying
        • AS-REP Roasting
        • Empty Password
      • SMB Relaying
      • SMB Null-Session (To-Do)
      • SQL Server default login
    • Active Directory Attacks
      • Password spraying
      • AS-REP Roasting
      • Empty password
      • Password in description
      • Kerberoasting
      • Delegation Attacks
        • Unconstrained Delegation
          • Printerbug
        • Constrained Delegation
        • Resource Based Constrained Delegation
          • Computeraccount Takeover
          • Change-LockScreen
          • Webclient Attack (todo)
      • DACL-Abuses
        • Write Owner
        • Owns
        • WriteDacl
        • GenericAll
        • GenericWrite (todo)
        • ForceChangePassword
        • Add user to group (todo)
        • Targeted Kerberoast (todo)
        • Get-Changes
      • Reused local administrator (todo)
      • SQL Server Attacks (todo)
        • Initial Access
          • SQL Server default login
          • Normal domain user access
        • Privilege Escalation
          • Impersonation
          • DB-Owner
          • Enumerate Logins
            • Weak passwords
        • Executing Commands
        • Database-Links
        • Capturing hashes & Relaying
      • Reading LAPS passwords (todo)
      • Priviliged Groups (todo)
        • DNS-Admins (todo)
        • Account Operators (todo)
        • Backup Operators
        • Server Operators (todo)
      • Hopping domains and forests
        • Child to parent domain
          • Krbtgt hash
          • Trust key
        • Cross forest Attacks (todo)
          • Foreign user
    • Misc
      • Reverse shell trick
      • Lateral Movement
        • PSRemoting
        • PsExec (todo)
      • Misconfigured Service (todo)
        • Unqouted Service Path
      • Discovering Shares
      • Password on shares
      • Different methods of dumping credentials
        • LSASS (todo)
        • Dumping DPAPI
          • Browser passwords
        • Scheduled tasks (todo)
        • Services (todo)
        • Vssadmin Shadow Copy
      • ms-ds-machineaccountquota (todo)
      • add DNS Records (todo)
      • Bypassing UAC
    • Template page
  • Defence
    • Detection
    • Hardening
      • LDAP
        • LDAP Signing
        • LDAPS Binding
      • Strong Password Policy
      • Change who can join computers to the domain
      • Protected users group
      • Account is sensitive and cannot be delegated
      • Powershell Execution Policy
      • Template page
Powered by GitBook
On this page
  • Configuring
  • Prerequisite
  • Configuring
  • Attacking
  • How it works
  • Tools
  • Executing the attack
  • Cleanup
  • Defending
  • Recommendations
  • Detection
  • References
Edit on GitHub
  1. Vulnerabilities & Misconfigurations & Attacks
  2. Active Directory Attacks
  3. DACL-Abuses

Owns

If you are "Owner" of a object, you can change the DACL of the object.

PreviousWrite OwnerNextWriteDacl

Last updated 2 years ago

Configuring

Prerequisite

Configuring

Nothing need to be configured to abuse this since we set the Owner of the object during the attack in the "Write Owner" section. If you would like to configure this it can be configured the same way as we configured "Write Owner".

Attacking

How it works

If you are "Owner" of a object, you can change the DACL of the object. Meaning you can give any object "GenericAll" or any other specific permissions.

Tools

Executing the attack

  1. We will continue the attack from where we left off from the page "Write Owner".

2. We just made the user sa_sql owner of the computerobject DATA01. The next step is to write to the DACL of the computerobject and give sa_sql genericall permission. This can be done with PowerView and the cmdlet Add-DomainObjectAcl.

Add-DomainObjectAcl -Domain secure.local -Credential $creds -TargetIdentity DATA01 -PrincipalIdentity sa_sql -Rights All -Verbose

3. PowerView gives some errors but it seems like it found the correct information and tried to set the ACL's. We can check this by running BloodHound again or querying the Domain Controller for all ACL's from DATA01 and filter. First we have to get the objectsid from the user sa_sql and then we can use the cmdlet Get-DomainObjectACL to query all the ACL's for DATA01.

Get-DomainUser -Domain secure.local -Credential $creds -Server 10.0.0.100 sa_sql | Select-Object samaccountname, objectsid
Get-DomainObjectAcl -Domain secure.local -Credential $creds -Server 10.0.0.100 -SamAccountName data01 | ? {$_.SecurityIdentifier -eq "S-1-5-21-1498997062-1091976085-892328878-1106"}

From the output we can see that the user sa_sql has GenericAll permission on DATA01. Since we own the lab we can also check it out on the Domain Controller, the same way as we configured the Owner permissions. And it has all the permissions:

4. The next step to abuse the GenericAll permissions page which will send you to two more pages. To abuse the privileges for DATA01 the computeraccount takeover attack should be executed:

Cleanup

  1. Login to DC03 as Administrator with the password Welcome01!.

  2. Open "Active Directory Users and Computers" and open the "Computers" section and open the "Properties" for the computerobject DATA01. Make sure the "Advanced Features" are enabled.

  3. Open the "Security" tab and click on "Advanced". Change the owner to the group "Domain Admins"

  4. Delete the sa_sql user from the permission entries. Then add it again and give it the permissions "Modify Owner" like we did in the "Write Owner" section to configure the vulnerability. So its ready to be abused again. (Which is easier then deselecting everything)

Defending

Recommendations

Detection

References

Write Owner
PowerView
Write Owner
GenericAll
Computeraccount Takeover
Edges — BloodHound 3.0.3 documentation
Logo