Add NATS server version detection (TCP NULL probe)

Adds a service-detection match for the NATS messaging server, which sends
an 'INFO {...}' JSON banner containing its version immediately on connect
(default port 4222).

Before this, nmap -sV mis-identified NATS as 'MongoDB 14.2' via the loose
catch-all mongodb match (^.*version.....); the new NULL-probe match fires
first and reports it correctly, e.g.:

  4222/tcp open  nats  NATS server 2.14.2

Validated with nmap against nats:latest/2.10/2.9 in Docker (true positive,
correct version + CPE), with no false match against redis or nginx. CPE
uses the NVD vendor/product cpe:/a:linuxfoundation:nats-server.
This commit is contained in:
potato-20 2026-06-04 18:36:29 +05:30
parent 2a16e04500
commit 0ea905cf21

View file

@ -2105,6 +2105,9 @@ match mwti-rpc m=^Welcome MWTI RPC Communication Server Version ([\w._-]+) \[(?:
softmatch napster m|^1$|
# NATS messaging system; the server sends an INFO {...} JSON banner including its version on connect (default port 4222)
match nats m|^INFO \{"server_id":"\w+".*?"version":"([\d][\w.+-]*)"|s p/NATS server/ v/$1/ cpe:/a:linuxfoundation:nats-server:$1/
# Ncat --chat mode, since 4.85BETA4
match ncat-chat m|^<announce> [\d.:a-f]+ is connected as <\w+>\.\n<announce> already connected: (.*?)\.\n| p/Ncat chat/ i/users: $1/