
7MS #441: SharpGPOAbuse
About this episode
Hello friends! Sorry to be late with this episode (again) but we've been heads-down in a lot of cool security work, coming up for air when we can! Today's episode features:
-
A little welcome music that is not the usual scatting of gibberish I torture you with
-
Some cool tools I'm playing with in the lab that we'll do future episodes on in the future:
- DetectionLab to practice detecting all the bad things!
- BadBlood to dirty up your AD (your test AD with groups, computers, permissions, etc.). I wish the user import script would let you choose a list of bad passwords to assign the users, but you can also run it manually if you want.
- Cobalt Strike - we're doing a demo right now!
Most of today's episode focuses on SharpGPOAbuse, a tool that can be used to abuse "generic write" access to GPOs (which you might identify after running BloodHound). Here's a sample syntax you could run:
SharpGPOAbuse.exe --AddUserTask --TaskName "Totes Safe Windoze Updatez" --Author SAMPLECO\ADMINISTRATOR --Command "cmd.exe" --Arguments "/c net group \"Domain Admins\" SomeLowPrivUser /ADD DOMAIN" --GPOName "Name of GPO with Generic Write Access" This will push a ScheduledTasks.xml file to \\sample.company\Policies\LONG-STRING-REPRESENTING-THE-GPO-ID\User\Preferences\ScheduledTasks
Now if you find that the task is not pushing correctly, it may be that SharpGPOAbuse.exe hasn't been able to update either the GPT.INI file (in the root of the GPO path) and/or the versionNumber value assigned to the GPO itself.
If you need to adjust the versionNumber and GPT.INI value manually, definitely read this Microsoft article so you know how the number is generated and how to increment it properly. This flippin' sweet RastaMouse blog article also helped this click for me.
If you can't seem to update versionNumber using the PowerShell in Rasta's article, you can also open up ADSI Edit and navigate to Default naming context > DC=your,DC=com > CN=System > CN=Policies > CN=LONG-STRING-REPRESENTING-THE-GPO-ID then get the properties of the folder, scroll down and manually adjust the value for versionNumber.
More from 7 Minute Security
Today I'm throwing an idea at you and I want your honest gut check. I've got this itch to build a big soup-to-nuts course that covers pentesting and running your own security biz: finding clients, sco…
Hey friends! I'm a few days late because of Thanksgiving (blame the turkey and french silk pie, ok?), but I've got a timely tale of pentest pwnage for you. It involves an SMB/LDAP bypass attack that c…
Today I'm talking about how not to sell your security company. Before anybody panics: 7MinSec is NOT for sale! Over the last couple of years, though, I've had some acquisition inquiries, and I'm shari…
Today we're dusting off the Securing Your Community mini-series for part 4! I recap parts 1-3 (Operation Metro Surge, locking down Signal notification previews, and a handy iPhone trick that forces PI…
Today's tale of pentest pwnage is about a GPO escalation path I'd seen before but could never get working, until a bloodhoundcli update introduced me to GroupPolicyBackdoor. I'll cover how it let me t…