Active Directory Assessment and Privilege Escalation Script
I take absolutely no credit for the modules used in this script. Thanks to the original authors for the modules used in this script, credits and links below.
Let's be honest, this is not a red team script. If you're worried about opsec, this script is not for you as it is loud. If you don't want to mess with the hassel of downloading multiple scripts during a pentest or risk assessment, then this might just be for you. In my previous engagements and assessments, I would run a few Powershell scripts that help identify next targets, check for bad group policy settings, AD misconfigs, missing patches, etc. This script combines the ones I used routinely and autoruns the functions I use in those scripts, outputting the results into a zip file.
This script will do the following:
• Gather hashes via WPAD, LLMNR, and NBT-NS spoofing
• Check for GPP password (MS14-025)
• Gather hashes for accounts via Kerberoast
• Map out the domain and identify targets via BloodHound
• Check for privilege escalation methods
• Search for open SMB shares on the network
• Search those shares and other accessible directories for sensitive files and strings (Passwords, PII, or whatever your want, really). By default it's looking for the term "password". If you wanted to search for CVVs for example, you'd just add it next to 'password', e.g. password,cvv
• Check patches of systems on the network
• Search for file servers
• Search attached shares
• Gather the domain policy
This script requires access to Github, as it just pulls the scripts from Github and automates the collection process. There's an AMSI bypass 1-liner in it to bypass AMSI, so if if you think that will get you caught, feel free to comment it out.
||@harmj0y, @_wald0, @CptJesus||ADAPE.ps1 -Bloodhound|
||@obscuresec, @harmj0y||ADAPE.ps1 -GPP|
||@harmj0y, @mattifestation||ADAPE.ps1 -PrivEsc|
||@harmj0y, @mattifestation||ADAPE.ps1 -PView|
|Everything at once (All of the Above)||n/a||See above||ADAPE.ps1 -All|
All modules in the script require Administrative access except for Bloodhound and PrivEsc (PowerUp).
After running the .ps1, it will create the capture file in the same folder it's being ran in and zips it. If you're running Windows 7 and below it won't zip, so you'll have to do that yourself. At the end of the script, it deletes all the folders it created (except the .zip file, obviously).
GPP password checking and searching sensitive files takes awhile, so don't be surprised if this script takes a long time to finish depending on the number of domain controllers, open shares, and strings you're searching for. Comment those sections out if they take too long to run.
./ADAPE.ps1 -GPP -PView -Kerberoast