WINDOWS SECURITY INTERNALS: SAM, LSASS, KERBEROS & ACTIVE DIRECTORY

Architect enterprise-scale Windows infrastructure defenses for B.Tech Computer Science & IT: Operating system subsystem architecture (Winlogon, LSA, SRM), Security Account Manager (SAM) database structures, Local Security Authority Subsystem Service (LSASS) memory mechanics, Pass-the-Hash (PtH) and credential dumping, Kerberos v5 ticket flows (AS-REQ/REP, TGS-REQ/REP, Golden/Silver Tickets), legacy NTLM relay vulnerabilities, and threat-focused Active Directory event log auditing.

πŸͺŸ Windows Identity Infrastructure, Authentication Subsystems & Domain Dominance

Across enterprise corporate networks, over 90% of Fortune 500 organizations rely on Microsoft Active Directory Domain Services (AD DS) as their primary identity and access governance backbone. Understanding Windows security requires analyzing both local host internals and distributed enterprise domain architectures. At the standalone machine level, Windows isolates credentials within the Security Account Manager (SAM) registry hive and caches active logon sessions in the address space of the Local Security Authority Subsystem Service (LSASS). When joined to a domain, identity verification shifts to Kerberos v5, a ticket-granting cryptographic protocol centered on the Domain Controller's Key Distribution Center (KDC). Because adversaries frequently target these mechanisms via credential dumping, NTLM Relay, Kerberoasting, and forged Golden Tickets, security engineers must dissect Windows authentication handshakes, enforce Credential Guard, and deploy rigorous security event auditing.

1. Windows Security Subsystem Architecture Topography
The architectural interaction between user-mode authentication brokers, the Local Security Authority (LSA), the Security Reference Monitor (SRM) inside the executive kernel, and storage databases (SAM and ntds.dit).
Windows Authentication Subsystem & Kernel SRM Pipeline
WINDOWS SECURITY SUBSYSTEM INTERACTION TOPOGRAPHY:

[USER INTERFACE & LOGON BROKERS]
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ LogonUI.exe / Winlogon.exe (Secure Attention Sequence: SAS) β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                               β”‚
                               β–Ό (Credentials / Smart Card PIN)
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ USER MODE: LOCAL SECURITY AUTHORITY SUB-SYSTEM SERVICE (lsass.exe)                            β”‚
β”‚                                                                                               β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”               β”‚
β”‚  β”‚ LSA Server (lsasrv.dll)      │◄────────────►│ Security Support Providers   β”‚               β”‚
β”‚  β”‚ Security policy enforcement, β”‚              β”‚ (SSPs): msv1_0.dll (NTLM),   β”‚               β”‚
β”‚  β”‚ audits, token generation     β”‚              β”‚ kerberos.dll, cloudap.dll    β”‚               β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜               β”‚
β”‚                 β”‚                                             β”‚                               β”‚
β”‚                 β–Ό                                             β–Ό                               β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”               β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                β”‚
β”‚  β”‚ SAM / Local Store           β”‚               β”‚ Active Directory (Domain)   β”‚                β”‚
β”‚  β”‚ Local accounts (C:\Windows\ β”‚               β”‚ Kerberos KDC Ticket Queries β”‚                β”‚
β”‚  β”‚ System32\config\SAM)        β”‚               β”‚ via LDAP / RPC (ntds.dit)   β”‚                β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜               β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                  β”‚
                                  β–Ό (Generates Windows Access Token: SIDs, Privileges)
══════════════════════════════════β•ͺ═════════════════════════════════════════════════════════════
KERNEL MODE: NTOSKRNL.EXE         β”‚
                                  β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ SECURITY REFERENCE MONITOR - SRM (ntoskrnl.exe)                                               β”‚
β”‚ β€’ Enforces authorization decisions on EVERY handle creation and system call invocation.       β”‚
β”‚ β€’ Compares Subject's Access Token (User SID, Group SIDs, Privileges) against the target       β”‚
β”‚   Object's Security Descriptor (Owner SID, Discretionary ACL - DACL, System ACL - SACL).      β”‚
β”‚ β€’ Grants or denies ACCESS_MASK (FILE_READ_DATA, GENERIC_ALL); writes Security Event Logs.     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
Architectural Standard: The Security Reference Monitor (SRM) executes exclusively in kernel mode. User applications never interface with the SRM directly; instead, user-mode lsass.exe mints an unalterable kernel Access Token at login, which the SRM inspects on every subsequent resource request.
Real-Time Example 1: Local Credential Stores: SAM Database vs. LSASS Process Memory
Analysis of local Windows credential caching. Explains how password hashes are derived (LM, NTLM: MD4(UTF-16LE(password))), protected at rest via the SYSKEY encryption key in the SAM registry hive, and cached in cleartext or hashed formats inside active lsass.exe process memory.
Python (NTLM Hash Generation & SAM/LSASS Credential Architecture)
import hashlib

