|
@@ -84,6 +84,8 @@ SharpHound.exe -c All
|
|
SharpHound.exe -c SessionLoop --MaxLoopTime 24h
|
|
SharpHound.exe -c SessionLoop --MaxLoopTime 24h
|
|
```
|
|
```
|
|
|
|
|
|
|
|
+Custom Bloodhound Queries: [https://github.com/hausec/Bloodhound-Custom-Queries](https://github.com/hausec/Bloodhound-Custom-Queries)
|
|
|
|
+
|
|
### Local AD Accounts
|
|
### Local AD Accounts
|
|
|
|
|
|
* check the local Serviec account if any AD account is used
|
|
* check the local Serviec account if any AD account is used
|
|
@@ -186,7 +188,11 @@ lsadump::dcsync /domain:<domain> /all /csv
|
|
#### Background (Kerberos TGT and TGS)
|
|
#### Background (Kerberos TGT and TGS)
|
|
|
|
|
|
1. A attacker authenticates to a domain and gets a ticket-granting-ticket (TGT) from the domain controller that’s used for later ticket requests.
|
|
1. A attacker authenticates to a domain and gets a ticket-granting-ticket (TGT) from the domain controller that’s used for later ticket requests.
|
|
-2. The attacker uses their TGT to issue a service ticket request (TGS-REQ) for a particular servicePrincipalName (SPN) of the form sname/host, e.g. MSSqlSvc/SQL.domain.com. This SPN should be unique in the domain, and is registered in the servicePrincipalName field of a user or computer account. During this request process, the attacker can specify what Kerberos encryption types they support (RC4_HMAC, AES256_CTS_HMAC_SHA1_96, etc).
|
|
+
|
|
|
|
+2. The attacker uses their TGT to issue a service ticket request (TGS-REQ) for a particular servicePrincipalName (SPN) of the form sname/host, e.g. MSSqlSvc/SQL.domain.com.
|
|
|
|
+This SPN should be unique in the domain, and is registered in the servicePrincipalName field of a user or computer account.
|
|
|
|
+During this request process, the attacker can specify what Kerberos encryption types they support (RC4_HMAC, AES256_CTS_HMAC_SHA1_96, etc).
|
|
|
|
+
|
|
3. If the attacker’s TGT is valid, the DC extracts information from the TGT stuffs it into a service ticket. Then the domain controller looks up which account has the requested SPN registered in its servicePrincipalName field. The service ticket is encrypted with the hash of the account with the requested SPN registered, using the highest level encryption key that both the attacker and the service account support. The ticket is sent back to the attacker in a service ticket reply (TGS-REP).
|
|
3. If the attacker’s TGT is valid, the DC extracts information from the TGT stuffs it into a service ticket. Then the domain controller looks up which account has the requested SPN registered in its servicePrincipalName field. The service ticket is encrypted with the hash of the account with the requested SPN registered, using the highest level encryption key that both the attacker and the service account support. The ticket is sent back to the attacker in a service ticket reply (TGS-REP).
|
|
4. The attacker extracts the encrypted service ticket from the TGS-REP. Since the service ticket was encrypted with the hash of the account linked to the requested SPN, the attacker can crack this encrypted blob offline to recover the account’s plaintext password.
|
|
4. The attacker extracts the encrypted service ticket from the TGS-REP. Since the service ticket was encrypted with the hash of the account linked to the requested SPN, the attacker can crack this encrypted blob offline to recover the account’s plaintext password.
|
|
|
|
|
|
@@ -204,9 +210,14 @@ PS> Get-DomainUser -SPN
|
|
|
|
|
|
* For all possible SPN's request tickets with powershell and extract them from memory with `mimikatz`:
|
|
* For all possible SPN's request tickets with powershell and extract them from memory with `mimikatz`:
|
|
|
|
|
|
|
|
+```
|
|
|
|
+Invoke-Kerberoast -OutputFormat hashcat | fl
|
|
|
|
+```
|
|
|
|
+
|
|
|
|
+* Manual
|
|
```
|
|
```
|
|
PS C:\> Add-Type -AssemblyName System.IdentityModel
|
|
PS C:\> Add-Type -AssemblyName System.IdentityModel
|
|
-PS C:\> New-Object System.IdentityModel.Tokens.KerberosRequestorSecurityToken -ArgumentList "HTTP/web01.medin.local"
|
|
+PS C:\> New-Object System.IdentityModel.Tokens.KerberosRequestorSecurityToken -ArgumentList "<your SPN>"
|
|
PS C:\> klist
|
|
PS C:\> klist
|
|
<tickets>
|
|
<tickets>
|
|
```
|
|
```
|