🧠 Introduction

What is SMB Signing?

SMB Signing is a security mechanism in Windows that ensures SMB (Server Message Block) traffic is cryptographically signed. This prevents attackers from tampering with SMB communications or launching man-in-the-middle (MitM) attacks.

When SMB Signing is disabled or not required, an attacker can hijack SMB sessions, relay NTLM hashes, or inject malicious payloads.


Why It’s Important

  • πŸ›‘οΈ Unsigned SMB traffic can be intercepted, manipulated, or relayed by attackers.
  • πŸ§‘β€πŸ’» Exploited during lateral movement, NTLM relay attacks, and credential harvesting.
  • 🏒 Common in internal network attacks, red team ops, and real-world breaches.

Example:
β€œAn attacker inside the network could impersonate a legitimate server, capture NTLM hashes from clients, and use them to authenticate against other systems β€” even without knowing the password.”


βš™οΈ Technical Explanation (For IT Professionals)

Root Cause

The SMB service (client or server) is configured to either:

  • Not require signing (optional mode), or
  • Not support it at all.

This allows connections to proceed unsigned, exposing traffic to attacks.

How It Works (Attack Path)

  1. Attacker positions themselves in the same subnet (e.g., ARP spoofing or rogue device).
  2. Client connects to SMB server without signing enforced.
  3. Attacker captures credentials, relays NTLM hashes, or injects malicious traffic.
  4. Domain compromise or lateral movement follows.

πŸ§ͺ Detection and Verification

1. Manual Check

πŸ”Ž On the SMB Server:

Get-SmbServerConfiguration | Select EnableSecuritySignature, RequireSecuritySignature

SMB Server unsigned config

πŸ”Ž On the Client:

Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters" | Select EnableSecuritySignature, RequireSecuritySignature

SMB Client unsigned config

2. Using Tools

  • πŸ” Nessus Plugin: SMB Signing not required (Plugin ID 57608, 57609)
  • πŸ” Nmap:
nmap --script smb2-security-mode.nse -p 445 <target-ip>

Message signing enabled but not required = vulnerable


πŸ› οΈ Step-by-Step Fix Guide

🧩 Step 1 – Identify the Affected System

Use the PowerShell commands above to audit all clients and servers.

🧩 Step 2 – Backup Registry (Clients)

reg export "HKLM\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters" C:\lanman-backup.reg

SMB Backup Registry config

🧩 Step 3 – Apply the Fix

βœ… Option A: Fix via PowerShell

πŸ“ Server Fix:
Set-SmbServerConfiguration -EnableSecuritySignature $true -RequireSecuritySignature $true -Force

Server signing enabled

πŸ“ Client Fix:
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters" -Name EnableSecuritySignature -Value 1 -PropertyType DWORD -Force
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters" -Name RequireSecuritySignature -Value 1 -PropertyType DWORD -Force

Client signing fix applied

Restart the system to apply the changes.


βœ… Option B: Fix via Group Policy (Domain-Wide)

  1. Run gpmc.msc

GPO client and server signing policy

  1. Go to:

    Computer Configuration >
    Windows Settings >
    Security Settings >
    Local Policies >
    Security Options
    
  2. Set the following policies to Enabled:

Policy NameValue
Microsoft network client: Digitally sign communications (always)Enabled
Microsoft network server: Digitally sign communications (always)Enabled

GPO Enabled Check

  1. Run:
gpupdate /force

GPO Force Update


πŸ” Prevention & Hardening

βœ… Disable SMBv1
βœ… Enforce SMB signing on all endpoints
βœ… Use EDR to monitor for relay/mitm
βœ… Use SMB over QUIC (encrypted, signed transport) in modern environments
βœ… Block SMB externally (always)


πŸ“Š Risk & Impact Summary

Impact TypeDescription
ConfidentialityCan expose credentials (NTLM hashes)
IntegritySMB traffic can be tampered with
AvailabilityService abuse or session hijacking
Business ImpactLateral movement and full domain compromise

🧱 Standards Mapping (Reference Frameworks)

FrameworkReference
CVE(None - misconfiguration)
CWECWE-300 – Channel Accessible by Non-Endpoint
MITRE ATT&CKT1040 – Network Sniffing
OWASPA05 – Security Misconfiguration
SAMA CSFCSC 6.2.5 – Secure Protocol Configuration
NISTAC-17 – Remote Access

🧭 Verification After Fix

Re-run:

Get-SmbServerConfiguration

Expected:

RequireSecuritySignature : True

Post-fix verification

Or scan with Nessus / Nmap again to confirm no longer flagged.


🧩 Additional Tips

  • Use Group Policy Results Wizard to verify applied policies
  • Add auditing for unsigned SMB sessions (Event ID 4624 + 5140)
  • Rotate privileged credentials if NTLM hashes were exposed

πŸ’¬ FAQ

Q1: Will this break legacy apps?

Some older apps relying on SMBv1 or unsigned connections may fail. Test first.

Q2: Is this enough to stop NTLM relay?

No β€” combine with NTLM hardening, SMB encryption, and relay mitigations like EPA.


πŸ”— References & Resources


βš–οΈ Legal & Ethical Note

This guide is for authorized environments only. Never apply changes to systems you don’t control or without written permission. Unauthorized testing is illegal.


✍️ Author’s Note

Written by Khaled Al‑Refaee (Ozex)
Cybersecurity Consultant | Red Team Operator | Offensive Security Professional

🌐 ozex.gitlab.io
β˜• Buy me a coffee