class WindowsCredentialEngine:
    """
    Simulates the cryptographic algorithm used by Windows for NTLM hashing:
    NTLM Hash = MD4( UTF-16LE( Plaintext_Password ) )
    Notice: No salt is added! Identical passwords produce IDENTICAL hashes globally.
    """
    @staticmethod
    def compute_ntlm_hash(password: str) -> str:
        # Encode string to little-endian UTF-16 bytes
        utf16_bytes = password.encode('utf-16le')
        # Compute legacy MD4 digest
        md4_engine = hashlib.new('md4')
        md4_engine.update(utf16_bytes)
        return md4_engine.hexdigest().upper()

if __name__ == "__main__":
    pwd = "EnterprisePassword#2026"
    ntlm_hash = WindowsCredentialEngine.compute_ntlm_hash(pwd)

    print("==========================================================================")
    print("      WINDOWS LOCAL CREDENTIAL STORE ARCHITECTURE & HASH DERIVATION")
    print("==========================================================================")
    print(f"[*] Password Input       : {pwd}")
    print(f"[*] UTF-16LE Byte Stream : {pwd.encode('utf-16le').hex()[:32]}...")
    print(f"[+] Derived NTLM Hash    : {ntlm_hash}")

    print("\n--- CREDENTIAL STORAGE SUBSYSTEM COMPARISON ---")
    print("1. SAM REGISTRY HIVE (C:\\Windows\\System32\\config\\SAM):")
    print("   β€’ Stores local user accounts and NTLM hashes at rest.")
    print("   β€’ Encrypted on disk using RC4/AES with the master SYSKEY (stored in SYSTEM hive).")
    print("   β€’ Locked by the kernel exclusively while Windows is running.")
    print("\n2. LSASS PROCESS MEMORY (lsass.exe):")
    print("   β€’ Holds active decrypted Kerberos session keys, NTLM hashes, and Plaintext WDigest tokens.")
    print("   β€’ Adversary target: Tools like Mimikatz inject into lsass.exe memory using")
    print("     OpenProcess(PROCESS_VM_READ) to extract credentials directly from RAM.")
Windows Credential Engine Output: ========================================================================== WINDOWS LOCAL CREDENTIAL STORE ARCHITECTURE & HASH DERIVATION ========================================================================== [*] Password Input : EnterprisePassword#2026 [*] UTF-16LE Byte Stream : 45006e00740065007200700072006900... [+] Derived NTLM Hash : 3B4E3E533604C5A9F0D8C5708C5AE48B Security Implication: Because NTLM hashes are unsalted, precomputed rainbow tables can reverse common password hashes instantly. Furthermore, Windows network protocols accept the raw NTLM hash itself as a proof-of-identity token, enabling Pass-the-Hash (PtH) attacks without knowing the plaintext password.
Real-Time Example 2: Kerberos v5 Authentication Handshake Mechanics
Analysis of the Kerberos v5 authentication protocol (RFC 4120) across an Active Directory Domain. Details the sequential exchange between the Client, the Key Distribution Center (Authentication Service and Ticket Granting Service), and the Target Resource.
Kerberos v5 Ticket Exchange Protocol Lifecycle
THE 6-STEP ACTIVE DIRECTORY KERBEROS v5 AUTHENTICATION LIFECYCLE:

[CLIENT WORKSTATION]             [DOMAIN CONTROLLER (KDC)]          [TARGET SERVICE: e.g., MSSQL]
       β”‚                                     β”‚                                    β”‚
       β”œβ”€ 1. AS-REQ (Authentication Request)β–Ίβ”‚                                    β”‚
       β”‚     Client requests TGT. Encrypts   β”‚                                    β”‚
       β”‚     timestamp with User's Hash.     β”‚                                    β”‚
       β”‚                                     β”‚                                    β”‚
       │◄─ 2. AS-REP (Authentication Reply)───                                    β”‚
       β”‚     KDC validates timestamp. Returnsβ”‚                                    β”‚
       β”‚     TGT (Encrypted with krbtgt key) β”‚                                    β”‚
       β”‚     + Ephemeral TGT Session Key.    β”‚                                    β”‚
       β”‚                                     β”‚                                    β”‚
       β”œβ”€ 3. TGS-REQ (Ticket-Granting Req)──►│                                    β”‚
       β”‚     Client sends TGT + requested    β”‚                                    β”‚
       β”‚     Service Principal Name (SPN).   β”‚                                    β”‚
       β”‚                                     β”‚                                    β”‚
       │◄─ 4. TGS-REP (Ticket-Granting Reply)─                                    β”‚
       β”‚     KDC verifies TGT. Returns       β”‚                                    β”‚
       β”‚     Service Ticket (TGS) encrypted  β”‚                                    β”‚
       β”‚     with the Target Service's Hash. β”‚                                    β”‚
       β”‚                                     β”‚                                    β”‚
       β”œβ”€ 5. AP-REQ (Application Request)────────────────────────────────────────►│
       β”‚     Client presents TGS + Authenticator.                                 β”‚
       β”‚     Target decrypts TGS using its own service password hash.             β”‚
       β”‚                                                                          β”‚
       │◄─ 6. AP-REP (Mutual Auth Reply - Optional)────────────────────────────────
       β”‚     Service proves identity back to client. Session established!         β”‚
       β–Ό                                                                          β–Ό

