Kerberos Double Hop problem arises when attacker attempts to use Kerberos authentication across two or more hops.
Let’s say we have three hosts: Attack Host → DEV01 → DC01
Using credentials and evil-winrm, we managed to authenticate to DEV01.
Our credentials are not stored in memory for winrm therefore we will not be present on the system to authenticate to other resource on behalf of our user.
This happens because user’s kerberos TGT ticket is not sent to the remote session so user has no way to prove their identity.
If unconstrained delegation is enabled on a server, it is likely we won’t face the “Double Hop” problem.
In this case, when a user sends their TGS to access the target server, TGT ticket is sent along with the request.
Workarounds
”nested” Invoke-Command to send creds after creating PSCredential object with every request.
Here, we will learn about two methods:
evil-winrm session
GUI access to a Windows host
M1: PSCredential Object
We can connect to remote host and set up a PSCredential object to pass our credentials again.
Below, we can see that command get-domainuser -spn is showing a error since we cannot pass our authentication on to the DC to query for the SPN accounts:
If we check with klist, we only have a cached Kerberos ticket for our current server:
SetUp PSCredential
Let’s set up PSCredential object and try above command again.
First we will set up our authentication:
Now let’s try querying SPN account again using PowerView. We can see that it successfully works since we passed our credentials along with the command:
M2 Register PSSession Configuration
Above we have seen how to overcome “Double Hop” using evil-winrm and PSCredential object.
What if we are on a domain joined host and can connect remotely to another using WinRM? Or we are from a Windows attack host and we are connecting to a target via WinRM using Enter-PSSession cmdlet?
Let’s first set up a WinRM session on the remote host:
In order to interact with the DC from this remote host, we should register a new session configuration using Register-PSSessionsConfiguration:
Once above is done, let’s restart WinRM service by Restart-Service WinRM.
Now, let’s start a new PSSession using the named registered session we set up previously. Now double hop problem is eliminated: