nmap / nmap/npcap

Remove duplicate Npcap Loopback Adapters created by earlier Npcap versions

Open
#55 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C
Stars
3.6k
Forks
592
PR merge metrics
No merged PRs in 30d

Description

Npcap versions 0.95 through 0.995 had an uninstaller problem where they didn't always correctly remove the "Npcap Loopback Adapter" that the installer creates. So systems could collect extra versions, since each upgrade during that time would add a new one without deleting any. I found I had 23 and it was bogging down Nmap scan times and Wireshark adapter listing times, mostly because adapter listing is not currently very efficient (see issue nmap/nmap#1551 ). Npcap versions 0.996 and later properly remove the loopback adapter when they uninstall, but they don't (yet) remove any old duplicate adapters left by 0.95 and 0.995 uninstalls/upgrades. It would be nice to add a feature to the uninstaller to remove ALL old Npcap Loopback Adapters when detected rather than just the latest one. But it's not quite as easy as expected because the trick is finding the appropriate one by index or GUID. There are several different registries of adapters, and the one with the "Npcap Loopback Adapter" description isn't the one that NPFInstall currently uses to remove the adapter. So it's something like: go through all the adapters by description, finding the GUIDs of the ones we want to remove. Then go through all the adapters by index, finding the ones that match one of the guids we want to remove, and remove it.

IN THE MEANTIME, users can manually remove any old loopback adapters by opening device manager (press Windows key and type "device manager"), then expand the "Network adapters" item, then, if there is more than one "Npcap Loopback Adapter", right click on them each and choose "uninstall device". Then reinstall Npcap so you get a proper one recreated. If you only have one "Npcap Loopback Adapter" and you aren't having any problems with it, then no need to delete anything as you don't have extras.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the uninstaller's current NPFInstall adapter-removal path and how it enumerates adapters and registries. Compare adapter descriptions and GUIDs across the relevant enumeration methods, then verify that all duplicate Npcap Loopback Adapters are removed while one current adapter is recreated or retained. Test with multiple loopback adapters left by older Npcap versions.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
networking, operating-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.