CRYPTOGRAPHIC COMPONENTS OF A KERBEROS TICKET:
β€’ TGT (Ticket Granting Ticket): Contains Client SID, Domain SIDs, Privileges (PAC), and Session Key.
  Encrypted exclusively with the Domain Controller's Master 'krbtgt' account password hash!
β€’ PAC (Privilege Attribute Certificate): Embedded Windows authorization data listing all group
  memberships (Domain Admins, Enterprise Admins). Signed by KDC to prevent privilege escalation.
Architectural Standard: The KDC never transmits user passwords across the wire. Instead, passwords are used as pre-shared symmetric encryption keys (via Kerberos pre-authentication) to decrypt session envelopes, ensuring that sensitive credentials never leave the endpoint.
Real-Time Example 3: Kerberos Exploitation: Kerberoasting, AS-REP Roasting & Golden Tickets
Examining active Directory privilege escalation vectors targeting the Kerberos protocol: offline service account password cracking via Kerberoasting, bypassing pre-authentication via AS-REP Roasting, and minting unrestricted Golden/Silver Tickets.
Active Directory Kerberos Attack Vectors & Mathematical Exploitation
KERBEROS ATTACK VECTORS & ARCHITECTURAL IMPACT:

1. KERBEROASTING (MITRE ATT&CK T1558.003):
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ β€’ Mechanism: ANY valid domain user (even low-privilege guest) can request a TGS service       β”‚
β”‚   ticket for ANY registered Service Principal Name (SPN) across the domain (e.g. MSSQLSvc).   β”‚
β”‚ β€’ Flaw: The returned TGS ticket is encrypted with the service account's NTLM password hash.   β”‚
β”‚ β€’ Exploit: Attacker extracts ticket from memory and cracks it offline using Hashcat/John:     β”‚
β”‚   hashcat -m 13100 kerberoast_hashes.txt wordlist.txt -r rules/rockyou-30000.rule             β”‚
β”‚ β€’ Impact: If the service account uses a weak password, attacker gains full service account    β”‚
β”‚   credentials without sending a single suspicious packet to the target database server!       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

2. AS-REP ROASTING (MITRE ATT&CK T1558.004):
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ β€’ Mechanism: Accounts configured with "Do not require Kerberos preauthentication"             β”‚
β”‚   (DONT_REQ_PREAUTH) do not need to encrypt timestamps to request an AS-REP.                  β”‚
β”‚ β€’ Exploit: Attacker sends an unauthenticated AS-REQ for that username. The DC replies with    β”‚
β”‚   an AS-REP containing encrypted session material using the user's password hash!             β”‚
β”‚ β€’ Impact: Allows offline password cracking without needing an initial compromised domain user.β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

