Windows Authentication, Relay, and Lateral Movement

Windows Authentication, Relay, and Lateral Movement

Authorized-lab scope

This chapter explains credential and lateral-movement risks for controlled validation and defense. Use synthetic identities and isolated systems. Stop at proof of control failure. Do not collect real credentials, silently control user sessions, deploy payloads, or relay production authentication.

BLUF

The most important distinction is the material being abused:

These techniques have different prerequisites, targets, telemetry, and mitigations. A captured NetNTLMv2 response is not an NT hash and cannot be treated as a generic PtH credential.

1. Identity-material map

flowchart LR
    P[Password] --> H[NT hash]
    H --> N[NTLM challenge-response]
    P --> K[Kerberos long-term key]
    K --> TGT[Ticket-granting ticket]
    TGT --> ST[Service ticket]

    H --> PTH[Pass-the-hash]
    N --> RELAY[NTLM relay]
    TGT --> PTT[Pass-the-ticket]
    ST --> PTT

    LOGON[Successful Windows logon] --> TOKEN[Access token]
    TOKEN --> IMP[Token impersonation]

    USER[User or machine context] --> DPAPI[DPAPI master-key chain]
    DPAPI --> SECRET[Protected application secret]

    style PTH fill:#5b2333,color:#fff
    style RELAY fill:#5b2333,color:#fff
    style PTT fill:#5b2333,color:#fff
    style IMP fill:#5b2333,color:#fff

Artifact taxonomy

Material What it is Typical constraint Common confusion
Password User-entered secret Can often be used across protocols Not sent over the wire by NTLM challenge-response
NT hash Password-derived verifier Useful only where an authentication stack accepts equivalent proof Not a captured NetNTLM response
NetNTLMv2 response Response bound to an NTLM exchange Bound to challenge and exchange context; may be relayed live or attacked offline Often mislabeled “NTLMv2 hash”
Kerberos TGT Ticket used to request service tickets Realm, lifetime, flags, client context, and KDC policy matter Not a password hash
Kerberos service ticket Ticket for a named service principal Normally service-specific Not interchangeable with every service
Windows access token Local kernel object representing a security context Host, session, privileges, integrity level, and token type matter Not a Kerberos ticket
DPAPI-protected blob Application data protected through DPAPI User/machine context, master key, optional entropy, and domain recovery design matter Not decrypted merely by possessing any NT hash
SAM/SYSTEM or system-state backup Security-sensitive backup material Requires privileged backup/read access and offline protection wbadmin is a backup utility, not a credential tool

2. NTLM authentication

NTLM is a Windows challenge-response authentication package. In a domain workflow, the client proves access to password-derived credential material without sending the plaintext password. The server and domain controller validate the exchange. Applications normally use Negotiate, which selects Kerberos when possible and falls back to NTLM when Kerberos cannot be used.

Common reasons for NTLM fallback include connecting by IP address, missing or incorrect service principal names, workgroup/local-account use, legacy applications, and incompatible name or trust conditions. Do not assume every Negotiate logon used Kerberos; record the negotiated package.

NT hash versus NetNTLM

Use precise language:

Offline guessing of a captured response attempts to recover the password. PtH uses an NT hash directly. Relay forwards a live exchange. Those are three different operations.

3. Pass-the-hash

PtH is alternate-authentication-material abuse: an actor authenticates to an NTLM-capable service using an NT hash instead of the plaintext password. It succeeds only where the protocol, client implementation, account type, target policy, and authorization allow it.

Key boundaries:

RDP PtH and Restricted Admin

RDP normally uses CredSSP/NLA and credential delegation. Restricted Admin mode changes the trust model: reusable credentials are not sent to or stored on the remote host, the connecting identity must be an administrator on the target, and outbound access from the session generally uses the remote host's identity rather than the user's identity.

This defensive feature historically also enabled RDP authentication with equivalent NTLM material. Therefore:

Microsoft's client exposes mstsc /restrictedadmin. FreeRDP exposes /pth:<password-hash> and /restricted-admin options, but success is version-, build-, platform-, NLA/CredSSP-, and server-policy-dependent. Document the exact FreeRDP version and test only with a synthetic lab account; do not publish a hash-bearing command transcript.

