Skip to content

Commit 52c790f

Browse files
Merge pull request #1667 from projectdiscovery/1594-native-service-fingerprinting
Native service fingerprinting
2 parents 377c8d5 + 2395881 commit 52c790f

26 files changed

Lines changed: 9054 additions & 183 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ cmd/functional-test/naabu_dev
66
cmd/functional-test/functional-test
77
cmd/functional-test/naabu
88
cmd/functional-test/*.cfg
9+
cmd/tools/portcorr/
910
.vscode
1011
dist

README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,14 @@ OUTPUT:
8686
-j, -json write output in JSON lines format
8787
-csv write output in csv format
8888

89+
SERVICES-DISCOVERY:
90+
-sD, -service-discovery identify services by port number
91+
-sV, -service-version detect service versions using nmap-service-probes
92+
-sV-fast only probe port-hinted services (faster, skips fallback)
93+
-sV-timeout duration timeout for service version probes (default 5s)
94+
-sV-workers int number of concurrent service version workers (default 25)
95+
-sV-probes string custom nmap-service-probes file path (auto-detected if empty)
96+
8997
CONFIGURATION:
9098
-config string path to the naabu configuration file (default $HOME/.config/naabu/config.yaml)
9199
-scan-all-ips, -sa scan all the IP's associated with DNS record
@@ -368,6 +376,35 @@ PORT STATE SERVICE VERSION
368376
8443/tcp open ssl/https-alt cloudflare
369377
```
370378

379+
# Service Version Detection
380+
381+
Naabu has built-in service version detection using nmap's service probes database. This runs in parallel with port scanning for maximum performance.
382+
383+
```sh
384+
naabu -host scanme.sh -sV
385+
```
386+
387+
```console
388+
scanme.sh:22 [ssh OpenSSH/6.6.1p1]
389+
scanme.sh:80 [http Apache httpd/2.4.7]
390+
scanme.sh:9929 [nping-echo Nping echo]
391+
392+
[INF] Found 3 ports on host scanme.sh (45.33.32.156) with 3 services identified
393+
```
394+
395+
Available flags:
396+
397+
| Flag | Description |
398+
|------|-------------|
399+
| `-sV` | Enable service version detection |
400+
| `-sV-fast` | Only probe port-hinted services (faster, skips fallback probes) |
401+
| `-sV-timeout duration` | Timeout for service version probes (default 5s) |
402+
| `-sV-workers int` | Number of concurrent service version workers (default 25) |
403+
| `-sV-probes string` | Custom nmap-service-probes file path (auto-detected if empty) |
404+
| `-sD` | Service discovery (match port number to service name, no active probing) |
405+
406+
The `-sV` flag requires the `nmap-service-probes` database file. Naabu automatically looks for it in standard nmap installation paths. To use a custom file, specify the path with `-sV-probes`.
407+
371408
# CDN/WAF Exclusion
372409

373410
Naabu also supports excluding CDN/WAF IPs being port scanned. If used, only `80` and `443` ports get scanned for those IPs. This feature can be enabled by using `exclude-cdn` flag.

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ require (
88
github.com/Ullaakut/nmap/v3 v3.0.6
99
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5
1010
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2
11+
github.com/dlclark/regexp2 v1.11.5
1112
github.com/logrusorgru/aurora v2.0.3+incompatible
1213
github.com/miekg/dns v1.1.62
1314
github.com/pkg/errors v0.9.1
@@ -57,7 +58,6 @@ require (
5758
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
5859
github.com/dimchansky/utfbom v1.1.1 // indirect
5960
github.com/djherbis/times v1.6.0 // indirect
60-
github.com/dlclark/regexp2 v1.11.5 // indirect
6161
github.com/docker/go-units v0.5.0 // indirect
6262
github.com/dsnet/compress v0.0.2-0.20230904184137-39efe44ab707 // indirect
6363
github.com/ebitengine/purego v0.10.0 // indirect

0 commit comments

Comments
 (0)