nmap / npcap

Nmap Project's Windows packet capture and transmission library
https://npcap.com
Other
2.98k stars 514 forks source link

Npcap installer should detect and remediate for NETCFG_E_MAX_FILTER_LIMIT #83

Open dmiller-nmap opened 6 years ago

dmiller-nmap commented 6 years ago

As discussed in nmap/nmap#572, Windows 7 has a limit on the number of NDIS filter drivers that can be installed, defaulting to 8 but configurable up to 14. Right now, we detect the specific error and print a message to STDOUT in NPFInstall.exe, but the installer doesn't take any special action on this condition.

I propose 2 changes:

  1. When NETCFG_E_MAX_FILTER_LIMIT is returned, increment HKLM:\SYSTEM\CurrentControlSet\Control\Network\MaxNumFilters and try again.
  2. If the install continues to fail with the same error, fail in such a way that the executable installer can detect and display a useful error message to the user. Existing message is simply "Failed to create the npcap service for Win7, Win8 and Win10. Please try installing Npcap again, or use the latest official Npcap installer from https://nmap.org/npcap/"
dmiller-nmap commented 6 years ago

The first part of this (attempting to increment MaxNumFilters) is implemented in the installer for Npcap 0.99-r5. I would appreciate any feedback on whether this works, as I have been unable to confirm it yet.