4. NTLM relay

Relay is a live authentication-forwarding problem, not hash reuse.

sequenceDiagram
    participant C as Client
    participant R as Unintended endpoint / relay
    participant S as Target service
    participant D as Domain controller

    C->>R: Attempts NTLM authentication
    R->>S: Forwards negotiate message
    S-->>R: Target challenge
    R-->>C: Forwards target challenge
    C->>R: Challenge response
    R->>S: Forwards response
    S->>D: Validate identity and response
    D-->>S: Authentication result
    alt Signing, channel binding, service binding, or policy blocks relay
        S-->>R: Reject
    else Relayed identity is accepted and authorized
        S-->>R: Authenticated session with that identity's rights
    end

Required conditions

A useful relay threat model asks whether all of these are true:

  1. A client can be induced or misdirected into authenticating to an unintended endpoint.
  2. The client negotiates NTLM rather than Kerberos.
  3. A target service accepts the forwarded exchange.
  4. Signing, channel binding, service binding, MIC requirements, and Extended Protection do not reject it.
  5. The relayed identity has meaningful authorization on the target.
  6. Network paths and protocol details are compatible.

“NTLM is enabled” is therefore not enough to prove relayability.

Responder's role

Responder is a rogue name-resolution and authentication-service framework commonly used in labs to demonstrate LLMNR, NBT-NS, mDNS, DNS, WPAD, and authentication exposure. It may observe challenge-response material, but it does not dump the NT hash from the endpoint.

Defensive validation should focus on whether:

Prefer fixing name resolution, disabling unnecessary LLMNR/NBT-NS, constraining WPAD, reducing NTLM, and enforcing service protections rather than merely detecting a particular tool name.

MSSQL through ntlmrelayx

Current Impacket releases include MSSQL relay support in ntlmrelayx; this is a Windows Authentication path over SQL Server's TDS stack, not replay of a SQL login password. A successful authentication still has only the database permissions of the relayed Windows identity.

Do not equate authentication with operating-system command execution. Database roles, server permissions, disabled features, service-account context, and endpoint controls determine impact.

SQL Server's primary relay defense is Extended Protection, using service binding and TLS channel binding. Effective enforcement requires compatible client drivers, TLS, a correct SPN, Windows Authentication, and SQL Server Extended Protection configured—preferably Required after compatibility testing. As of this review, SQL Server does not enable Extended Protection by default.

5. Kerberos and pass-the-ticket

Kerberos uses a Key Distribution Center (KDC):

sequenceDiagram
    participant U as User or computer
    participant AS as KDC Authentication Service
    participant TGS as KDC Ticket-Granting Service
    participant S as Application service

    U->>AS: AS-REQ with identity and pre-authentication
    AS-->>U: AS-REP with TGT and session key
    U->>TGS: TGS-REQ with TGT and target SPN
    TGS-->>U: TGS-REP with service ticket
    U->>S: AP-REQ with service ticket
    S-->>U: Service access; mutual authentication when used

Pass-the-ticket means presenting an existing TGT or service ticket without knowing the account password. A TGT can request service tickets while valid and permitted; a service ticket is normally limited to its service principal. Ticket flags, PAC contents, encryption type, lifetime, realm, logon session, and service name all matter.

klist, .kirbi, and ccache

klist2ccache is not standard Windows terminology and is not a canonical current Impacket command. If a course or script uses that name, record its repository and version. Conversion changes representation; it does not grant new authorization or extend the ticket lifetime.

Detection should correlate ticket events with the source host, logon session, account, SPN, service destination, encryption type, timing, lifetime, and expected administrative path. Avoid single-event “PtT signatures.”

6. DPAPI

The Data Protection API lets applications protect data under a user or machine context. Applications may add optional entropy, and domains maintain highly sensitive DPAPI backup keys so domain users can recover protected data after certain password-reset scenarios.

Important distinctions:

