如何隐藏SSH的版本
本文以在 Ubuntu 18.04 上为例,演示如何隐藏 OpenSSH 的版本信息。
Step 1: 查看 OpenSSH 的版本信息
# whereis sshd
sshd: /usr/sbin/sshd /usr/share/man/man8/sshd.8.gz
# /usr/sbin/sshd -v
unknown option -- v
OpenSSH_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n 7 Dec 2017
usage: sshd [-46DdeiqTt] [-C connection_spec] [-c host_cert_file]
[-E log_file] [-f config_file] [-g login_grace_time]
[-h host_key_file] [-o option] [-p port] [-u len]
使用 nmap 进行外部扫描。
# nmap -p 22 -sV -v -n 192.168.2.167
Starting Nmap 7.91 ( https://nmap.org ) at 2021-02-08 19:14 CST
NSE: Loaded 45 scripts for scanning.
Initiating Ping Scan at 19:14
...
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 7.6p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
可以看到版本为:O