GenericAll Abuse
Introduction
Active Directory users are defined by securable objects known as ACL/ACE's. Active Directory Discretionary Access Control Lists (DACLs) and Acccess Control Entries (ACEs). These define what permissions the user has and can or cannot do (i.e change account name, reset password, etc).
GenericAll is the "God Mode" of the object permissions.
Here are some AD object permissions we're interested in.
GenericAll - full rights to the object (add users to a group or reset user's password - God mode).
GenericWrite - update object's attributes (i.e logon script)
WriteOwner - change object owner to attacker controlled user take over the object
WriteDACL - modify object's ACEs and give attacker full control right over the object
AllExtendedRights - ability to add user to a group or reset password
ForceChangePassword - ability to change user's password
Self (Self-Membership) - ability to add yourself to a group
Abusing GenericAll
There are three types of objects that can a user can have GenericAll permissions. User, Group, and Computer.
To view ACL/ACE permissions we can use tools like PowerView
and Bloodhound
.
GenericAll on User
Change password: You could just change the password of that user with
Targeted Kerberoasting: You could make the user kerberoastable setting an SPN on the account, kerberoast it and attempt to crack offline:
Targeted ASREPRoasting: You could make the user ASREPRoastable by disabling preauthentication and then ASREProast it.
GenericAll on Group
We can add a user we control to the vulnerable group.
GenericAll on Computer
A common attack with generic all on a computer object is to add a fake computer to the domain.
If enumerating and we see a user has GenericAll permission on a computer we know we full control.
We can perform a Kerberos Resourced Based Constrained Delegation attack: computer takover. This attack allows us to impersonate a specific user (Administrator).
Abusing GenericAll Computer Object Kerberoast Ticket Abuse
Also known as: "Resource Based Constrained Delegation Attack"
Toshi's "Impacket" method.
Add Computer to Domain
We'll first need to add a new machine. We can add a computer to the domain with impacket-addcomputer.
Below are some useful commands.
Toshi's rbcd attack
Creating the fake computer
Using addcomputer.py example from Impacket let's create a fake computer (called evilcomputer
):
Modifying delegation rights
The script uses heavily the Python classes in the ntlmrelayx.py
Impacket example. For help and an example call the script without options.
Getting the impersonated service ticket
Now everything is ready for abusing the Constrained Delegation by an S4U2Self query and get an impersonated Service Ticket for the target computer. With getST.py
Impacket example script:
The above command fetches a CIFS Service Ticket on behalf of the targetted domain user admin
and stores it in the file admin.ccache
.
After adding the file path to the KRB5CCNAME variable the ticket is usable for Kerberos clients.
Server Side Method
Here is another way to abuse GenericAll on a computer group
Last updated