3. GOLDEN TICKET FORGERY (COMPLETE DOMAIN COMPROMISE - T1558.001):
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ β€’ Prerequisite: Attacker extracts the password hash of the domain's 'krbtgt' account (e.g. viaβ”‚
β”‚   DCSync attack against Active Directory database ntds.dit).                                  β”‚
β”‚ β€’ Execution: With the krbtgt hash, the attacker crafts a completely forged, valid TGT ticket! β”‚
β”‚ β€’ Forgery Attributes:                                                                         β”‚
β”‚   β”œβ”€β”€ Target Username : Administrator (or any arbitrary username)                             β”‚
β”‚   β”œβ”€β”€ User RID        : 500 (Built-in Administrator)                                          β”‚
β”‚   β”œβ”€β”€ Group Membership: RID 512 (Domain Admins), 519 (Enterprise Admins)                      β”‚
β”‚   └── Lifetime        : 10 Years (Default is 10 hours)                                        β”‚
β”‚ β€’ Result: Attacker maintains persistence. The DC trusts the forged ticket implicitly because  β”‚
β”‚   it validates mathematically against the valid krbtgt hash! Changing the admin password does β”‚
β”‚   NOT invalidate the Golden Ticket; the krbtgt password must be reset TWICE to remediate!     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
Defensive Countermeasures: 1. Kerberoasting: Use Group Managed Service Accounts (gMSA), which enforce 120-character, cryptographically randomized passwords rotated automatically by Active Directory every 30 days. 2. AS-REP Roasting: Audit Active Directory for accounts with userAccountControl flag DONT_REQ_PREAUTH (0x400000) and enforce pre-authentication. 3. Golden Tickets: Protect Domain Controllers against DCSync and execute automated krbtgt password rotation cycles twice annually.
Real-Time Example 4: Legacy Protocol Vulnerabilities: LLMNR/NBT-NS Poisoning & NTLM Relay
Analysis of legacy name resolution protocol abuse. Explains how tools like Responder exploit broadcast name resolution (Link-Local Multicast Name Resolution - LLMNR and NetBIOS Name Service - NBT-NS) to capture NetNTLMv2 challenge-response hashes and relay them to target services.
LLMNR Broadcast Poisoning & NTLM Relay Attack Chain
THE LLMNR POISONING & NTLM RELAY EXPLOITATION PIPELINE:

[VICTIM USER ON WORKSTATION]
  β”‚
  β”œβ”€ 1. User mistypes share path in File Explorer: "\\acounting-files\share"
  β”‚
  β”œβ”€ 2. DNS query fails (Name does not exist in DNS).
  β”‚
  β”œβ”€ 3. Windows falls back to broadcast name resolution:
  β”‚     Broadcasts LLMNR (UDP 5355) / NBT-NS (UDP 137) to entire local subnet:
  β”‚     "Who has name: acounting-files? Tell 192.168.1.50"
  β”‚
  β–Ό
[ATTACKER RUNNING RESPONDER ON SAME SUBNET (192.168.1.100)]
  β”‚
  β”œβ”€ 4. Attacker immediately sends spoofed LLMNR response:
  β”‚     "I am acounting-files! Connect to 192.168.1.100"
  β”‚
  β–Ό
[VICTIM WORKSTATION ESTABLISHES SMB SESSION TO ATTACKER]
  β”‚
  β”œβ”€ 5. Attacker presents NTLMSSP Challenge (Random 8-byte server nonce).
  β”‚
  β”œβ”€ 6. Victim responds with NetNTLMv2 Hash:
  β”‚     HMAC-MD5( NTLM_Hash, Username || Domain || ServerChallenge || ClientNonce )
  β”‚
  β–Ό
[ATTACKER EXECUTES NTLM RELAY INSTEAD OF CRACKING]
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ NTLM RELAY ATTACK (ntlmrelayx):                                                               β”‚
β”‚ Rather than cracking the NetNTLMv2 hash offline, the attacker RELAYS the authentication       β”‚
β”‚ packets in real-time to a third server where SMB Signing is disabled (e.g. 192.168.1.200)!    β”‚
β”‚ 1. Attacker connects to Server B ──► Requests challenge.                                      β”‚
β”‚ 2. Attacker forwards Server B challenge to Victim.                                            β”‚
β”‚ 3. Victim solves challenge ──► Attacker forwards response back to Server B!                   β”‚
β”‚ 4. Server B validates authentication! Attacker executes code as the Victim user on Server B!  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
Remediation Architecture: 1. Disable LLMNR: Set Group Policy Object (GPO) 'Turn off multicast name resolution' to Enabled. 2. Disable NBT-NS: Push DHCP Option 043 or disable NetBIOS over TCP/IP on network adapters. 3. Defeat NTLM Relay: Enforce SMB Signing (RequireSecuritySignature = True) and LDAP Channel Binding / Signing across all domain servers.
Real-Time Example 5: Active Directory Architecture: Domain Controllers, Forests, FSMO & ntds.dit
Analysis of Active Directory logical and physical architecture. Details Forests, Trees, Domains, Organizational Units (OUs), the five Flexible Single Master Operation (FSMO) roles, Global Catalogs, and the internal Extensible Storage Engine (ESE) database ntds.dit.
Active Directory Enterprise Domain Hierarchy & FSMO Roles
ACTIVE DIRECTORY ENTERPRISE LOGICAL & PHYSICAL STRUCTURE:

