Cacher la version de SSH au vu des scanner (nmap, par exemple) ? C’est simple comme un sed !
0x01. POC
Une petite démo vaut parfois mieux qu’un long discours :
0x02. STRINGS
strings /usr/sbin/sshd|grep OpenSSH
OpenSSH_7.9p1 Debian-10 OpenSSH_7.9p1 OpenSSH_7.9 OpenSSH_2.*,OpenSSH_3.0*,OpenSSH_3.1* OpenSSH_2*,OpenSSH_3*,OpenSSH_4* OpenSSH_7.0*,OpenSSH_7.1*,OpenSSH_7.2*,OpenSSH_7.3*,OpenSSH_7.4*,OpenSSH_7.5*,OpenSSH_7.6*,OpenSSH_7.7* OpenSSH_3.* OpenSSH_5* OpenSSH_6.6.1* OpenSSH_6.5*,OpenSSH_6.6* OpenSSH* [...]
0x02. SED
cp -fv /usr/sbin/sshd /usr/sbin/sshd.backup sed -i.copy1 "s/OpenSSH_7.4p1 Debian-10+deb9u6/OpenSSH ./1" /usr/sbin/sshd sed -i.copy2 's/OpenSSH/authd /g' /usr/sbin/sshd sed -i.copy3 's/Bad SSH2 /Too bad /g' /usr/sbin/sshd systemctl restart ssh || cp -fv /usr/sbin/sshd.backup /usr/sbin/sshd
=> Écrit par : Nicolas, le 02 septembre 2019