linux 服务器安全漏洞升级

611 阅读1分钟

1. HSTS Missing From HTTPS Server (RFC 6797)

如果网站http升级为https,通过302重定向时候,黑客可以通过http的进行攻击和篡改跳转到他们的域名,当开通了 HSTS后,浏览器会维护HSTS列表,如果匹配,不重定向,直接访问对应的https地址

方案

add\_header Strict-Transport-Security: max-age=31536000; includeSubDomains; preload

2. TLS Version 1.0 Protocol Detection

tls版本太低

方案

nginx 配置 ssl_protocols TLSv1.2;

3. nginx < 1.17.7 Information Disclosure

1.17.7 有漏洞

方案

升级最新的nginx版本

4. SSH Weak Algorithms Supported

在sshd_config中没有使用加密算法

方案

vi /etc/ssh/sshd_config

最后一行添加如下内容
Ciphers aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com

MACs hmac-sha1,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,hmac-ripemd160@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha1-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-ripemd160-etm@openssh.com,umac-64-etm@openssh.com,umac-128-etm@openssh.com

重启服务
service sshd restart
/bin/systemctl restart sshd.service

验证
ssh -vv -oMACs=hmac-md5 192.168.1.xx

5. mDNS Detection (Remote Network)

mdns (5353)会泄露主机名,端口,操作系统,服务,CPU等信息

方案

关闭5353端口,或者关闭avahi-deamon服务
service avahi-daemon stop 
chkconfig avahi-daemon off

6. Apache Tomcat重定向(CVE-2018-11784)

ip访问已关闭,已调整为nginx 的域名访问

7.tomcat的Web.xml文件信息泄露

方案

删除多余配置