漏洞升级报告
1.openssh升级(生产测试过)
- 安装telnet(以防升级失败,连不上服务器,建议弄)
| |
| cat /etc/redhat-release |
| sshd -v |
| |
| |
| rpm -qa | grep telnet |
| rpm -qa | grep xinetd |
| |
| |
| yum -y install telnet* |
| yum -y install xinetd |
| |
| |
| systemctl enable xinetd.service |
| systemctl enable telnet.socket |
| |
| |
| systemctl start telnet.socket |
| systemctl start xinetd |
| |
| |
| systemctl status telnet.socket |
| systemctl status xinetd |
| |
| |
| echo 'pts/0' >> /etc/securetty |
| echo 'pts/1' >> /etc/securetty |
| |
| systemctl restart xinetd |
| |
| ss -plnt |grep 23 |
| |
| |
| ll /etc/xinetd.d/telnet |
| |
| 用telnet连接是否可以登录是需要输入账号密码的 |
| [C:\~]$ telnet 192.168.20.66:23 |
| |
| |
| vim /etc/pam.d/remote |
| |
| |
| auth substack password-auth |
| auth include postlogin |
| account required pam_nologin.so |
| account include password-auth |
| password include password-auth |
| |
| session required pam_selinux.so close |
| session required pam_loginuid.so |
| |
| session required pam_selinux.so open |
| session required pam_namespace.so |
| session optional pam_keyinit.so force revoke |
| session include password-auth |
| session include postlogin |
| |
| |
| systemctl stop firewalld |
| systemctl disable firewalld |
| setenforce 0 |
| sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config |
- 升级openssh 窗口别关 先上传安装包 ftp上传安装包
| |
| yum -y install gcc pam-devel zlib-devel openssl-devel |
| |
| tar xf packages.tar.gz |
| rpm -ivh *.rpm --replacefiles |
| rpm -ivh *.rpm --nodeps --force |
- 先停止服务 否则升级后ssh连不上,重启sshd服务都没用,只能退回旧版重来!!!
| |
| ln -s /usr/libexec/gcc/x86_64-redhat-linux/4.8.5/cc1 /usr/local/bin/ccl |
| |
| |
| export LD_LIBRARY_PATH="/usr/lib64/" |
| |
| wget https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-8.8p1.tar.gz |
| tar xf openssh-8.8p1.tar.gz |
| |
| chown -R root.root ./openssh-8.8p1 |
| cd openssh-8.8p1/ |
| |
| ./configure --prefix=/usr --sysconfdir=/etc/ssh --with-zlib --with-md5-passwords --with-pam |
| |
| echo $? |
- 成功截图

| |
| make && make install |
| |
| echo $? |
| |
| cp -a contrib/redhat/sshd.init /etc/init.d/sshd |
| |
| chmod +x /etc/init.d/sshd |
| |
| echo "PermitRootLogin yes" >> /etc/ssh/sshd_config |
| echo "UseDNS no" >> /etc/ssh/sshd_config |
| echo "UsePAM yes" >> /etc/ssh/sshd_config |
| echo "PasswordAuthentication yes" >> /etc/ssh/sshd_config |
| |
| mv /usr/lib/systemd/system/sshd.service /root/ |
| |
| chkconfig --add sshd |
| |
| chkconfig sshd on |
| systemctl enable sshd |
| |
| /etc/init.d/sshd restart |
| 两种方式都可以 |
| service sshd restart |
| |
| |
| sshd -v |
| ss -lntup | grep 22 |

