Centos7修复OpenSSL 安全漏洞 (CVE-2022-0778)

前言:

centos7环境下OpenSSL拒绝服务漏洞(CVE-2022-0778)
漏洞影响范围:

  • OpenSSL1.0.2
  • OpenSSL1.1.1
  • OpenSSL3.0
    OpenSSL拒绝服务漏洞(CVE-2022-0778):该漏洞是由于OpenSSL中的BN_mod_sqrt()函数存在解析错误,由于证书解析发生在证书签名验证之前,因此任何解析外部提供的证书场景都可能受到拒绝服务攻击,攻击者可在未授权的情况下通过构造特定证书来触发无限循环,执行拒绝服务攻击,最终使服务器无法提供服务。

修复步骤:

openssl官网

https://www.openssl.org/source/
在这里插入图片描述
查看系统版本、内核及openssl版本如下

[root@sdd ~]# cat /etc/redhat-release 
CentOS Linux release 7.8.2003 (Core)
You have new mail in /var/spool/mail/root
[root@sdd ~]# uname -a
Linux sdd 3.10.0-1127.el7.x86_64 #1 SMP Tue Mar 31 23:36:51 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
[root@sdd ~]# openssl version
OpenSSL 1.0.2k-fips  26 Jan 2017
[root@sdd ~]# 

按照官网提示我们的openssl版本为OpenSSL 1.0.2k-fips,需要下载升级到最新的3.0.8版本;
在这里插入图片描述
下载最新版本3.0.8

下载软件上传到要升级的服务器
上传并解压
[root@idss ~]# tar zvxf openssl-3.0.8.tar.gz
[root@idss ~]# cd openssl-3.0.5

在这里插入图片描述
查看安装文档INSTALL.md
在这里插入图片描述

编译安装

1.先建配置文件夹

[root@idss openssl-3.0.8]# mkdir -p /usr/local/openssl

2.配置安装
./config --prefix=/usr/local/openssl
提示如下

[root@idss openssl-3.0.8]# ./config --prefix=/usr/local/openssl
/usr/bin/env: perl: No such file or directory
检查perl

安装perl-ExtUtils-CBuilder perl-ExtUtils-
MakeMaker,先下载需要安装的依赖包,然后使用rpm强制完成perl的安装,此方式可以离线拷贝文件到内网机器,进行perl安装

[root@idss ~]# mkdir -p myperl
[root@idss ~]# yum install --downloadonly --downloaddir=/root/myperl  perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker
[root@idss ~]# cd myperl
[root@idss myperl]# rpm -ivh *.rpm --force --nodeps

检查perl安装成功如下

[root@idss myperl]# perl -v

This is perl 5, version 16, subversion 3 (v5.16.3) built for x86_64-linux-thread-multi
(with 44 registered patches, see perl -V for more detail)

Copyright 1987-2012, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.
检查gcc
[root@idss ~]# mkdir -p mygcc
[root@sdd ~]# yum install --downloadonly --downloaddir=/root/mygcc  gcc
[root@sdd ~]# cd /root/mygcc
[root@sdd mygcc]# rpm -ivh *.rpm --force --nodeps

检查gcc安装成功如下

[root@idss mygcc]# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) 
再次编译安装
[root@idss ~]# cd openssl-3.0.8
[root@idss openssl-3.0.8]# ./config --prefix=/usr/local/openssl/

显示如下,提示successfully就预编译成功了

[root@idss openssl-3.0.8]# ./config --prefix=/usr/local/openssl/
Configuring OpenSSL version 3.0.8 for target linux-x86_64
Using os-specific seed configuration
Created configdata.pm
Running configdata.pm
Created Makefile.in
Created Makefile
Created include/openssl/configuration.h

**********************************************************************
***                                                                ***
***   OpenSSL has been successfully configured                     ***
***                                                                ***
***   If you encounter a problem while building, please open an    ***
***   issue on GitHub <https://github.com/openssl/openssl/issues>  ***
***   and include the output from the following command:           ***
***                                                                ***
***       perl configdata.pm --dump                                ***
***                                                                ***
***   (If you are new to OpenSSL, you might want to consult the    ***
***   'Troubleshooting' section in the INSTALL.md file first)      ***
***                                                                ***
**********************************************************************

接下来进行make编译和安装,时间会长一些

make && make install

![make编译安装完成](https://img-
blog.csdnimg.cn/0144f3db00fa4be9a36095ba2bd5e173.png)

备份和配置软链接

mv /usr/bin/openssl /usr/bin/openssl.old
mv /usr/include/openssl /usr/include/openssl.old
ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl
ln -s /usr/local/openssl/include/openssl /usr/include/openssl
ln -s /usr/local/openssl/lib64/libssl.so.3 /usr/lib/libssl.so.3
ln -s /usr/local/openssl/lib64/libcrypto.so.3 /usr/lib/libcrypto.so.3
ldconfig
执行过程如下

