🎭Kerberos "Double Hop" Problem

🎯 HTB Academy: Active Directory Enumeration & Attacks

πŸ“ Overview

The Kerberos "Double Hop" Problem is a critical authentication limitation that occurs when attempting to use Kerberos authentication across two or more network hops. This problem frequently arises during lateral movement operations, particularly when using WinRM/PowerShell remoting, and can significantly impact penetration testing and red team operations. Understanding and overcoming this limitation is essential for successful Active Directory exploitation and lateral movement.


πŸ”— Attack Chain Context

Complete Active Directory Compromise Timeline:

Privileged Access β†’ Double Hop Problem β†’ Lateral Movement Solutions β†’ Infrastructure Control
 (WinRM Access)     (Authentication)      (Credential Workarounds)     (Domain Domination)

Prerequisites from Previous Modules:

  • Privileged access achieved: WinRM/PSRemote rights discovered via BloodHound

  • Valid domain credentials: Obtained through various attack vectors

  • Remote access established: Initial connection to target hosts

  • Multi-hop requirements: Need to access additional resources from compromised hosts


🧠 Technical Fundamentals

Kerberos vs. NTLM Authentication

Kerberos Ticket-Based Authentication

  • Tickets are NOT passwords: Signed pieces of data from KDC stating resource access rights

  • Resource-specific: Each ticket grants access to a specific resource/service

  • Non-transferable: Tickets cannot be reused for different services without proper delegation

  • Time-limited: Tickets have expiration times and renewal periods

  • Delegation-dependent: Require specific delegation configurations for multi-hop scenarios

NTLM Hash-Based Authentication

  • Hash storage: NTLM hash stored in session memory after authentication

  • Reusable: Hash can be used for subsequent authentication attempts

  • Session-persistent: Available for duration of user session

  • Multi-hop capable: Can authenticate to multiple resources without additional configuration

The Core Problem Explained

What Happens During Kerberos Authentication

  1. Initial Authentication: User authenticates to KDC, receives TGT (Ticket Granting Ticket)

  2. Service Request: User requests TGS (Ticket Granting Service) ticket for specific service

  3. Service Access: TGS ticket sent to target service for authentication

  4. Session Establishment: Service validates ticket and grants access

Why the Double Hop Fails

Critical Issue: When connecting via WinRM/PowerShell remoting:

  • TGS ticket sent: Allows access to the immediate target (Host A)

  • TGT ticket NOT sent: Cannot request new TGS tickets for additional resources (Host B)

  • No credential caching: Password/hash not stored in remote session memory

  • Authentication failure: Subsequent resource access denied


πŸ” Practical Demonstration

Scenario Setup

  • Attack Host: Parrot/Kali Linux (domain-external)

  • Target Host A: DEV01 (domain-joined, WinRM accessible)

  • Target Host B: DC01 (Domain Controller, PowerView target)

  • Credentials: INLANEFREIGHT\backupadm with Remote Management Users group membership

Problem Manifestation

1. WinRM Connection Establishment

2. Credential Analysis with Mimikatz

Critical Observation: Mimikatz output shows NO credentials for backupadm user:

Process Verification: WinRM processes running as backupadm:

3. Ticket Analysis

4. PowerView Failure Demonstration


πŸ› οΈ Workaround Solutions

πŸ”§ Workaround #1: PSCredential Object Method

Applicable Scenarios

  • Evil-WinRM sessions: Works perfectly with Linux attack hosts

  • Non-interactive sessions: No GUI access required

  • Command-by-command basis: Credentials passed with each PowerView command

  • Flexibility: Can be used with any PowerShell cmdlet supporting -Credential parameter

Implementation Steps

1. Establish WinRM Session:

2. Create PSCredential Object:

3. Execute Commands with Credentials:

4. Verification of Failure Without Credentials:

Advantages of PSCredential Method

  • βœ… Works with Evil-WinRM: Perfect for Linux-based attack hosts

  • βœ… No GUI required: Fully command-line compatible

  • βœ… Flexible application: Can be used with any credential-supporting cmdlet

  • βœ… Immediate solution: No service restarts or configuration changes required

Limitations of PSCredential Method

  • ❌ Command-by-command: Must specify credentials with each command

  • ❌ Tool compatibility: Some tools may not support -Credential parameter

  • ❌ Verbose syntax: Increases command complexity

πŸ”§ Workaround #2: Register PSSession Configuration Method

Applicable Scenarios

  • GUI access available: RDP or physical console access to Windows host

  • Administrative privileges: Ability to register PSSession configurations

  • Persistent sessions: Long-term enumeration without repeated credential passing

  • Tool compatibility: Works with tools that don't support -Credential parameter

Prerequisites

  • Windows attack host or compromised domain-joined machine

  • GUI access via RDP

  • Administrative privileges on the host

  • PowerShell console (not Evil-WinRM)

Implementation Steps

1. Initial WinRM Connection:

2. Verify Double Hop Problem:

3. Register New PSSession Configuration:

4. Restart WinRM Service:

5. Connect Using Named Configuration:

6. Verify Ticket Availability:

7. Successful Domain Enumeration:

Advantages of PSSession Configuration Method

  • βœ… Persistent solution: No need to pass credentials with each command

  • βœ… Tool compatibility: Works with all PowerShell tools and modules

  • βœ… Native authentication: Proper Kerberos ticket caching

  • βœ… Performance: Faster execution without repeated authentication

