Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
To fixe this issue, we need to change the default file used by nmap in
/usr/share/nmapin the engine.Regarding the nmap documentation. https://nmap.org/man/fr/man-misc-options.html >
A
--datadiroption could be set on each scan to specify a new directory where to find "template" file used by nmap to determine which kind of service is running on which portsnmap-service-probes, nmap-services, nmap-protocols, nmap-rpc, nmap-mac-prefixes et nmap-os-fingerprint(note that the documentation is not updated and the last file isnmap-os-dband notnmap-os-fingerprint.But, this option would required to be set on all scan policies, and, most of all, if a problem exists on the specific "datadir" set, nmap will then search in the default directory, this could create some confusion as old fixed template could then be used in specific cases and will make debug much more harder (we will never know which template nmap is actualy using).
Then, I decide to create all nmap-* templates file in the nmap-files directory, and
COPYtheses files directly in/usr/share/nmapdefault folder. This allows us to be sure our template are used, and also avoid us to have unwanted nmap changes on a specific release, as we are managing directly the template used by nmap.For this PR, i've just add a regex at the begning engines/nmap/nmap-files/nmap-service-probes allowing to fix false positive, and keep default nmap files which are working well for the time being.
In the future, we can add/modify specific regex directly in theses files, to be then used globally by Nmap.