Identifying where a package came from
This will show you your installed brew packages

brew list


There may be options in other package managers, but nmap can also be installed by downloading the disk image and installing manually.