Protect profile directories, LSASS, domain controllers, backup repositories, and the identities allowed to perform recovery. Treat a DPAPI domain backup-key compromise as a domain-compromise incident requiring expert response; assess forest impact separately when trusts or shared administration expand the blast radius.

7. wbadmin, SAM/SYSTEM, and backup exposure

wbadmin is a legitimate Windows backup utility. The security issue is not the binary's presence; it is whether a principal can create, read, mount, export, or restore security-sensitive backups.

System-state or critical-volume backups can contain registry data and, on domain controllers, Active Directory data. The SAM hive contains local-account credential data whose protection depends partly on material associated with the SYSTEM hive. Backups can therefore bypass controls that protect live files.

For a clean defensive validation:

  1. Review Backup Operators, backup-service identities, scheduled tasks, and repository ACLs.
  2. Confirm backups are encrypted, access-logged, isolated from ordinary administrators, and protected against deletion.
  3. Test restore authorization with synthetic data; do not extract real credential material.
  4. Alert on unexpected wbadmin/VSS activity, new backup destinations, hive access, volume mounting, and access from non-backup hosts.
  5. Treat copied SAM/SYSTEM, NTDS, DPAPI backup keys, and unprotected system-state media as credential-bearing incident artifacts.

“Clean” or “discreet” collection is not a legitimate design objective. The useful objective is controlled, attributable validation with minimal data handling.

8. Windows access tokens and T1134.001

After logon, Windows uses access tokens to represent a process or thread's security context. Tokens carry identity, groups, privileges, integrity information, restrictions, and other authorization data.

MITRE ATT&CK T1134.001, Token Impersonation/Theft, covers duplicating or impersonating an existing token. It is distinct from:

Detection is behavioral: correlate unusual privilege changes, cross-user process access, sensitive-handle access, and token APIs such as DuplicateTokenEx, ImpersonateLoggedOnUser, and SetThreadToken with process ancestry, integrity level, and logon-session context.

9. Living off the land and interactive access

“Living off the land” (LOTL) describes using built-in or trusted utilities. It is not itself an authentication method and does not make activity invisible. Native tools often produce strong process, script, service, authentication, and network telemetry.

Surface Normal administrative use Credential behavior High-value telemetry
WinRM / PowerShell remoting Command and object-based administration Negotiate/Kerberos or NTLM; delegation and endpoint configuration matter WinRM Operational, PowerShell logs, process creation, network authentication
SMB / service control / WMI over RPC File administration and remote management Kerberos or NTLM; signing and admin rights matter SMB audit, service creation, WMI Activity, RPC, process creation
RDP Full interactive desktop CredSSP/NLA; standard, Restricted Admin, and Remote Credential Guard differ TerminalServices logs, logon events, session lifecycle, source host
RDP shadowing Helpdesk/support control of an existing session Uses an already authorized administrator/session-control path Shadow request, consent policy, session ID, administrator, source host
SQL Server Database administration Windows Authentication or separate SQL Authentication SQL audit, login result, client host/app, role and query activity

mstsc /shadow

RDP shadowing views or controls an existing session; it is not a separate logon technique or a software vulnerability. Microsoft documents /shadow:<sessionID>, /control, and /noConsentPrompt, but successful use depends on session-control permissions and policy. No-consent shadowing is a high-risk administrative configuration.

Defensive rules:

“RDP over WinRM/SMB”

RDP, WinRM, and SMB are separate service surfaces. One may be used to configure or reach another, but authentication and authorization do not magically transfer between them. Document the chain explicitly:

flowchart LR
    O[Operator workstation] -->|WinRM management| J[Managed host]
    O -->|SMB or RPC administration| J
    O -->|RDP interactive session| J
    J -->|Approved gateway or proxy path| T[Internal target]

    P1[Identity authorized?] -. check .-> J
    P2[Protocol protected?] -. check .-> J
    P3[Route approved and logged?] -. check .-> T

Do not collapse this into “RDP over SMB.” Record each transport, listener, authentication package, delegated credential behavior, firewall change, and audit source.

10. DLL side-loading and hijacking

These are related execution-flow abuses, not authentication techniques:

