關於SSL/TLS協議信息泄露漏洞(CVE-2016- 2183)解決方案


詳細描述:

TLS是安全傳輸層協議,用於在兩個通信應用程序之間提供保密性和數據完整性。 TLS, SSH, IPSec協商 及其他產品中使用的DES及Triple DES密碼存在大約四十億塊的 生日界,這可使遠程攻擊者通過 Sweet32攻擊,獲取純文本數據。 <*來源:Karthik Bhargavan Gaetan Leurent 鏈接:https://www.o penssl.org/news/secadv/20160922.txt *>

解決辦法:

建議:避免使用DES算法 1、OpenSSL Security Advisory [22 Sep 2016] 鏈接:https://www.openssl.o rg/news/secadv/20160922.txt 請在下列網頁下載最新版本: https://www.openssl.org/source/ 2、對 於nginx、apache、lighttpd等服務器禁止使用DES加密算法 主要是修改conf文件 3、Windows系統可 以參考如下鏈接: https://social.technet.microsoft.com/Forums/en-US/31b3ba6f-d0e6-417a-b6f 1- d0103f054f8d/ssl-medium-strength-cipher-suites-supported-sweet32cve20 162183? forum=ws2016

實際操作:

根據官網要求升級對應大版本到指定的分支,按照要求准備升級到最新版本openssl

步驟:

一、執行腳本文件進行下載對應版本openssl,代碼如下

#!/bin/sh
#下載安裝指定版本openssl
#以下是普通用戶腳本,一些操作需要root權限的sudo,root用戶可刪除
wget http://www.openssl.org/source/openssl-1.0.1u.tar.gz
sudo tar xzvf openssl-1.0.1u.tar.gz
cd openssl-1.0.1u
sudo ./config shared zlib
make && make install
sudo chmod 777 /usr/local/ssl
cd /usr/local/ssl/
sudo ./bin/openssl version -a
#替換舊版openssl
sudo mv /usr/bin/openssl /usr/bin/openssl.old2
sudo mv /usr/include/openssl /usr/include/openssl.old2
sudo ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl
sudo ln -s /usr/local/ssl/include/openssl/ /usr/include/openssl
#配置庫文件搜索路徑
#root的寫法 echo "/usr/local/ssl/lib" >> /etc/ld.so.conf
echo "/usr/local/ssl/lib" |sudo tee -a /etc/ld.so.conf
sudo ldconfig
二、重新編譯nginx,指定相應的新版本的openssl模塊
其次,重新配置模塊並重新編譯nginx文件,具體操作如下:
#測試新版是否正常
openssl version -a
#備注:如果你是普通用戶創建的軟鏈注意權限問題

  二、重新編譯nginx,指定相應的新版本的openssl模塊

nginx -V
----------------------------------------------------------------------------
nginx version: nginx/1.16.1
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-18) (GCC)
built with OpenSSL 1.0.1e 22 Sep 2013
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx --with-pcre=/ywj/src/pcre-8.35 --
with-http_ssl_module --with-http_realip_module --with-http_addition_module --
with-http_gzip_static_module --with-http_sub_module --with-http_dav_module --
with-http_flv_module --with-http_stub_status_module --without-http_charset_module
--with-http_v2_module
具體編譯模塊按照業務需求查看

  其次,重新配置模塊並重新編譯nginx文件,具體操作如下:

./configure --prefix=復制已有的模塊+ with-openssl=/ytxt/src/openssl-1.0.1u
#注意:這里新增模塊with-openssl指定新的nginx ssl模塊依賴的ssl庫,如果沒有這步最終的nginx的
ssl編譯版本是openssl-1.0.1u,而運行版本還是原來的openssl-1.0.1e
#編譯完成后,執行make,但不執行make install
make
#先備份
mv /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx20181113.old
#再復制最新額
cp ./objs/nginx /usr/local/nginx/sbin/nginx
#查看最新版本
nginx -V
----------------------------------------------------------------------------
nginx version: nginx/1.16.1
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-18) (GCC)
built with OpenSSL 1.0.1u 22 Sep 2016
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx --with-pcre=/ywj/src/pcre-8.35 --
with-http_ssl_module --with-http_realip_module --with-http_addition_module --
with-http_gzip_static_module --with-http_sub_module --with-http_dav_module --
with-http_flv_module --with-http_stub_status_module --without-http_charset_module
--with-http_v2_module --with-openssl=/ytxt/openssl-1.0.1u

總結

第一步、升級openssl升級到指定的修正版本,這個從測試其版本的角度修復這個問題(這步基本解決自 動掃描漏洞的問題)

第二步、ssl的指定算法需要排除DES、3DES這樣的算法,這個從算法匹配的角度解決這個問題


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM