githubEdit

DACL (Discretionary Access Control List) Attack

DACL is a list of the trustees that are allowed or denied access to objects in Active Directory.

Set Ownership of Group

Using BloodyADarrow-up-right, we can set the user as the owner of a group.

# Install if it does not exist on your machine.
pipx install bloodyAD

bloodyAD --host dc.example.local -d example.local -u <username> -p <password> set owner <group-name> <username>

Add Rights

We may be able to take a full control of securable objects by getting GenericAll permission on OU (Organizational Unit).

1. Ask TGT for Kerberos Authentication

If we want to use Kerberos authentication for attacking DACL, we need to retrieve a TGT for specific user at first. In addition, to avoid authentication error, we need to synchronize the system time with the domain controller using ntpdate or rdate.

# Sync datetime with target system
sudo ntpdate <target-ip>
# or
sudo rdate -n <target-ip>

impacket-getTGT -dc-ip <target-ip> example.local/username:password

The getTGT above dumps a .ccache file which stores TGT.

After dumping the .ccache file, set it to an environment variable for using the later processing.

2. Read DACL

We can use dacledit of impackets. To use dacledit, we need to clone the repository and install dependencies as below:

Note: This repository is updated frequently so errors may occur. If so, try using the git log and git checkout <prev_commit_id> commands to revert to the previous commit and then run it.

Then run the following command:

3. Write DACL

Abuse

After adding rights, we can abuse it with various methods.

Method 1. Add User to Group → Get TGT → Get NT Hash

Method 2. Set Password of Another User

If an user have the permission to set another user password, we can change the password:

After that, we can try further attacks using this user.

References

Last updated