1. THE FOREST HIERARCHY (THE ULTIMATE SECURITY BOUNDARY):
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ ACTIVE DIRECTORY FOREST (nikita-infotech.com)                                                 β”‚
β”‚ β€’ Shares a single common Schema (Class and Attribute definitions).                            β”‚
β”‚ β€’ Shares a single Global Catalog (GC - Port 3268) indexing all objects across all trees.      β”‚
β”‚ β€’ Security Invariant: The Domain is an administrative boundary; the FOREST is the ultimate    β”‚
β”‚   security boundary! Compromising one domain in a forest can compromise the entire forest!    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                                β”‚
                     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                     β–Ό                                                     β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ PARENT DOMAIN: nikita-infotech.com           │◄──────►│ CHILD DOMAIN: dev.nikita-infotech.com  β”‚
β”‚ Domain Controller: DC01 (FSMO Master)        β”‚ Two-Wayβ”‚ Domain Controller: DC02                β”‚
β”‚ Hosts ntds.dit Active Directory Database     β”‚ Trust  β”‚ Hosts dev OU, groups, and workstations β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

2. THE FIVE FSMO (FLEXIBLE SINGLE MASTER OPERATION) ROLES:
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ FSMO ROLE NAME          β”‚ SCOPE            β”‚ OPERATIONAL RESPONSIBILITY                       β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Schema Master           β”‚ Forest-Wide (1)  β”‚ Controls modifications to AD schema definitions. β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Domain Naming Master    β”‚ Forest-Wide (1)  β”‚ Authorizes adding or removing domains in forest. β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ PDC Emulator            β”‚ Domain-Wide (1)  β”‚ Authoritative time server (NTP), password changesβ”‚
β”‚                         β”‚                  β”‚ immediate sync, account lockouts, GPO management.β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ RID Master              β”‚ Domain-Wide (1)  β”‚ Allocates blocks of Relative IDs (RIDs) to DCs.  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Infrastructure Master   β”‚ Domain-Wide (1)  β”‚ Handles cross-domain object reference updates.   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

3. THE CORE DATABASE: C:\Windows\NTDS\ntds.dit
β€’ An Extensible Storage Engine (ESE / JET Blue) database containing every user account,
  group membership, computer object, and cryptographic hash in the entire domain.
β€’ Protected by the Windows OS; readable only by SYSTEM. Targeted via Volume Shadow Copy (VSS) attacks.
Enterprise Domain Rule: The PDC (Primary Domain Controller) Emulator must synchronize with a reliable external stratum-1 NTP source. Because Kerberos v5 tickets reject clock skews greater than 5 minutes (to prevent replay attacks), time synchronization across domain members is a mandatory security dependency.
Real-Time Example 6: PowerShell Security Automation: Auditing Privileged Domain Groups
PowerShell scripting for Active Directory auditing. Demonstrates querying high-privilege groups (Domain Admins, Enterprise Admins, Schema Admins), identifying unconstrained Kerberos delegation, and flagging stale privileged accounts.
PowerShell (Active Directory Privileged Access & Delegation Auditor)
# ==============================================================================
# POWERSHELL ACTIVE DIRECTORY PRIVILEGED ACCOUNT & DELEGATION AUDIT SCRIPT
# Requires: Remote Server Administration Tools (RSAT) / ActiveDirectory Module
# ==============================================================================
Import-Module ActiveDirectory -ErrorAction Stop

Write-Host "==========================================================================" -ForegroundColor Cyan
Write-Host "         ACTIVE DIRECTORY DOMAIN GOVERNANCE & SECURITY AUDIT" -ForegroundColor Cyan
Write-Host "==========================================================================" -ForegroundColor Cyan

# 1. Audit Tier-0 High-Privilege Administrative Groups
$PrivilegedGroups = @(
    "Domain Admins",
    "Enterprise Admins",
    "Schema Admins",
    "Account Operators",
    "Backup Operators"
)

Write-Host "`n[*] AUDITING TIER-0 PRIVILEGED GROUP MEMBERSHIPS:" -ForegroundColor Yellow
foreach ($Group in $PrivilegedGroups) {
    try {
        $Members = Get-ADGroupMember -Identity $Group -Recursive | Select-Object Name, SamAccountName, ObjectClass
        Write-Host "  β”œβ”€β”€ Group: $Group (Total Members: $($Members.Count))" -ForegroundColor Green
        foreach ($User in $Members) {
            Write-Host "  β”‚   β€’ Member: $($User.SamAccountName) [$($User.ObjectClass)]" -ForegroundColor Gray
        }
    } catch {
        Write-Host "  β”œβ”€β”€ Group: $Group [Not Present in Domain]" -ForegroundColor DarkGray
    }
}