| systemctl disable xinetd.service |
| systemctl stop xinetd.service |
| systemctl disable telnet.socket |
| systemctl stop telnet.socket |
| ss -lntp | grep 23 |
- 如何你升级是内网环境的openssh请用下面命令把上面所需要的依赖全部下载下来
| yum -y install yum-util |
| |
| yumdownloader --resolve --destdir=/root/gcc gcc |
| |
| tar xf telnet.tar.gz |
| tar xf xinetd.tar.gz |
| tar xf gcc.tar.gz |
| tar xf pam-devel.tar.gz |
| tar xf zlib-devel.tar.gz |
| tar xf openssl-devel.tar.gz |
| tar xf gcc-c++.tar.gz |
| tar xf ccl.tar.gz |
2.20007 - SSL Version 2 and 3 Protocol Detection
远程服务使用具有已知弱点的协议加密流量
禁用 SSL 2.0 和 3.0请改用 TLS 1.2(带有批准的密码套件)或更高版本
| |
| yum install -y mod_ssl |
| |
| |
| SSLProtocol all -SSLv2 -SSLv3 |
| SSLHonorCipherOrder on |
| SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:+HIGH:+MEDIUM:-LOW:!RC4:!NULL |
| |
| |
| LoadModule ssl_module modules/mod_ssl.so |
按照这个图配置

3.170113 - Apache 2.4.x < 2.4.55 多个漏洞
| 远程主机上安装的 Apache httpd 版本低于 2.4.55。因此,它受到 2.4.55 公告中提及的多个漏洞的影响。 |
| 升级到 Apache 版本 2.4.55 或更高版本 |
| |
| cp -rf /etc/httpd/ /home/centos/httpd-20230131 |
| |
| cp -rf /var/www/html/ /home/centos/html-20230131 |
| |
| |
| httpd -v |
| |
| |
| [root@apache /etc/yum.repos.d] |
| |
| Installed Packages |
| Name : httpd |
| Arch : x86_64 |
| Version : 2.4.6 |
| Release : 98.el7.centos.6 |
| Size : 9.4 M |
| Repo : installed |
| From repo : updates |
| Summary : Apache HTTP Server |
| URL : http://httpd.apache.org/ |
| License : ASL 2.0 |
| Description : The Apache HTTP Server is a powerful, efficient, and extensible |
| : web server. |
| |
| |
| yum install yum-changelog |
| yum changelog httpd |
| |
| |
| |
| |
| yum install -y epel-release |
| |
| |
| cd /etc/yum.repos.d && wget https://repo.codeit.guru/codeit.el`rpm -q --qf "%{VERSION}" $(rpm -q --whatprovides redhat-release)`.repo |
| |
| |
| [root@apache /etc/yum.repos.d] |
| |
| |
| Installed Packages |
| Name : httpd |
| Arch : x86_64 |
| Version : 2.4.6 |
| Release : 98.el7.centos.6 |
| Size : 9.4 M |
| Repo : installed |
| From repo : updates |
| Summary : Apache HTTP Server |
| URL : http://httpd.apache.org/ |
| License : ASL 2.0 |
| Description : The Apache HTTP Server is a powerful, efficient, and extensible |
| : web server. |
| |
| |
| Available Packages |
| Name : httpd |
| Arch : x86_64 |
| Version : 2.4.55 |
| Release : 1.codeit.el7 |
| Size : 1.4 M |
| Repo : CodeIT/x86_64 |
| Summary : Apache HTTP Server |
| URL : https://httpd.apache.org/ |
| License : ASL 2.0 |
| Description : The Apache HTTP Server is a powerful, efficient, and extensible |
| : web server. |
| |
| |
| yum install httpd -y |
| |
| |
| systemctl restart httpd |
| |
| |
| httpd -v |
| |
| |
| ps -ef | grep httpd |
| |
| |
| ping www.sinnet-cloud.cn |
4.166901 - PHP 7.4.x < 7.4.33 多个漏洞
| 远程主机上安装的 PHP 版本低于 7.4.33。因此,它受到 V7.4.33 公告中提及的多个漏洞的影响。 |
| yum -y install epel-release |
| |
| yum -y install https://rpms.remirepo.net/enterprise/remi-release-7.rpm |
| |
| yum -y install yum-utils |
| |
| |
| yum-config-manager --enable remi-php74 |
| |
| |
| yum install -y php php-cli php-fpm php-mysqlnd php-zip php-devel php-gd php-mcrypt php-mbstring php-curl php-xml php-pear php-bcmath php-json php-redis |
| |
| systemctl start php-fpm |
| |
| |
| yum remove php php-cli php-fpm php-mysqlnd php-zip php-devel php-gd php-mcrypt php-mbstring php-curl php-xml php-pear php-bcmath php-json php-redis |
| |
| yum remove php-common |