我最近在我的 Ubuntu 18.04 服务器上进行了端口扫描(使用www.ipfingerprints.com),发现了一些我没有打开的端口。以下是开放的端口:
PORT STATE SERVICE
22/tcp open ssh
25/tcp open smtp
80/tcp open http
111/tcp filtered rpcbind
135/tcp filtered msrpc
136/tcp filtered profile
137/tcp filtered netbios-ns
138/tcp filtered netbios-dgm
139/tcp filtered netbios-ssn
443/tcp open https
445/tcp filtered microsoft-ds
513/tcp filtered login
520/tcp filtered efs
除了 22、25、80 和 443 之外,其余的这些端口我都没有打开。为什么它们是打开的,如果我关闭所有这些端口会影响我的服务器性能吗?
这些端口未打开。过滤意味着它们被防火墙阻止,这并不意味着没有这个防火墙端口就会打开。他们可能刚刚关闭。
验证
netstsat -tanp|grep LISTEN
执行
ss -tunapl
以查看哪些程序打开了端口。禁用不需要的服务,使用systemctl disable <service-name>.service.
上面的列表看起来像 samba 和相关服务正在运行。
nmap 指示“已过滤”仅表示数据包在您的 nmap 客户端和被扫描的目标之间的某个地方被黑洞。已过滤意味着防火墙、过滤器或其他网络障碍正在阻塞端口,因此 Nmap 无法判断它是打开还是关闭。-- http://nmap.org/book/man.html 参考:https://security .stackexchange.com/questions/14706/found-unusual-services-running-on-my-vps