# 2. Identify Accounts with Kerberos Pre-Authentication Disabled (AS-REP Roasting Targets)
Write-Host "`n[*] AUDITING FOR ACCOUNTS WITH DONT_REQ_PREAUTH (AS-REP ROASTABLE):" -ForegroundColor Yellow
$AsrepRoastable = Get-ADUser -Filter {DoesNotRequirePreAuth -eq $True} -Properties DoesNotRequirePreAuth, PasswordLastSet
if ($AsrepRoastable.Count -gt 0) {
    foreach ($Target in $AsrepRoastable) {
        Write-Host "  [!] HIGH RISK: Account '$($Target.SamAccountName)' requires NO Kerberos Pre-Auth!" -ForegroundColor Red
        Write-Host "      Last Password Set: $($Target.PasswordLastSet)" -ForegroundColor Gray
    }
} else {
    Write-Host "  [βœ”] Clean: Zero accounts configured with pre-authentication disabled." -ForegroundColor Green
}

# 3. Identify Computer Accounts with Unconstrained Delegation (High Privilege Pivot Risk)
Write-Host "`n[*] AUDITING FOR UNCONSTRAINED KERBEROS DELEGATION:" -ForegroundColor Yellow
$UnconstrainedComputers = Get-ADComputer -Filter {TrustedForDelegation -eq $True} -Properties TrustedForDelegation
foreach ($Comp in $UnconstrainedComputers) {
    # Exclude Domain Controllers which require unconstrained delegation by default
    if ($Comp.SamAccountName -notmatch "DC") {
        Write-Host "  [!] DANGER: Workstation '$($Comp.SamAccountName)' has UNCONSTRAINED DELEGATION enabled!" -ForegroundColor Red
        Write-Host "      If a Domain Admin connects to this machine, its TGT is cached in memory for theft!" -ForegroundColor Gray
    }
}
PowerShell Audit Output: ========================================================================== ACTIVE DIRECTORY DOMAIN GOVERNANCE & SECURITY AUDIT ========================================================================== [*] AUDITING TIER-0 PRIVILEGED GROUP MEMBERSHIPS: β”œβ”€β”€ Group: Domain Admins (Total Members: 2) β”‚ β€’ Member: Administrator [user] β”‚ β€’ Member: secops_aarav [user] β”œβ”€β”€ Group: Enterprise Admins (Total Members: 1) β”‚ β€’ Member: Administrator [user] β”œβ”€β”€ Group: Schema Admins (Total Members: 1) β”‚ β€’ Member: Administrator [user] [*] AUDITING FOR ACCOUNTS WITH DONT_REQ_PREAUTH (AS-REP ROASTABLE): [!] HIGH RISK: Account 'svc_backup_agent' requires NO Kerberos Pre-Auth! Last Password Set: 10/12/2024 14:22:10 [*] AUDITING FOR UNCONSTRAINED KERBEROS DELEGATION: [!] DANGER: Workstation 'DEV-BUILD-SRV$' has UNCONSTRAINED DELEGATION enabled! If a Domain Admin connects to this machine, its TGT is cached in memory for theft!
Real-Time Example 7: Windows Security Event Log Auditing & Threat Detection Matrix
Configuring the Windows Advanced Audit Policy. Details critical Event IDs (EIDs) required by Security Operations Centers (SOCs) to detect pass-the-hash attacks, credential dumping, lateral movement, and privilege abuse.
Windows Security Event Log IDs & Detection Mapping
CRITICAL WINDOWS SECURITY AUDIT EVENT IDS (EID):

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ EVENT IDβ”‚ EVENT DESCRIPTION              β”‚ ATTACK VECTOR    β”‚ ANALYST DETECTION CRITERIA          β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ EID 4624β”‚ Successful Account Logon       β”‚ Lateral Movement,β”‚ LogonType 3 = Network (SMB/RPC)     β”‚
β”‚         β”‚                                β”‚ Pass-the-Hash    β”‚ LogonType 10 = Remote Desktop RDP   β”‚
β”‚         β”‚                                β”‚                  β”‚ Check: Is NTLM used instead of Krb? β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ EID 4625β”‚ Failed Account Logon Attempt   β”‚ Brute-Force,     β”‚ SubStatus 0xC000006A (Bad Password  β”‚
β”‚         β”‚                                β”‚ Credential Spray β”‚ High frequency from single source   β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ EID 4672β”‚ Special Privileges Assigned    β”‚ Privilege Escal- β”‚ Fired when administrative token is  β”‚
β”‚         β”‚ to New Logon (SeDebugPrivilege)ation, Pass-the-Hash created (SeDebugPrivilege granted)  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ EID 4768β”‚ Kerberos TGT Requested         β”‚ Initial Domain   β”‚ Failure 0x18 = Pre-auth failed.     β”‚
β”‚         β”‚ (AS-REQ / AS-REP)              β”‚ Authentication   β”‚ Failure 0x25 = Clock skew error.    β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ EID 4769β”‚ Kerberos Service Ticket (TGS)  β”‚ Kerberoasting    β”‚ Ticket Options: 0x40810000          β”‚
β”‚         β”‚ Requested (TGS-REQ / TGS-REP)  β”‚ (T1558.003)      β”‚ Ticket Encryption: 0x17 (RC4)!      β”‚
β”‚         β”‚                                β”‚                  β”‚ High-volume requests across SPNs    β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ EID 4776β”‚ Domain Controller Attempted    β”‚ NTLM Relay,      β”‚ Fired whenever NTLM validation is   β”‚
β”‚         β”‚ to Validate Credentials (NTLMβ”‚ Pass-the-Hash      β”‚ processed by Domain Controller      β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ EID 7045β”‚ New System Service Installed   β”‚ Lateral Movement β”‚ Process creation via PsExec,        β”‚
β”‚         β”‚                                β”‚ Persistence      β”‚ malicious driver installation       β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ EID 4698β”‚ Scheduled Task Created         β”‚ Persistence      β”‚ Task created via schtasks / wmic    β”‚
β”‚         β”‚                                β”‚ (T1053.005)      β”‚ executing script in C:\Users\...    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
Threat Hunting Signature: Kerberoasting detection correlates Event ID 4769 where Ticket_Encryption_Type equals 0x17 (legacy RC4-HMAC) requested by a standard user account across multiple SPN instances within a brief timeframe, indicating automated service ticket harvesting.
Real-Time Example 8: Debugging Windows Security Defects & Hardening Triage
Troubleshooting common Windows security configuration defects: LSASS memory protection failures, NTLM fallback hazards, Kerberos clock skew synchronization errors, and misconfigured Tier-0 administrative delegation.
Windows Hardening Remediations & Security Triage
WINDOWS HARDENING DEFECTS & ARCHITECTURAL CORRECTIONS:

// ==============================================================================
// PITFALL 1: LSASS MEMORY DUMPING VIA MIMIKATZ
// DEFECT: Adversaries with local admin privileges run procdump or Mimikatz to dump
// the memory of lsass.exe, extracting all cached plaintext passwords and NTLM hashes.
// CORRECTION 1: Enable LSA Protection (RunAsPPL) via Registry:
//   reg add "HKLM\SYSTEM\CurrentControlSet\Control\Lsa" /v RunAsPPL /t REG_DWORD /d 1 /f
//   (Prevents non-protected processes from reading LSASS memory via OpenProcess).
// CORRECTION 2: Enable Windows Defender Credential Guard:
//   Uses Hyper-V Virtualization-Based Security (VBS) to move credential secrets into
//   an isolated virtual machine (LSAIso.exe) completely inaccessible to kernel rootkits!
// ==============================================================================

// ==============================================================================
// PITFALL 2: NTLM FALLBACK VULNERABILITY (SILENT PASS-DOWN)
// DEFECT: Environment allows NTLM when Kerberos fails.
// Adversaries intentionally poison DNS or block port 88 (Kerberos KDC), forcing
// clients to downgrade to vulnerable NTLMv2 which can be relayed to target servers!
// CORRECTION: Enforce Network Security: Restrict NTLM: Incoming NTLM traffic = Deny All,
// and enforce Kerberos explicitly across internal domain boundaries via GPO.
// ==============================================================================

// ==============================================================================
// PITFALL 3: THE "DOMAIN ADMIN LOGS INTO COMPROMISED WORKSTATION" TRAP
// DEFECT: Domain Admins use their master administrative credentials to troubleshoot
// an ordinary employee's infected desktop workstation.
// CONSEQUENCE: The Domain Admin's Kerberos TGT and NTLM hash are cached in that
// workstation's LSASS memory! The attacker steals the credentials and compromises
// the entire Active Directory Forest within minutes!
// CORRECTION: Enforce Enterprise Access Model (Tiered Administration):
//   β€’ Tier 0 (Domain Controllers, Forest Root): Managed ONLY from Dedicated Privileged
//     Access Workstations (PAWs). Tier 0 accounts NEVER log into Tier 1/2 systems!
//   β€’ Tier 1 (Enterprise Servers, Databases): Managed with separate server admin accounts.
//   β€’ Tier 2 (User Workstations, Laptops): Managed with local admin accounts.
// ==============================================================================
Triage Summary: - LSASS Dump Vulnerability: Enabled LSA Protected Process Light (RunAsPPL) and Virtualization-Based Credential Guard. - NTLM Downgrade Attacks: Disabled LLMNR/NBT-NS and restricted NTLM authentication via Domain GPOs. - Credential Harvesting: Implemented 3-Tier Enterprise Administrative Partitioning (PAWs), preventing Tier-0 credential exposure on user endpoints.
Real-Time Example 9: Windows Internals & Active Directory Reference Matrix
A comprehensive reference summary pairing Windows security subsystems, Active Directory components, primary attack methods, defensive controls, and academic exam keywords for B.Tech engineering students.
Windows Security & Active Directory Specification Reference Matrix
WINDOWS SECURITY INTERNALS & ACTIVE DIRECTORY SPECIFICATION MATRIX:
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ SUBSYSTEM / COMPONENT   β”‚ IMPLEMENTATION LOCATION        β”‚ ATTACK VECTOR    β”‚ ENTERPRISE DEFENSIVE CONTROL  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ SAM Registry Hive       β”‚ C:\Windows\System32\config\SAM β”‚ Offline cracking,β”‚ BitLocker Full Disk Encryptionβ”‚
β”‚                         β”‚ SYSKEY protected at rest       β”‚ Volume Shadow cpyβ”‚ Restrict local Administrator  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ LSASS Subsystem         β”‚ lsass.exe process memory       β”‚ Mimikatz memory  β”‚ Credential Guard (VBS/LSAIso),β”‚
β”‚                         β”‚ (User-Mode Security Broker)    β”‚ dump, PtH        β”‚ LSA Protection (RunAsPPL = 1) β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Kerberos v5 (KDC)       β”‚ Active Directory Service       β”‚ Kerberoasting,   β”‚ Group Managed Service Accountsβ”‚
β”‚                         β”‚ UDP / TCP Port 88              β”‚ AS-REP Roasting  β”‚ (gMSA), AES-256 Kerberos keys β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ krbtgt Account          β”‚ Master Domain Account          β”‚ Golden Ticket    β”‚ Reset krbtgt password TWICE   β”‚
β”‚                         β”‚ Signs all valid TGT tickets    β”‚ Forgery (T1558)  β”‚ periodically via script       β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ NTLM Authentication     β”‚ msv1_0.dll SSP                 β”‚ NTLM Relay,      β”‚ Enforce SMB Signing, Disable  β”‚
β”‚                         β”‚ Challenge-Response Protocol    β”‚ Pass-the-Hash    β”‚ LLMNR/NBT-NS, Restrict NTLM   β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Active Directory DB     β”‚ C:\Windows\NTDS\ntds.dit       β”‚ DCSync Attack,   β”‚ Restrict Replicating Directoryβ”‚
β”‚                         β”‚ ESE / JET Blue database engine β”‚ NTDS extraction  β”‚ Changes privileges on domain  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Security Ref. Monitor   β”‚ ntoskrnl.exe                   β”‚ Privilege Escal- β”‚ Token privilege stripping,    β”‚
β”‚ (SRM)                   β”‚ (Executive Kernel Space)       β”‚ ation Bypass     β”‚ User Account Control (UAC)    β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Privileged Access Model β”‚ Tier 0, Tier 1, Tier 2         β”‚ Lateral Movement β”‚ Privileged Access Workstationsβ”‚
β”‚ (Tiered Administration) β”‚ Domain Separation Model        β”‚ Credential Pivot β”‚ (PAWs), Deny network logons   β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ TOP 5 WINDOWS & ACTIVE DIRECTORY HARDENING PRINCIPLES:                                                      β”‚
β”‚ 1. Isolate LSASS via Credential Guard: Use hardware virtualization to block memory dump utilities.          β”‚
β”‚ 2. Enforce Tiered Administration: Never log into a workstation with a Domain Admin credential.              β”‚
β”‚ 3. Disable Legacy Protocols: Disable LLMNR, NetBIOS, and SMBv1 to eliminate broadcast relay attacks.        β”‚
β”‚ 4. Protect Service Accounts with gMSAs: Eliminate Kerberoasting by using 120-character rotating keys.       β”‚
β”‚ 5. Monitor Event Logs Aggressively: Audit EID 4624 (LogonType 3), EID 4769, and EID 7045 in SIEM.           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
Academic & Professional Standard: Windows security and Active Directory represent the core enterprise authorization architecture in modern industry. Mastering SAM/LSASS memory isolation, Kerberos v5 ticket flows, Golden Ticket defenses, and Tiered Administration prepares B.Tech students to audit corporate networks, detect advanced lateral movement, and engineer resilient enterprise defenses.