The security boundary is writable location plus privileged or trusted loading behavior. A signed executable does not make every DLL it loads trustworthy.

Defenses include fully qualified library paths, safe loading APIs, Safe DLL Search Mode, removing write access from program directories, application control that covers DLLs, and monitoring unexpected image loads from user-writable or nonstandard paths. Map this family to MITRE ATT&CK T1574.001.

11. Proxying and pivoting

A proxy or tunnel forwards traffic through an intermediary. It is not NTLM relay. Proxying changes network reachability and attribution; the inner protocol still performs its own authentication and authorization.

Document:

For authorized labs, bind listeners to loopback where possible, allow-list destinations, set an expiry, and preserve connection logs. Avoid broad subnet routing when a single host/port proves the control gap.

12. Control and detection map

flowchart TD
    A[Unexpected authentication or remote access] --> B{What material or path?}
    B -->|NT hash| C[PtH hypothesis]
    B -->|Live NTLM exchange| D[Relay hypothesis]
    B -->|Kerberos ticket| E[PtT hypothesis]
    B -->|Local access token| F[Token impersonation hypothesis]
    B -->|Remote route| G[Proxy or service-use hypothesis]
    B -->|Unexpected DLL load| H[Execution-flow hijack hypothesis]

    C --> I[Check account reuse, LAPS, NTLM policy, source host]
    D --> J[Check signing, CBT, EPA, name resolution, target authorization]
    E --> K[Check TGT/TGS timing, SPN, realm, lifetime, logon session]
    F --> L[Check token APIs, privileges, process and handle lineage]
    G --> M[Check route, listener, management allow-list, DNS and flow logs]
    H --> N[Check path writability, signature context, loader telemetry]

    I --> Z[Correlate endpoint, DC, network, RDP, WinRM, SMB, and SQL evidence]
    J --> Z
    K --> Z
    L --> Z
    M --> Z
    N --> Z

Priority hardening

  1. Inventory NTLM use and fix Kerberos/SPN/name-resolution failures before restricting it.
  2. Require SMB signing; assess current Windows defaults and legacy exceptions explicitly.
  3. Enforce LDAP signing and channel binding.
  4. Enable SQL Server TLS and Extended Protection after client compatibility testing.
  5. Deploy Windows LAPS and eliminate shared local-administrator passwords.
  6. Use privileged-access workstations and constrain where administrative identities may log on.
  7. Use Credential Guard, Restricted Admin, or Remote Credential Guard according to the administrative scenario.
  8. Protect backup operators, system-state media, DPAPI backup keys, and backup repositories as credential-bearing assets.
  9. Restrict RDP shadowing and require consent by default.
  10. Apply DLL-safe-loading guidance and DLL-aware application control.
  11. Allow only documented management and proxy paths; expire temporary routes.

13. Safe validation worksheet

Question Evidence Pass condition
Why did the client use NTLM instead of Kerberos? Client, DC, SPN, DNS, and target logs Expected Kerberos paths use Kerberos; exceptions are documented
Can an untrusted host influence name resolution? Packet capture and resolver telemetry using synthetic names No unauthorized responder wins; alerts identify attempts
Does SMB reject unsigned sessions? Client/server policy and controlled negative test Required signing is enforced on intended directions
Does LDAP enforce signing and channel binding? DC policy and Directory Service events Unsigned/unbound cases are rejected after compatibility validation
Does SQL Server enforce Extended Protection? SQL configuration, TLS/SPN checks, synthetic negative test Incompatible or unbound authentication is rejected
Are local administrator credentials unique? Windows LAPS policy and sampled rotation evidence No shared static local-admin secret
Are RDP credential modes governed? GPO/MDM, RDP logs, support procedure Approved mode is enforced and sourced from admin workstations
Can sessions be shadowed without consent? RDS policy and synthetic support session No, unless a narrow documented exception exists
Who can read or restore system-state backups? Group membership, ACLs, backup logs Separate, least-privileged, monitored identities only
Can a writable directory influence privileged DLL loading? ACL and image-load review No user-writable precedence for privileged loaders

Sources

Microsoft

Framework and tool owners

Review record