Security Baseline and Hardening
A security baseline is the minimum acceptable configuration for a system. Understanding what controls exist in a baseline — and why each one is there — is the difference between a hardened system and a system where someone ran a script.
A penetration tester gains initial access to a workstation through a phishing email. They open a shell and assess the environment. LLMNR is enabled — Responder will work. SMB signing is not required — NTLM relay is viable. Credential Guard is not deployed — LSASS credential harvesting will succeed. PowerShell Script Block Logging is not enabled — PowerShell payloads won't be recorded. NTLMv1 is permitted — weaker hash, crackable.
None of these are vulnerabilities in the traditional sense — no CVE number, no missing patch. They're configuration decisions, or rather the absence of security-positive configuration decisions. An organization that has applied Microsoft's security baseline would have had most of these controls in place. A security baseline doesn't prevent every attack, but it removes the low-effort techniques that make attacker lateral movement trivial. This chapter explains what's in a security baseline and why each control exists.
What a Security Baseline Is
A security baseline is a documented, tested, minimum security configuration for a class of system. Microsoft publishes Windows security baselines through the Security Compliance Toolkit. CIS (Center for Internet Security) publishes the CIS Benchmarks. DISA publishes STIGs (Security Technical Implementation Guides) for government/military environments. These documents specify hundreds of configuration settings — registry values, Group Policy settings, service states, audit policies, and more — and the rationale for each.
Security Baseline Hierarchy
══════════════════════════════════════════════════════════════════════
Microsoft Security Baseline (free, via Security Compliance Toolkit)
──────────────────────────────────────────────────────────────────────
Level: Recommended for enterprise Windows workstations and servers
Source: docs.microsoft.com/security/benchmark/
Deployment: Group Policy Objects (GPO) — importable directly
Coverage: ~300+ settings per OS version
Philosophy: Balance between security and usability; won't break
most enterprise applications
CIS Benchmarks (free, registration required)
──────────────────────────────────────────────────────────────────────
Level 1: "Sensible" defaults — won't break functionality
Level 2: More restrictive — may break some functionality
Source: cisecurity.org/cis-benchmarks/
Coverage: More granular than Microsoft baseline; covers
more edge cases; includes scored audit procedures
DISA STIG
──────────────────────────────────────────────────────────────────────
Level: Most restrictive — designed for government systems
Source: public.cyber.mil/stigs/
Deployment: STIG Viewer tool; SCC compliance scanner
Use case: Federal, DoD, and defense contractors
WHICH TO USE:
Corporate: Microsoft Security Baseline is easiest to deploy via GPO
Compliance-focused: CIS Benchmarks for scored, auditable controls
Government/DoD: DISA STIG — often contractually required
Key Hardening Controls: What They Do and Why
Rather than enumerate hundreds of baseline settings, this chapter focuses on the controls with the highest impact on actual attacker techniques — the ones that show up repeatedly in post-incident reviews as "this would have stopped it or slowed it significantly."
| Control | What It Does | Attack It Defeats |
|---|---|---|
| Disable LLMNR and NBT-NS | Turns off broadcast name resolution protocols that respond to any name query on the local subnet. Systems use only DNS for name resolution. | Responder/Inveigh LLMNR/NBT-NS poisoning attacks (see Chapter 4). Without LLMNR, the Responder "capture hash on fake response" attack has no broadcast queries to intercept. |
| Require SMB Signing | All SMB sessions cryptographically signed; packets with invalid or missing signatures are rejected. Enabled by default on DCs; must be enforced on workstations/servers via policy. | NTLM relay attacks via SMB. An attacker relaying captured NTLM credentials to authenticate to a target requires the target to accept the relayed connection — if signing is required, the relay fails because the attacker can't forge valid signatures. |
| Enable Credential Guard | Moves NTLM hashes and Kerberos tickets from LSASS (a normal user-mode process) into a Trustlet running in VTL1 (isolated from the normal OS). LSASS can use credentials but can't expose the raw hashes to Ring 0 or Ring 3 code. | Pass-the-hash, pass-the-ticket, and credential dumping via Mimikatz/lsass.exe. With Credential Guard, Mimikatz sekurlsa::logonpasswords returns empty — the hashes aren't in accessible LSASS memory. |
| Enforce NTLMv2, disable NTLMv1 | LM Authentication Level registry key: set to "Send NTLMv2 response only. Refuse LM & NTLM". NTLMv1 and LM authentication are rejected. | NTLMv1 hashes are significantly weaker than NTLMv2. Captured NTLMv1 hashes can be cracked with specialized hardware in hours. NTLMv2 hashes take much longer and require more compute. Disabling NTLMv1 forces all authentication to use the stronger protocol. |
| Enable PowerShell Script Block Logging | All PowerShell script blocks logged to Event ID 4104 after de-obfuscation. See Chapter 7. | PowerShell-based attacks: download cradles, in-memory execution, living-off-the-land scripts. Obfuscation is irrelevant — the decoded script is logged. |
| Disable SMBv1 | Remove SMBv1 Windows Feature. SMBv1 is a legacy protocol (Windows XP era) with no security features: no signing, no encryption, no modern authentication. | EternalBlue (MS17-010) and most SMB-based lateral movement exploits target SMBv1. WannaCry required SMBv1. Modern networks have no reason to use SMBv1 — everything supports SMBv2+. |
| Local Administrator Password Solution (LAPS) | Randomizes the local Administrator account password per machine, storing the password in AD. See Chapter 2. | Local admin credential reuse. Without LAPS, if one workstation is compromised and the local admin password is cracked, that same password works on every other workstation — enabling instant lateral movement across the fleet. |
| Disable PowerShell 2.0 | Remove Windows PowerShell 2.0 optional feature. Forces all PowerShell usage through modern PowerShell with AMSI, Script Block Logging, and CLM. | PowerShell downgrade attack — invoking PS 2.0 bypasses all security controls added to PowerShell 3.0+. Without the 2.0 engine installed, the downgrade command fails. |
| Attack Surface Reduction (ASR) Rules | Group Policy/Intune rules that block specific high-risk behaviors in Office, browsers, and scripts: block Office from creating child processes, block macro execution from internet-sourced documents, block credential stealing from LSASS, etc. | Initial access via malicious Office documents (the most common phishing vector). Specifically: blocking Office from creating child processes (cmd.exe, PowerShell) prevents most macro-based initial access without blocking legitimate Office functionality. |
Windows Attack Surface Reduction Rules
ASR (Attack Surface Reduction) rules are a set of behavioral controls in Windows Defender that block specific attacker-favored actions at the policy level. They differ from AV signatures — they block classes of behavior rather than specific malware files.
Key ASR Rules and Their Target Techniques
══════════════════════════════════════════════════════════════════════
Block Office applications from creating child processes
─────────────────────────────────────────────────────────────────
GUID: D4F940AB-401B-4EFC-AADC-AD5F3C50688A
Target: Malicious macro → cmd.exe → PowerShell → download cradle
This is the most common phishing attack chain
Impact: Blocks the most common initial access technique
False positives: Some Office add-ins and automation tools
Audit mode available to test before enforcing
Block credential stealing from LSASS
─────────────────────────────────────────────────────────────────
GUID: 9E6C4E1F-7D60-472F-BA1A-A39EF669E4B0
Target: Mimikatz and other LSASS dumping tools that read
lsass.exe memory for NTLM hashes and plaintext passwords
Note: Overlaps with Credential Guard; this ASR rule applies
on systems where Credential Guard can't be deployed
Block untrusted and unsigned processes from USB
─────────────────────────────────────────────────────────────────
GUID: B2B3F03D-6A65-4F7B-A9C7-1C7EF74A9BA4
Target: USB-based malware delivery (BadUSB, autorun scripts)
Physical access attacks where attacker plugs in USB
Block abuse of exploited vulnerable signed drivers
─────────────────────────────────────────────────────────────────
GUID: 56A863A9-875E-4185-98A7-B882C64B5CE5
Target: BYOVD (Bring Your Own Vulnerable Driver) attacks —
attacker loads a legitimate but vulnerable signed driver
to escalate to kernel context and disable EDR
Block persistence via WMI event subscriptions
─────────────────────────────────────────────────────────────────
GUID: E6DB77E5-3DF2-4CF1-B95A-636979351E5B
Target: WMI subscriptions used for persistence (Chapter 14)
WMI subscriptions survive reboots and run arbitrary code
Group Policy as the Enforcement Mechanism
Group Policy (GPO) is how baseline settings are deployed at scale in a Windows domain. Understanding how Group Policy works — and how it can be attacked — is important for detection engineers, because GPO modifications are a high-value target for attackers who want to make configuration changes that persist across all machines.
Group Policy Application Flow and Security Implications
══════════════════════════════════════════════════════════════════════
Group Policy application order (LSDOU):
Local → Site → Domain → Organizational Unit
Later policies WIN on conflict (OU > Domain > Site > Local)
How GPOs are stored and distributed:
─────────────────────────────────────────────────────────────────
SYSVOL share on domain controllers:
\\domain.com\SYSVOL\domain.com\Policies\{GUID}\
Every domain member accesses SYSVOL to download GPO files
SYSVOL is replicated across all DCs via DFSR
Security implications of GPO:
─────────────────────────────────────────────────────────────────
✦ Who can modify GPOs?
- Domain Admins: create/modify any GPO
- Group Policy Creators Owners: create GPOs
- Delegated users: modify specific GPOs if permissions granted
✦ Attacker goal: modify GPO to push malicious policy
- Modify startup script GPO → runs payload on all machines at boot
- Modify software installation GPO → MSI package deployed to fleet
- Modify audit policy GPO → disable logging across the domain
- This is why DC/GPO compromise is catastrophic:
attacker controls policy for all domain members
✦ Detection for GPO modification:
- Domain controller Security log: Event ID 5136 (directory object modified)
- SYSVOL file modification timestamps
- Sysmon on DCs: file write events in SYSVOL path
- EDR process creation on DCs: unusual processes accessing SYSVOL
A baseline is a starting point, not a destination. Baselines are designed to be broadly applicable — they represent configurations that are beneficial for most organizations without breaking most applications. They are not designed for your specific threat model. A baseline won't disable or restrict every attack technique relevant to your environment. After applying a baseline, you still need threat-model-driven hardening (what attacks are most likely against you specifically?), compensating controls for applications that can't accept the baseline setting, and continuous monitoring to detect when configurations drift from baseline. Organizations that deploy a baseline and consider the job done will find gaps during their first red team engagement. Organizations that use the baseline as a foundation and build on it with environment-specific controls have meaningfully better security posture.
Privileged Access Workstations
Some machines justify more restrictive configuration than a standard baseline. Privileged Access Workstations (PAWs) are dedicated machines used only for administrative tasks — no email, no web browsing, no user productivity software.
| PAW Control | Why It Matters |
|---|---|
| No internet browsing or email on the PAW | Phishing and drive-by downloads are the most common initial access vectors. A PAW with no browser has no exposure to these vectors. |
| WDAC application control (allowlist) | Only explicitly approved executables can run. Attacker tools (Mimikatz, Cobalt Strike) are not on the allowlist and are blocked at execution. |
| Admin accounts used only from PAW | Admin credentials that exist only on a locked-down PAW can't be stolen from a regular workstation. An attacker who compromises a user's laptop doesn't find domain admin tokens. |
| Credential Guard + Device Guard | Ensures credentials processed on the PAW can't be harvested even by kernel-level attackers. |
| Dedicated admin accounts, not dual-use | Admin accounts used only for administration. The same account is never used for email or browsing. Compromise of the user's daily account doesn't yield admin credentials. |
Q & A
1. What is the difference between a security baseline and application control (WDAC/AppLocker)?
A security baseline is a set of configuration settings that reduce attack surface and enable detection capabilities. It adjusts how existing Windows features behave — tightening authentication protocols, enabling logging, disabling unused services, enforcing SMB signing. Application control (WDAC or AppLocker) is a separate layer that controls which executables, scripts, and DLLs are allowed to run. Baseline hardening and application control address different threat vectors and stack on top of each other. A baseline reduces the impact of a compromised process — even if malware runs, it can't relay NTLM because signing is required, it can't dump credentials because Credential Guard is enabled, its actions are logged because Script Block Logging is on. Application control tries to prevent the malware from running in the first place. Both are necessary — application control has bypass techniques (signed LOLBins, trusted binaries), and baseline hardening has gaps (novel techniques, unpatched vulnerabilities). Layering both means an attacker who bypasses application control still faces a hardened, well-monitored environment.
2. An attacker has domain admin. They modify a GPO to deploy a startup script. What evidence exists and can it be detected quickly?
Several detection signals are available. On the domain controller: Event ID 5136 fires in the Security log when a directory object (including the GPO object in AD) is modified — this records what attribute changed, who changed it, and when. Sysmon on the DC would record file writes to the SYSVOL path (the GPO's file-side configuration). These events are near- real-time — they fire at the moment of modification. If the SIEM is collecting Security events from domain controllers (which it should be — DCs are the highest-priority log source), the 5136 event lands in the SIEM within seconds. The challenge: 5136 is noisy in active environments because legitimate GPO changes generate the same event. Detection typically involves: alerting on modifications to specific high-sensitivity GPOs (the default domain policy, any GPO linked at domain level) or modifications made outside of change windows. The faster path in many environments is behavioral detection: the startup script, once distributed via SYSVOL, runs on machines at next policy refresh (90-minute default). Sysmon on the endpoint would record the new process (gpscript.exe or cmd.exe) spawning from the startup script context, with the unusual parent process. The GPO-modification event and the execution event together tell the full story.
3. Why is disabling LLMNR considered a baseline hardening action when LLMNR is an OS feature Microsoft ships?
LLMNR was designed for small networks without a DNS server — it lets machines find each other by name without needing centralized infrastructure. In an enterprise domain with DNS, LLMNR serves no purpose: every machine can resolve names via the domain DNS servers. The protocol is enabled by default because Microsoft can't know at Windows installation time whether the machine will be in a domain with DNS or a small network without it. In a domain environment, LLMNR is all downside and no upside: it adds zero functionality (DNS handles all name resolution) while creating a significant attack vector (Responder exploits it to capture NTLM hashes). Microsoft's own security baseline recommends disabling it. The same logic applies to NBT-NS — a NetBIOS name service from Windows NT days, similarly unnecessary in modern environments with DNS. When you see a feature in a baseline disabled, the reasoning is usually similar: the feature was designed for an older or less capable environment, modern alternatives exist, and the feature creates attack surface without providing value in the current deployment context.
4. What is the LSASS protection setting and why isn't it the same as Credential Guard?
LSASS Protection (also called "Protected Process Light" for LSASS) is a Windows feature that marks the lsass.exe process as a Protected Process Light (PPL). PPL processes can only be opened by other processes with a higher protection level — regular user-mode processes, including Mimikatz running at admin rights, cannot open a handle to a PPL process with PROCESS_VM_READ access. This blocks many LSASS dumping techniques that work by opening a handle and reading memory. However, LSASS Protection can be bypassed by a kernel driver (including a vulnerable signed driver — the BYOVD technique). Credential Guard is different in architecture: it moves the actual credential material (NTLM hashes, Kerberos keys) out of lsass.exe memory entirely and into an isolated process running in VTL1 (Isolated User Mode). Even if you bypass PPL and successfully dump lsass.exe memory, the credential material is not there — it was never stored in the VTL0 lsass.exe. Credential Guard provides stronger protection against credential theft because the protected data is in a different security domain (VTL1) rather than in the same process with enhanced access controls. The practical recommendation: deploy both, but if you can only deploy one, Credential Guard provides more durable protection against credential harvesting than PPL alone.