Skip to content

服务识别

使用 nmap -sV 对指定端口进行服务版本探测,识别运行中的服务类型和软件版本。

参数说明

参数类型必填默认值说明
主机 (host)stringIP 地址或域名
端口 (port)integer目标端口(1-65535)
超时 (timeout)integer60扫描超时时间(秒)

结果解读

Nmap scan report for 192.168.1.100
Host is up (0.010s latency).

PORT     STATE    SERVICE    VERSION
80/tcp   open     http       Apache httpd 2.4.41
443/tcp  open     ssl/http   Apache httpd 2.4.41
22/tcp   open     ssh        OpenSSH 8.2p1 Ubuntu 4ubuntu0.5
3306/tcp filtered mysql
含义
PORT端口和协议
STATEopen(开放)/ filtered(被过滤)/ closed(关闭)
SERVICE服务类型推断
VERSION具体软件和版本号

判断标准

  • open + 版本信息 → 服务正常运行,版本号可用于评估安全风险
  • filtered → 防火墙拦截探测,无法确定端口状态
  • 版本信息准确 → 可帮助判断是否需要升级或修补漏洞

注意事项

  • 需要系统安装 nmap 命令
  • 需要 CAP_NET_RAW + CAP_NET_ADMIN 权限
  • 仅单端口扫描,不可扫描范围
  • 服务检测需要额外时间(nmap 会发送多种探针)