Active Directory
Tools
Enumeration
Using PowerView
Get Domain Controllers:
Enumerate Domain Users:
Check last password change
Get a specific "string" on a user's attribute
Enumerate user logged on a machine
Enumerate Session Information for a machine
Enum Domain Computers:
Enum Interesting Group Members
Enumerate Shares
Enum Group Policies:
Enum OUs:
Enum ACL
Enum Domain Trust:
Enum Forest Trust:
User Hunting:
Priv Esc to Domain Admin w/ User Hunting
Using AD Module
Using Bloodhound
Exe Ingestor
Powershell Module Ingestor
Other Enumeration Tools
Local Privilege Escalation
Lateral Movement
Powershell Remoting
Enable Powershell Remoting on current Machine (Needs Admin Access)
Entering or Starting a new PSSession (Needs Admin Access)
Remote Code Execution with PS Credentials
Import a powershell module and execute its functions remotelyxecute the command and start a session
Interact with the session
Create a new session
Execute command on the session
Check the result of the command to confirm we have an interactive session
Mimikatz & Invoke-Mimikatz
Dump credentials:
Dump credentials in remote machines:
Execute classic mimikatz commands:
Get User Accounts that are used as Service Accounts
Get every available SPN account, request a TGS and dump its hash
Requesting the TGS for a single account:
Export all tickets using Mimikatz
Get User Accounts that are used as Service Accounts
Get a spesific Accounts hash:
Get any ASREPRoastable Users hashes:
Trying the attack for all domain users
Trying the attack for the specified users on the file
Check for interesting permissions on accounts:
Check if current user has already an SPN setted:
Force set the SPN on the account:
Check if current user has already an SPN setted
Force set the SPN on the account:
List shadow copies using vssadmin (Needs Admnistrator Access)
List shadow copies using diskshadow
Make a symlink to the shadow copy and access it
Discover domain joined computers that have Unconstrained Delegation enabled
List tickets and check if a DA or some High Value target has stored its TGT
Command to monitor any incoming sessions on our compromised server
Dump the tickets to disk:
Impersonate the user using ptt attack:
Enumerate Users and Computers with constrained delegation
If we have a user that has Constrained delegation, we ask for a valid tgt of this user using kekeo
Then using the TGT we have ask a TGS for a Service this user has Access to through constrained delegation
Finally use mimikatz to ptt the TGS
Import Powermad and use it to create a new MACHINE ACCOUNT
Import PowerView and get the SID of our new created machine account
Then by using the SID we are going to build an ACE for the new created machine account using a raw security descriptor:
Next, we need to set the security descriptor in the msDS-AllowedToActOnBehalfOfOtherIdentity field of the computer account we're taking over, again using PowerView
After that we need to get the RC4 hash of the new machine account's password using Rubeus
And for this example, we are going to impersonate Domain Administrator on the cifs service of the target computer using Rubeus
Finally we can access the C$ drive of the target machine
Using dnscmd:
Restart the DNS Service:
Create a .txt file that will contain the shadow copy process script
Importing both dlls from the repo using powershell
Checking if the SeBackupPrivilege is enabled
If it isn't we enable it
Use the functionality of the dlls to copy the ntds.dit database file from the shadow copy to a location of our choice
Dump the SYSTEM hive
Get the SID of the Current Domain using PowerView
Get the SID of the Root Domain using PowerView
Create the Enteprise Admins SID
Forge "Extra" Golden Ticket using mimikatz
Inject the ticket into memory
List the DC of the Root Domain
Or DCsync and dump the hashes using mimikatz
Execute mimikatz on DC as DA to grab krbtgt hash:
On any machine:
DCsync using mimikatz (You need DA rights or DS-Replication-Get-Changes and DS-Replication-Get-Changes-All privileges):
DCsync using secretsdump.py from impacket with NTLM authentication
DCsync using secretsdump.py from impacket with Kerberos Authentication
Exploitation Command runned as DA:
Access using the password "mimikatz"
Dump DSRM password (needs DA privs):
This is a local account, so we can PTH and authenticate!
BUT we need to alter the behaviour of the DSRM account before pth:
Connect on DC:
Alter the Logon behaviour on registry:
If the property already exists:
Get current Security Package:
Append mimilib:
Change the new packages name
ALTERNATIVE:
Dump the trust key
Forge an inter-realm TGT using the Golden Ticket attack
Check for existing Database Links:
PowerUpSQL:
MSSQL Query:
Manualy:
PowerUpSQL (Will Enum every link across Forests and Child Domain of the Forests):
Then we can execute command on the machine's were the SQL Service runs using xp_cmdshell
Or if it is disabled enable it:
Start monitoring for TGTs with rubeus:
Execute the printerbug to trigger the force authentication of the target DC to our machine
Get the base64 captured TGT from Rubeus and inject it into memory:
Dump the hashes of the target domain using mimikatz:
Detailed Articles:
Resources
Last updated