Establish domain identity, DC, DNS, time and route
Contents ↑Use when: Domain credentials or a domain-joined foothold
Needs: Correct realm/domain and account qualification; reachable DC/services, usable DNS and acceptable clock skew
Domain-joined Windows source
REM Domain-joined Windows source
whoami /all
echo %USERDNSDOMAIN%
echo %USERDOMAIN%
echo %LOGONSERVER%
nltest /dsgetdc:DOMAIN
nltest /dclist:DOMAIN
w32tm /query /status
Domain-joined Windows source
# Domain-joined Windows source
[System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain()
Resolve-DnsName -Type SRV _ldap._tcp.dc._msdcs.DOMAIN
Resolve-DnsName -Type SRV _kerberos._tcp.DOMAIN
Decisive output: domain FQDN, DC FQDN/IP, current user SID/groups, DNS SRV answers and a plausible time source.
USERDOMAINcan be a NetBIOS label; prefer the DNS domain for LDAP/Kerberos.
Kali/off-domain source
# Kali/off-domain source
dig +short SRV _ldap._tcp.dc._msdcs.DOMAIN @DC_IP
dig +short SRV _kerberos._tcp.DOMAIN @DC_IP
nxc smb DC_IP -d DOMAIN -u USER -p 'PASSWORD'
ldapsearch -x -LLL -H ldap://DC_HOST:389 -s base -b '' \
defaultNamingContext configurationNamingContext rootDomainNamingContext dnsHostName
Remote Windows session and double-hop caveat
REM Remote Windows session and double-hop caveat
whoami /all
klist
dir \\DC_HOST\SYSVOL
Remote Windows session and double-hop caveat
A supplied credential may create the remote session without being delegated onward to the DC. If local identity commands work but access to a second host fails, distinguish a WinRM/PowerShell remoting credential-delegation problem from invalid credentials. An interactive RDP session, explicit credentials,
/netonlynetwork credentials or an off-domain LDAP client may create a different context; always record which identity is used locally and over the network.
# Remote Windows session and double-hop caveat
IDENTITY MAP: USER/COMPUTER -> DIRECT + NESTED GROUPS -> DIRECTORY RIGHTS
HOST MAP: COMPUTER -> OS/ROLE -> LOCAL/REMOTE-ACCESS RIGHTS -> SESSIONS
ROUTE MAP: SOURCE -> DNS/KDC/DC/HOST -> REQUIRED PORT/SERVICE
LEAD MAP: EVIDENCE -> HYPOTHESIS -> MINIMUM VALIDATION -> NEXT BLOCK
# Remote Windows session and double-hop caveat
AS-REQ/AS-REP: user proves knowledge of long-term key -> receives TGT
TGS-REQ/TGS-REP: TGT requests SERVICE/HOST -> receives service ticket
AP-REQ: client presents service ticket -> service authenticates client
AUTHORIZATION: target service still evaluates the represented identity/claims
Before changing credentials or tools
# Before changing credentials or tools
getent hosts DC_HOST
nc -nvz DC_IP 88
date -u
Remote Windows session and double-hop caveat
REM Remote Windows session and double-hop caveat
w32tm /query /status
klist
Read / verify → Record represented identity, realm, selected DC, resolver, clock and real source route.
If it fails → Wrong domain, KDC timeout, clock skew and account denial are distinct failures. Do not repeatedly change passwords to fix a route problem.
- A directory bind or domain-joined identity can read relevant objects → Enumerate directory objects with native, LDAP and PowerView approaches
- An IP connection works while hostname/Kerberos access fails → Preserve DNS, Kerberos names and time across a pivot
- A credential appears valid but the destination's usable access is unknown → Match route, destination service and effective authorization