bash环境变量存在任意代码执行漏洞:“通过CGI请求方式可以导致远程代码执行,进而导致服务器被***,危害严重,且官方公布补丁也被绕过”

【漏洞影响】:

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

2)***方式:结合CGI方式可以导致远程代码执行,***服务器;

了解系统当前bash的版本

[root@p_w_picpath01 ~]# /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.