常见漏洞整改方法汇总

Update:2017.06.04

1.SMB Signing Disabled

Linux:修改smb配置文件
#vi /etc/samba/smb.conf
添加以下内容:

server signing = mandatory

https://www.samba.org/samba/docs/man/manpages-3/smb.conf.5.html

Windows:编辑注册表
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManWorkstation\Parameters
修改RequireSecuritySignature值为1

2.SMB Password Encryption Not Required

Linux:修改smb配置文件
#vi /etc/samba/smb.conf
添加以下内容:

encrypt passwords = yes

其它和密码明文相关的参数有client plaintext auth =no、client NTLMv2 auth = yes、min protocol = LANMAN1等
min protocol = SMB2,密码加密将不生效,依然为密码明文传输。
Samba配置参考:https://www.samba.org/samba/docs/man/manpages-3/smb.conf.5.html

3.SSH Weak Algorithms Supported(SSH支持弱加密算法)

SSH的配置文件中加密算法没有指定,默认支持所有加密算法,包括arcfour,arcfour128,arcfour256等弱加密算法。

整改测试参考:SSH&SSL弱加密算法漏洞修复.

修改SSH配置文件,添加加密算法:
vi /etc/ssh/sshd_config
最后面添加以下内容(去掉arcfour,arcfour128,arcfour256等弱加密算法):

Ciphers aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,3des-cbc

ssh_config和sshd_config都是ssh服务器的配置文件,二者区别在于,前者是针对客户端的配置文件,后者则是针对服务端的配置文件。

保存文件后重启SSH服务:
service sshd restart or service ssh restart
验证:
ssh -vv -oCiphers=aes128-cbc,3des-cbc,blowfish-cbc
ssh -vv -oMACs=hmac-md5

参考信息:http://linux.uits.uconn.edu/2014/06/25/ssh-weak-ciphers-and-mac-algorithms/

使用Nmap验证:
nmap --script "ssh2*" 45.76.186.62

4.SSH Weak MAC Algorithms Enabled

与上述漏洞修复使用同样的方式,sshd_config文件添加以下行:

MACs hmac-sha1,umac-64,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160

5.SSL Weak Cipher Suites Supported(SSL支持弱密码套件)

修改SSL配置文件中的的SSL Cipher参数

不同Web服务软件的配置文件位置及参数名称不同,需根据实际情况查找。
具体安全算法配置可参考此网站:https://cipherli.st/
如Apache修改以下内容:

《常见漏洞整改方法汇总》

验证方法:
nmap -p 443 --script "ssl-enum-ciphers" xx.xx.xx.xx

6.Network Time Protocol (NTP) Mode 6 Scanner

修改NTP配置文件
#vi /etc/ntp.conf
添加以下内容(建议使用此方式):

restrict default kod notrap nomodify nopeer noquery limited
restrict -6 default kod notrap nomodify nopeer noquery limited

或在提供NTP查询的网段加入noquery参数:

restrict 1.1.2.1 mask 255.255.255.0 nomodify notrap noquery

建议方法中两条配置为高版本NTP中的默认配置,noquery参数限制了mode 6 query,可根据NTP服务端实际配置参考修改。
noquery:Deny ntpq and ntpdc queries. Time service is not affected.
notrap:Decline to provide mode 6 control message trap service to matching hosts.
nomodify:Deny ntpq and ntpdc queries which attempt to modify the state of the server.
参考文档:http://doc.ntp.org/current-stable/accopt.html
http://support.ntp.org/bin/view/Support/AccessRestrictions

点赞