nux Bash曾出现过重大安全漏洞,如CVE-2014-6271等,以下是关于该漏洞的详细介绍、检测方法以及不同Linux系统下的修复方式:
漏洞详情
-
漏洞描述:该漏洞源于调用bash shell之前创建的特殊环境变量,这些变量可以包含代码,同时会被bash执行。
-
影响范围:所有安装GNU bash版本小于或者等于4.3的Linux操作系统。
-
风险程度:黑客可以利用该漏洞完全控制目标系统并发起攻击,对电脑用户构成的威胁较大。
漏洞检测方法
在命令行输入以下代码,若执行结果符合特定情况,则说明存在该漏洞:
-
检测命令:
env x='() { :;}; echo vulnerable' bash -c echo this is a test
-
存在漏洞的执行结果:
vulnerable
this is a test
-
已修复漏洞的执行结果:
bash: warning: x: ignoring function definition attempt
bash: error importing function definition for 'x'
this is a test
不同Linux系统的修复方法
Linux系统 | 修复命令 |
---|---|
CentOS | yum clean all yum makecache 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 |
Ubuntu 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 |
Ubuntu 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 |
Ubuntu 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 |
Ubuntu 10.x 64bit | wget http://mirrors.aliyun.com/fix_stuff/bash_4.1-2ubuntu3.1_amd64.deb dpkg -i bash_4.1-2ubuntu3.1_amd64.deb |
Ubuntu 10.x 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 |
Debian 6.0.x 64bit | wget http://mirrors.aliyun.com/debian/pool/main/b/bash/bash_4.1-3+deb6u1_amd64.deb dpkg -i bash_4.1-3+deb6u1_amd64.deb |
Debian 6.0.x 32bit | wget http://mirrors.aliyun.com/debian/pool/main/b/bash/bash_4.1-3+deb6u1_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 |
OpenSUSE 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 |
Aliyun Linux 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 |
相关问答FAQs
-
问题1:修复Bash漏洞后,原来的脚本还能正常运行吗?
- 解答:一般情况下,修复该漏洞不会对大多数正常脚本的运行产生影响,但如果您的脚本使用了特定的环境变量定义方式,可能会在修复后出现报错的情况,不过这种影响相对较小,而且为了保证系统安全,修复漏洞是必要的,建议在执行修复命令前,先对重要的脚本和数据进行备份,以防万一。
-
问题2:如何确认Bash漏洞是否真正修复成功?
- 解答:在执行完相应的修复命令后,再次使用漏洞检测命令
env x='() { :;}; echo vulnerable' bash -c echo this is a test
进行检测,如果显示结果为:bash: warning: x: ignoring function definition attempt
bash: error importing function definition for 'x'
this is a test
- 则说明漏洞已经成功修复,如果仍然显示
vulnerable
和this is a test
,则需要检查修复过程是否正确,或者是否存在其他
- 解答:在执行完相应的修复命令后,再次使用漏洞检测命令
原创文章,发布者:酷盾叔,转转请注明出处:https://www.kd.cn/ask/54737.html