nmap/mswin32/nmap_performance.reg
結友 168eb1a349
Windows: stop setting MaxUserPort and delete any existing value
nmap_performance.reg no longer sets MaxUserPort=0xfffe. It now contains
"MaxUserPort"=- instead, which deletes the value unconditionally: any
existing MaxUserPort is removed whenever the file is applied, whoever
set it, not only when an earlier Nmap installer wrote it. This is the
only way to undo what earlier installers did on upgrade. As before, the
file is only applied when the user opts into the "Network Performance
Improvements" installer section, and the dynamic port range itself
changes after the next reboot because MaxUserPort is read at boot.

MaxUserPort raised the ephemeral port limit on Windows 2000/XP/2003,
whose default dynamic port range was 1025-5000. Nmap dropped those
systems in 7.25BETA1, and since 7.92 the Windows binaries do not run on
Vista or earlier at all. On Windows Vista and later the default range is
already 49152-65535, and MaxUserPort instead widens it to 1024-65534.
That spreads every outgoing connection over the whole port space and
breaks software that needs a contiguous block of host ports: WSL2
mirrored networking fails with
CreateInstance/CreateVm/ConfigureNetworking/0x8007054f and falls back
to no networking (microsoft/WSL#13454, where several reporters traced
it to this installer option).

TcpTimedWaitDelay and StrictTimeWaitSeqCheck are unchanged. The install
guide now describes the deletion, the manual fix for users who do not
re-run the installer, and how to widen the ephemeral range with netsh
from a high starting port if a scan really needs more than 16384 ports.

Verified on Windows 11: applying the file with "regedt32 /S" deletes
MaxUserPort and sets the other two values. The installer itself was not
tested end to end.

Refs: GH#149
2026-11-06 10:47:13 +09:00

10 lines
457 B
Reg

REGEDIT4
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters]
; Earlier Nmap releases set MaxUserPort=0xfffe. On Windows Vista and later
; that widens the TCP dynamic port range to 1024-65534 and breaks software
; that needs a contiguous block of ports (e.g. WSL2 mirrored networking).
; Remove it if an older installer left it behind.
"MaxUserPort"=-
"TcpTimedWaitDelay"=dword:0000001e
"StrictTimeWaitSeqCheck"=dword:00000001