[root@idss openssl-3.0.8]# mv /usr/bin/openssl /usr/bin/openssl.old
[root@idss openssl-3.0.8]# mv /usr/include/openssl /usr/include/openssl.old
mv: cannot stat ‘/usr/include/openssl’: No such file or directory
[root@idss openssl-3.0.8]# ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl
[root@idss openssl-3.0.8]# ln -s /usr/local/openssl/include/openssl /usr/include/openssl
[root@idss openssl-3.0.8]# ln -s /usr/local/openssl/lib64/libssl.so.3 /usr/lib/libssl.so.3
[root@idss openssl-3.0.8]# ln -s /usr/local/openssl/lib64/libcrypto.so.3 /usr/lib/libcrypto.so.3
[root@idss openssl-3.0.8]# ldconfig
[root@idss openssl-3.0.8]# 
检查安装后的openssl版本
[root@idss openssl-3.0.8]# openssl version
OpenSSL 3.0.8 7 Feb 2023 (Library: OpenSSL 3.0.8 7 Feb 2023)

附件
perl安装包(我的主页下载,审核中,后续附上安装包连接)
gcc安装包(我的主页下载,审核中,后续附上安装包连接)

学习网络安全技术的方法无非三种:

第一种是报网络安全专业,现在叫网络空间安全专业,主要专业课程:程序设计、计算机组成原理原理、数据结构、操作系统原理、数据库系统、 计算机网络、人工智能、自然语言处理、社会计算、网络安全法律法规、网络安全、内容安全、数字取证、机器学习,多媒体技术,信息检索、舆情分析等。

第二种是自学,就是在网上找资源、找教程,或者是想办法认识一-些大佬,抱紧大腿,不过这种方法很耗时间,而且学习没有规划,可能很长一段时间感觉自己没有进步,容易劝退。

如果你对网络安全入门感兴趣,那么你需要的话可以点击这里👉网络安全重磅福利:入门&进阶全套282G学习资源包免费分享!

第三种就是去找培训。

image.png

接下来,我会教你零基础入门快速入门上手网络安全。

网络安全入门到底是先学编程还是先学计算机基础?这是一个争议比较大的问题,有的人会建议先学编程,而有的人会建议先学计算机基础,其实这都是要学的。而且这些对学习网络安全来说非常重要。但是对于完全零基础的人来说又或者急于转行的人来说,学习编程或者计算机基础对他们来说都有一定的难度,并且花费时间太长。

第一阶段:基础准备 4周~6周

这个阶段是所有准备进入安全行业必学的部分,俗话说:基础不劳,地动山摇
image.png

第二阶段:web渗透

学习基础 时间:1周 ~ 2周:

① 了解基本概念:(SQL注入、XSS、上传、CSRF、一句话木马、等)为之后的WEB渗透测试打下基础。
② 查看一些论坛的一些Web渗透,学一学案例的思路,每一个站点都不一样,所以思路是主要的。
③ 学会提问的艺术,如果遇到不懂得要善于提问。
image.png

配置渗透环境 时间:3周 ~ 4周:

① 了解渗透测试常用的工具,例如(AWVS、SQLMAP、NMAP、BURP、中国菜刀等)。
② 下载这些工具无后门版本并且安装到计算机上。
③ 了解这些工具的使用场景,懂得基本的使用,推荐在Google上查找。

渗透实战操作 时间:约6周:

① 在网上搜索渗透实战案例,深入了解SQL注入、文件上传、解析漏洞等在实战中的使用。
② 自己搭建漏洞环境测试,推荐DWVA,SQLi-labs,Upload-labs,bWAPP。
③ 懂得渗透测试的阶段,每一个阶段需要做那些动作:例如PTES渗透测试执行标准。
④ 深入研究手工SQL注入,寻找绕过waf的方法,制作自己的脚本。
⑤ 研究文件上传的原理,如何进行截断、双重后缀欺骗(IIS、PHP)、解析漏洞利用(IIS、Nignix、Apache)等,参照:上传攻击框架。
⑥ 了解XSS形成原理和种类,在DWVA中进行实践,使用一个含有XSS漏洞的cms,安装安全狗等进行测试。
⑦ 了解一句话木马,并尝试编写过狗一句话。
⑧ 研究在Windows和Linux下的提升权限,Google关键词:提权
image.png
以上就是入门阶段

第三阶段:进阶

已经入门并且找到工作之后又该怎么进阶?详情看下图
image.png

给新手小白的入门建议:
新手入门学习最好还是从视频入手进行学习,视频的浅显易懂相比起晦涩的文字而言更容易吸收,这里我给大家准备了一套网络安全从入门到精通的视频学习资料包免费领取哦!

如果你对网络安全入门感兴趣,那么你需要的话可以点击这里👉网络安全重磅福利:入门&进阶全套282G学习资源包免费分享!

  • 20
    点赞
  • 29
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值