Linux内置Bash中发现一个非常严重安全漏洞附测试代码和修复方法
时间:2015-09-20 23:29 来源:linux.it.net.cn 作者:IT
Linux内置Bash中发现一个非常严重安全漏洞。Bash 是用于控制 Linux 计算机命令提示符的软件。网络安全专家表示,黑客可以利用 Bash 中的一个安全漏洞,对目标计算机系统进行完全控制。
Linux内置Bash中发现一个非常严重安全漏洞的附测试代码和修复方法
你可以使用如下命令来检查系统存在此漏洞:
env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
受影响的系统包括:
-
CentOS
-
Debian
-
Redhat
-
Ubuntu
红帽系可通过更新 bash 并重启系统来解决这个问题:
# yum update bash
或者:
# yum update bash-4.1.2-15.el6_5.1
此举只是更新了 bash 包,还需要重启系统才能生效。
Ubuntu 用户可以通过如下命令打补丁,无需重启:
apt-get update
apt-get install bash
运行以后再运行上边的代码会提示:
bash: warning: x: ignoring function definition attemptbash:
error importing function definition for `x'hello
这个时候漏洞就修复好啦。
漏洞影响
漏洞影响Redhat、CentOS、Debian、Ubuntu等Linux发行版,影响的程序包括使用mod_cgi执行的Apache服务器,rsync及git服务器,调用如下函数的程序system/popen in C, by os.system/os.popen in Python, system/exec in PHP等。
【阿里云的建议修补方案,供给参考 】
请您根据Linux版本选择您需要修复的命令, 为了防止意外情况发生,建议您执行命令前先对Linux服务器系统盘打个快照,如果万一出现升级影响您服务器使用情况,可以通过回滚系统盘快照解决。
centos:
yum -y update bash
ubuntu:
14.04 64bit
wget http://mirrors.aliyun.com/fix_stuff/bash_4.3-7ubuntu1.1_amd64.deb && dpkg -i bash_4.3-7ubuntu1.1_amd64.deb
14.04 32bit
wget http://mirrors.aliyun.com/fix_stuff/bash_4.3-7ubuntu1.1_i386.deb && dpkg -i bash_4.3-7ubuntu1.1_i386.deb
12.04 64bit
wget http://mirrors.aliyun.com/fix_stuff/bash_4.2-2ubuntu2.2_amd64.deb && dpkg -i bash_4.2-2ubuntu2.2_amd64.deb
12.04 32bit
wget http://mirrors.aliyun.com/fix_stuff/bash_4.2-2ubuntu2.2_i386.deb && dpkg -i bash_4.2-2ubuntu2.2_i386.deb
10.10 64bit
wget http://mirrors.aliyun.com/fix_stuff/bash_4.1-2ubuntu3.1_amd64.deb && dpkg -i bash_4.1-2ubuntu3.1_amd64.deb
10.10 32bit
wget http://mirrors.aliyun.com/fix_stuff/bash_4.1-2ubuntu3.1_i386.deb && dpkg -i bash_4.1-2ubuntu3.1_i386.deb
debian:
7.5 64bit && 32bit
apt-get -y install --only-upgrade bash
6.0.x 64bit
wget http://mirrors.aliyun.com/debian/pool/main/b/bash/bash_4.1-3%2bdeb6u1_amd64.deb && dpkg -i bash_4.1-3+deb6u1_amd64.deb
6.0.x 32bit
wget http://mirrors.aliyun.com/debian/pool/main/b/bash/bash_4.1-3%2bdeb6u1_i386.deb&& dpkg -i bash_4.1-3+deb6u1_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
(责任编辑:IT)
Linux内置Bash中发现一个非常严重安全漏洞。Bash 是用于控制 Linux 计算机命令提示符的软件。网络安全专家表示,黑客可以利用 Bash 中的一个安全漏洞,对目标计算机系统进行完全控制。 Linux内置Bash中发现一个非常严重安全漏洞的附测试代码和修复方法 你可以使用如下命令来检查系统存在此漏洞: env x='() { :;}; echo vulnerable' bash -c "echo this is a test" 受影响的系统包括:
红帽系可通过更新 bash 并重启系统来解决这个问题: # yum update bash 或者: # yum update bash-4.1.2-15.el6_5.1 此举只是更新了 bash 包,还需要重启系统才能生效。 Ubuntu 用户可以通过如下命令打补丁,无需重启: apt-get update apt-get install bash 运行以后再运行上边的代码会提示:
bash: warning: x: ignoring function definition attemptbash: error importing function definition for `x'hello
这个时候漏洞就修复好啦。
漏洞影响
【阿里云的建议修补方案,供给参考 】 |