提示:文章寫完后,目錄可以自動生成,如何生成可參考右邊的幫助文檔
前言
漏掃發(fā)現機器上的nginx使用的openssl版本有點低,在加上nginx的部署時間較早,還是1.20.2版本的,一起進行升級。
一、漏洞內容
SSL/TLS協(xié)議信息泄露漏洞(CVE-2016-2183)【原理掃描】
nginx 緩沖區(qū)錯誤漏洞(CVE-2022-41741)
nginx 越界寫入漏洞(CVE-2022-41742)
二、現狀
openssl版本:1.0.2k
nginx版本:1.20.2
三、centos7安裝openssl11
yum install -y epel-release
yum install -y openssl11 openssl11-devel
ln -sf /usr/lib64/pkgconfig/openssl11.pc /usr/lib64/pkgconfig/openssl.pc
mv /usr/bin/openssl /usr/bin/openssl.bak
ln -s /usr/bin/openssl11 /usr/bin/openssl
openssl version
四、升級nginx到1.24.0
1. 下載nginx
mkdir -p /root/nginx/
cd /root/nginx/
wget -c https://nginx.org/download/nginx-1.24.0.tar.gz
tar -xvf nginx-1.24.0.tar.gz
cd /root/nginx/nginx-1.24.0/
2. 編譯安裝nginx
#使用命令:安裝ssl模塊
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
#編譯
make
#備份已有nginx
mv /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.1.20.2
#編譯安裝
make install
3. 配置nginx.service
/usr/lib/systemd/system/nginx.service文章來源:http://www.zghlxwxcb.cn/news/detail-720757.html
[Unit]
Description=nginx
After=network.target
[Service]
Type=forking
ExecStart=/usr/local/nginx/sbin/nginx
ExecReload=/usr/local/nginx/sbin/nginx -s reload
ExecStop=/usr/local/nginx/sbin/nginx -s quit
PrivateTmp=true
[Install]
WantedBy=multi-user.target
4. 重啟nginx
systemctl restart nginx.service
systemctl status nginx.service
總結
我這里openssl用到的是yum安裝的,也可以使用編譯安裝的方式。文章來源地址http://www.zghlxwxcb.cn/news/detail-720757.html
到了這里,關于nginx相關漏洞處理:CVE-2016-2183、CVE-2022-41741、CVE-2022-41742的文章就介紹完了。如果您還想了解更多內容,請在右上角搜索TOY模板網以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網!