兩會在即,系統(tǒng)安全是信息系統(tǒng)的重中之重,近期針對網(wǎng)絡(luò)系統(tǒng)做了個漏洞掃描,報告出現(xiàn)了部分“SSL Version 2 and 3 Protocol Detection”的漏洞情況,CVSS2和CVSS3都給出了7+的評分,屬于高危漏洞。漏洞修復(fù)過程雖然不是很復(fù)雜但是因大部分的互聯(lián)網(wǎng)應(yīng)用基本都會涉及該漏洞,故將問題分析及修復(fù)方案簡要整理成文,以供分享查閱。
漏洞掃描概要:
SSL Version 2 and 3 Protocol Detection
簡述:The remote service encrypts trafficusing a protocol with known weaknesses.
說明:The remote service accepts connectionsencrypted using SSL 2.0 and/or SSL 3.0. These versions of SSL are affected byseveral cryptographic flaws, including: - An insecure padding scheme with CBCciphers. - Insecure session renegotiation and resumption schemes. An attackercan exploit these flaws to conduct man-in-the-middle attacks or to decryptcommunications between the affected service and clients. Although SSL/TLS has asecure means for choosing the highest supported version of the protocol (sothat these versions will be used only if the client or server support nothingbetter), many web browsers implement this in an unsafe way that allows anattacker to downgrade a connection (such as in POODLE). Therefore, it isrecommended that these protocols be disabled entirely. NIST has determined thatSSL 3.0 is no longer acceptable for secure communications. As of the date ofenforcement found in PCI DSS v3.1, any version of SSL will not meet the PCISSC's definition of 'strong cryptography'.
解決方案:Consult the application's documentationto disable SSL 2.0 and 3.0. Use TLS 1.1 (with approved cipher suites) or higherinstead.
問題分析:
眾所周知,網(wǎng)站的網(wǎng)絡(luò)信息傳輸協(xié)議主要是用http和https,而HTTPS則是以安全為目標(biāo)的?HTTP?通道,在HTTP的基礎(chǔ)上通過傳輸加密和身份認證保證了傳輸過程的安全性,即由?HTTP?加上?TLS/SSL?協(xié)議構(gòu)建的可進行加密傳輸、身份認證的網(wǎng)絡(luò)協(xié)議,主要通過數(shù)字證書、加密算法、非對稱密鑰等技術(shù)完成互聯(lián)網(wǎng)數(shù)據(jù)傳輸加密,實現(xiàn)互聯(lián)網(wǎng)傳輸安全保護。
https的SSL/TLS?系列中有五種協(xié)議:SSL v2,SSL v3,TLS v1.0,TLS v1.1和TLS v1.2。其中只有?TLS v1.2?提供了現(xiàn)代的加密算法,而SSL 2.0和/或SSL 3.0加密存在加密漏洞具有CBC密碼的不安全填充方案、不安全的會話重新協(xié)商和恢復(fù)方案,攻擊者可以利用這些漏洞進行中間人攻擊或解密受影響的服務(wù)與客戶端之間的通信。
盡管SSL / TLS具有選擇協(xié)議最高支持版本的安全方法(因此只有在客戶端或服務(wù)器沒有更好支持的情況下才使用這些版本),但是許多Web瀏覽器均以不安全的方式實施此操作,從而使攻擊者能夠降級連接(例如在POODLE攻擊中)。因此,建議完全禁用這些協(xié)議并僅啟用TLS v1.2協(xié)議。
但是其中要注意一點TLS默認會使用RC4算法,且默認情況下RC4?對于所有應(yīng)用都是開啟的。簡單介紹下RC4(又名ARC4?或者ARCFOUR?)是應(yīng)用最廣泛的流加密算法,應(yīng)用在安全套接字層(SSL)(用來保護網(wǎng)絡(luò)上傳輸?shù)臄?shù)據(jù))和WEP(無線網(wǎng)絡(luò)數(shù)據(jù)保護)上。但是我們想,如果用RC4來進行網(wǎng)絡(luò)數(shù)據(jù)傳輸?shù)募用芎徒饷埽蛻舳撕头?wù)器端要公用一個密鑰,如果黑客在使用客戶端,它就可以獲取客戶端的密鑰,那么就可以通過獲取網(wǎng)絡(luò)數(shù)據(jù)流通過密鑰解密出相關(guān)信息。所以,在啟用TLS v1.2的同時也禁用?RC4等低階對稱式的加密算法,啟用3DES、AES128和AES256高階對稱加密算法或者RSA證書文件等非對稱加密方式;
?
解決方案:
掃描建議也給出了方案,即關(guān)閉SSLv3及以下版本協(xié)議啟用TLS1.1及以上協(xié)議。分析了漏洞產(chǎn)生的原因,那么要定位哪些地方會用到https,網(wǎng)站的轉(zhuǎn)發(fā)和部署主要有IIS、apache或者nginx等轉(zhuǎn)發(fā)組件,故這里主要整理了這三個工具的修復(fù)方案:
IIS是微軟自身的工具,可以直接通過禁用注冊表方式處理,通過加固方式解決,已整理了附件加固腳本(參考下文附錄);
Apache增加配置禁用協(xié)議:修改配置文件/etc/apache2/mods-availabl/ssl.conf把全部SSLProtocol開頭的改成如下:?SSLProtocolall -SSLv2 -SSLv3
Nginx配置增加協(xié)議說明:ssl on; ssl_certificate server.cer;ssl_certificate_key server.key; ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
網(wǎng)上有些朋友說通過修改注冊表加固了但是復(fù)掃漏洞還存在是因為可能使用到了其他網(wǎng)絡(luò)發(fā)布服務(wù),比如這里的apache、nginx,以及weblogic等,只要找到對應(yīng)的配置就可以針對性的修復(fù)了,以上已親測驗證可行。
總結(jié):
系統(tǒng)的漏洞是層出不窮,但是是不是每一個高危漏洞是否值得修復(fù),還是需要好好斟酌的,有些會涉及到組件或者中間件的依賴可以通過防火墻或者網(wǎng)絡(luò)隔離等方式處理,有些在操作系統(tǒng)內(nèi)核的補丁,更新會有不明確的兼容性問題,所以在修復(fù)漏洞的過程中還是要全面評估產(chǎn)生的邏輯“病理”才好“對癥下藥”,但是藥吃多了也可能出現(xiàn)副作用,不是嗎?
文章來源:微信公眾號(思快奇)
參考閱讀:
CSDN:常見的幾種SSL/TLS漏洞及攻擊方式
百度百科:https、RC4算法
附錄:
IIS加固腳本(也可以使用IISCrypto工具處理)
WindowsRegistry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols]
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\Multi-ProtocolUnified Hello]
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\Multi-ProtocolUnified Hello\Server]
"Enabled"=dword:00000000
"DisabledByDefault"=dword:00000001
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\PCT1.0]
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\PCT1.0\Server]
"Enabled"=dword:00000000
"DisabledByDefault"=dword:00000001
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL2.0]
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL2.0\Client]
"Enabled"=dword:00000000
"DisabledByDefault"=dword:00000001
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL2.0\Server]
"Enabled"=dword:00000000
"DisabledByDefault"=dword:00000001
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL3.0]
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL3.0\Client]
"Enabled"=dword:00000000
"DisabledByDefault"=dword:00000001
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL3.0\Server]
"Enabled"=dword:00000000
"DisabledByDefault"=dword:00000001
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS1.0]
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS1.0\Client]
"Enabled"=dword:00000000
"DisabledByDefault"=dword:00000001
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS1.0\Server]
"Enabled"=dword:00000000
"DisabledByDefault"=dword:00000001
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS1.1]
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS1.1\Client]
"Enabled"=dword:00000000
"DisabledByDefault"=dword:00000001
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS1.1\Server]
"Enabled"=dword:00000000
"DisabledByDefault"=dword:00000001
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS1.2]
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS1.2\Server]
"Enabled"=dword:ffffffff
"DisabledByDefault"=dword:00000000
RC4算法禁用腳本
WindowsRegistry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers]
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers\AES128/128]
"Enabled"=dword:ffffffff
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers\AES256/256]
"Enabled"=dword:ffffffff
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers\DES56/56]
"Enabled"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers\NULL]
"Enabled"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers\RC2128/128]
"Enabled"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers\RC240/128]
"Enabled"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers\RC256/128]
"Enabled"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers\RC4128/128]
"Enabled"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers\RC440/128]
"Enabled"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers\RC456/128]
"Enabled"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers\RC464/128]
"Enabled"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers\TripleDES 168]
"Enabled"=dword:ffffffff