Limitations of PSSession Configuration Method

  • ❌ GUI requirement: Cannot be used with Evil-WinRM

  • ❌ Administrative privileges: Requires ability to register PSSession configurations

  • ❌ Service restart: Requires WinRM service restart

  • ❌ Platform limitation: Does not work from Linux PowerShell due to Kerberos limitations


🎯 Attack Scenarios and Use Cases

Common Double Hop Scenarios

Scenario 1: Linux Attack Host β†’ Windows Target β†’ Domain Controller

Solution: PSCredential Object method via Evil-WinRM

Scenario 2: Windows Attack Host β†’ Jump Host β†’ Internal Servers

Solution: PSSession Configuration or PSCredential Object method

Scenario 3: Compromised Workstation β†’ Domain Controller β†’ Trust Domains

Solution: Depends on delegation configuration and trust relationship

Real-World Impact Examples

PowerView Domain Enumeration

BloodHound Data Collection

Credential Dumping Operations


πŸ” Technical Deep Dive

Unconstrained Delegation Exception

When Double Hop Problem Doesn't Occur

If unconstrained delegation is enabled on a server:

  • TGT ticket forwarded: User's TGT sent along with TGS request

  • Credential caching: Target server caches user's TGT

  • Impersonation capability: Server can request TGS tickets on user's behalf

  • Attack opportunity: Unconstrained delegation servers are high-value targets

Identifying Unconstrained Delegation

Constrained Delegation Scenarios

Service-Specific Delegation

  • Limited scope: Delegation only to specific services

  • Protocol transition: May allow protocol changes (Kerberos to NTLM)

  • S4U2Self/S4U2Proxy: Service for User extensions enable constrained delegation

Resource-Based Constrained Delegation (RBCD)

  • Target-controlled: Delegation configured on target resource

  • Modern approach: Newer delegation method in Windows 2012+

  • Attack vector: Can be abused if target object permissions allow modification


πŸ” Alternative Solutions and Advanced Techniques

CredSSP (Credential Security Support Provider)

Implementation

Security Considerations

  • Credential exposure: Sends credentials to remote server

  • Security risk: Credentials cached on target system

  • Use with caution: Only in trusted environments

Port Forwarding Solutions

SSH Tunneling

Chisel/SocksOverRDP

Process Injection Techniques

Token Impersonation

Sacrificial Process Method

  • Create process: Start new process as target user

  • Inject payload: Insert shellcode or .NET assembly

  • Inherit context: Process runs with target user's full credentials


πŸ›‘οΈ Detection and Defensive Measures

Monitoring Double Hop Workarounds

PSSession Configuration Detection

CredSSP Usage Detection

PowerShell Logging Enhancement

Script Block Logging

Module Logging

Network Monitoring

Kerberos Traffic Analysis

  • AS-REQ/AS-REP: Initial authentication requests

  • TGS-REQ/TGS-REP: Service ticket requests

  • Unusual patterns: Multiple service ticket requests from single host

  • Cross-subnet authentication: Unexpected Kerberos traffic patterns

WinRM Traffic Monitoring

  • Port 5985/5986: Monitor WinRM HTTP/HTTPS traffic

  • SOAP XML analysis: Examine WinRM command content

  • Session duration: Identify long-running remote sessions


πŸš€ Advanced Attack Chains

Double Hop in Complex Scenarios

Multi-Domain Trust Exploitation

Challenges:

  • Cross-domain authentication: Different Kerberos realms

  • Trust relationship dependencies: Transitive vs. non-transitive trusts

  • Delegation configurations: Per-domain delegation settings

Cloud Hybrid Environments

Considerations:

  • Authentication protocols: Kerberos vs. SAML vs. OAuth

  • Credential synchronization: Password hash sync vs. pass-through authentication

  • Hybrid identity: On-premises accounts with cloud access

Automation and Scripting

Automated Workaround Implementation

PowerShell Empire Integration


πŸ“Š Key Takeaways

Technical Understanding

  1. Kerberos vs. NTLM: Fundamental difference in credential handling

  2. Ticket mechanics: TGT vs. TGS ticket usage and limitations

  3. Authentication delegation: Constrained, unconstrained, and resource-based delegation

  4. Network protocols: WinRM, RDP, and their authentication mechanisms

Practical Solutions

  1. PSCredential Object: Universal solution for Evil-WinRM and command-line scenarios

  2. PSSession Configuration: Persistent solution for GUI-accessible Windows hosts

  3. Alternative methods: CredSSP, port forwarding, and process injection techniques

  4. Tool compatibility: Understanding which tools support which workarounds

Operational Considerations

  1. Attack platform: Linux vs. Windows attack host capabilities

  2. Target environment: Domain topology and delegation configurations

  3. Detection risk: Monitoring and logging considerations

  4. Persistence vs. stealth: Balancing effectiveness with operational security

Professional Application

  • Red team operations: Realistic attack simulation with proper lateral movement

  • Penetration testing: Comprehensive domain exploitation methodology

  • Security assessment: Understanding authentication boundaries and limitations

  • Incident response: Recognizing double hop exploitation techniques

πŸ”‘ Complete mastery of Kerberos "Double Hop" Problem - from technical understanding through practical workarounds to advanced attack chains - representing essential Active Directory lateral movement expertise for enterprise penetration testing!


Last updated