Shell升级,/bin/bash版本号4.1到4.3

bash环境变量存在随意代码运行漏洞:“通过CGI请求方式能够导致远程代码运行,进而导致server被入侵。危害严重且官方发布补丁也被绕过”

【漏洞影响】:

1)bash受影响版本号:3.0 ~ 4.3,小于3.0的bash版本号也可能受影响。

2)入侵方式:结合CGI方式能够导致远程代码运行,入侵server。


了解系统当前bash的版本号

[root@image01 ~]# /bin/bash -version
GNU bash, version 4.1.2(1)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

bash下载地址:http://ftp.gnu.org/gnu/bash/

安装升级bash

wget http://ftp.gnu.org/gnu/bash/bash-4.3.tar.gz
tar zxvf bash-4.3.tar.gz
cd bash-4.3
./configure
make
make install

由于bash默认是安装在/usr/local/bin/文件夹下,所以须要创建一个链接到 /bin/文件夹下,安装完成后须要重新启动生效!

mv /bin/bash /bin/bash.bak; ln -s /usr/local/bin/bash /bin/bash
[root@mail ~]# /bin/bash -version
GNU bash, version 4.3.0(1)-release (x86_64-unknown-linux-gnu)
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Linux Bash严重漏洞修复紧急通知(2014年9月25日更新)

日前Linux官方内置Bash中新发现一个很严重安全漏洞。黑客能够利用该Bash漏洞全然控制目标系统并发起攻击,为了避免您Linuxserver受影响。建议您尽快完毕漏洞修补。修复方法例如以下:

漏洞检測方法

能够使用例如以下命令来检查系统存在此漏洞:

env -i  X='() { (a)=>\' bash -c 'echo date'; cat echo
修复前输出:当前系统时间

使用修补方案修复后

date

特别提示:该修复不会有不论什么影响,假设您的脚本使用以上方式定义环境变量,修复后您的脚本运行会报错。

输出结果中包括date字符串就修复成功了。

修补方案

centos:

yum clean all
yum makecache
yum -y update bash

ubuntu:

apt-cache gencaches
apt-get -y install --only-upgrade bash

debian 7.5 64bit && 32bit :

apt-cache gencaches
apt-get -y install --only-upgrade bash

debian 6.0.x 64bit

wget http://mirrors.aliyun.com/debian/pool/main/b/bash/bash_4.1-3+deb6u2_amd64.deb &&  dpkg -i bash_4.1-3+deb6u2_amd64.deb

debian 6.0.x 32bit

wget http://mirrors.aliyun.com/debian/pool/main/b/bash/bash_4.1-3+deb6u2_i386.deb &&  dpkg -i bash_4.1-3+deb6u2_i386.deb

opensuse:

13.1 64bit 
wget http://mirrors.aliyun.com/fix_stuff/bash-4.2-68.4.1.x86_64.rpm && rpm -Uvh bash-4.2-68.4.1.x86_64.rpm 

13.1 32bit 
wget http://mirrors.aliyun.com/fix_stuff/bash-4.2-68.4.1.i586.rpm && rpm -Uvh bash-4.2-68.4.1.i586.rpm 

aliyun linux:

5.x 64bit 
wget http://mirrors.aliyun.com/centos/5/updates/x86_64/RPMS/bash-3.2-33.el5.1.x86_64.rpm && rpm -Uvh bash-3.2-33.el5.1.x86_64.rpm

5.x 32bit 
wget http://mirrors.aliyun.com/centos/5/updates/i386/RPMS/bash-3.2-33.el5.1.i386.rpm && rpm -Uvh bash-3.2-33.el5.1.i386.rpm

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值