1、查看curl版本
目前该漏洞只影响libcurl 7.69.0 ~ 8.3.0版本,不受漏洞影响的版本:libcurl < 7.69.0 和 >= 8.4.0。
curl --version
2、下载curl命令最新版本
1.1、通过命令下载
wget https://curl.se/download/curl-8.4.0.tar.gz
1.2、通过网址下载
https://curl.se/snapshots/
3、Linux创建目录
自定义目录
mkdir -p /home/sys/
4、解压下载的curl-8.4.0.tar.gz包
# 进入目录
cd /home/sys/
# 解压
tar -xzvf curl-8.4.0.tar.gz
5、编译选项
# 进入目录
cd /home/sys/curl-8.4.0
# 执行编译选项
./configure --without-ssl
6、编译和安装
# 进入目录
cd /home/sys/curl-8.4.0
# 编译和安装
make & make install
7、查看curl版本
curl --version
8、错误整合
1.1、执行./configure --without-ssl命令出现报错
1.1.1、查看是否存在openssl
rpm -qa | grep openssl
1.1.2、安装openssl
# 进入目录
cd /home/sys
# 下载安装包
wget https://www.openssl.org/source/openssl-1.1.1g.tar.gz
# 解压
tar -xzvf openssl-1.1.1g.tar.gz
# 进入目录
cd openssl-1.1.1g/
# 编译选项
./config
# 编译安装
make & make install
1.2、执行make & make install命令出现错误
报错信息
../lib/.libs/libcurl.so: undefined reference to `SSLv2_client_method'
../lib/.libs/libcurl.so: undefined reference to `SSL_CTX_set_alpn_protos'
../lib/.libs/libcurl.so: undefined reference to `SSL_get0_alpn_selected'
collect2: error: ld returned 1 exit status
make[2]: *** [curl] Error 1
make[2]: Leaving directory `/root/curl-7.45.0/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/root/curl-7.45.0/src'
make: *** [all-recursive] Error 1
1.1.1、如果出现错误都需要进行清理并重新编译
# 进入目录
cd /home/sys/curl-8.4.0
# 执行编译选项
make clean
# 执行编译选项
./configure --without-ssl
# 编译和安装
make & make install