Skip to content

TCP/IP Hardening

A handful of old settings in the network stack that still matter. Most stop an attacker on the local network from redirecting traffic through their machine. They live under MSS (Legacy) in gpedit.msc if the template is installed; otherwise use the registry values, which work either way.

The settings

CIS Setting Set to Registry (under HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters unless noted) Why
18.5.3 (DisableIPSourceRouting) IP source routing protection level Highest protection, source routing is completely disabled DisableIPSourceRouting = 2 Source-routed packets specify their own path; used to bypass firewalls and spoof addresses
18.5.2 (DisableIPSourceRouting IPv6) Highest protection Tcpip6\Parameters\DisableIPSourceRouting = 2 Same, IPv6
18.5.5 (EnableICMPRedirect) Allow ICMP redirects to override OSPF generated routes Disabled EnableICMPRedirect = 0 An attacker sends an ICMP redirect and becomes the route to a destination
18.5.8 (PerformRouterDiscovery) Allow IRDP to detect and configure Default Gateway addresses Disabled PerformRouterDiscovery = 0 Level 2. An attacker advertises as a router and becomes the default gateway.
18.5.6 (KeepAliveTime) How often keep-alive packets are sent 300000 KeepAliveTime = 300000 Level 2. Dead connections detected in 5 minutes instead of 2 hours.
18.5.11 (TcpMaxDataRetransmissions) 3 TcpMaxDataRetransmissions = 3 Level 2. Fewer retransmissions means flood attacks tie up resources for less time.
18.5.10 (TcpMaxDataRetransmissions IPv6) 3 Tcpip6\Parameters\TcpMaxDataRetransmissions = 3 Level 2.
18.5.4 (DisableSavePassword) Prevent the dial-up password from being saved Enabled RasMan\Parameters\DisableSavePassword = 1 Level 2. Saved VPN passwords are stored on disk.

IPv6

CIS Setting Set to Why
18.6.19.2.1 Disable IPv6 Tcpip6\Parameters\DisabledComponents = 0xff Level 2. Most networks are IPv4-only, and an unmanaged IPv6 stack is a second attack surface nobody watches. Skip if the scenario's network uses IPv6. Restart required.

Apply

reg add "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" /v DisableIPSourceRouting /t REG_DWORD /d 2 /f
reg add "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters" /v DisableIPSourceRouting /t REG_DWORD /d 2 /f
reg add "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" /v EnableICMPRedirect /t REG_DWORD /d 0 /f
reg add "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" /v PerformRouterDiscovery /t REG_DWORD /d 0 /f
reg add "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" /v KeepAliveTime /t REG_DWORD /d 300000 /f
reg add "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" /v TcpMaxDataRetransmissions /t REG_DWORD /d 3 /f
reg add "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters" /v TcpMaxDataRetransmissions /t REG_DWORD /d 3 /f
reg add "HKLM\SYSTEM\CurrentControlSet\Services\RasMan\Parameters" /v DisableSavePassword /t REG_DWORD /d 1 /f

Level 2 only, and only on an IPv4 network:

reg add "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters" /v DisabledComponents /t REG_DWORD /d 255 /f

Verify

reg query "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" /v DisableIPSourceRouting
reg query "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" /v EnableICMPRedirect

2 and 0.

Next

Wireless and Connections