CVE-2014-6271“破壳”漏洞

简介

CVE-2014-6271(即“破壳”漏洞)广泛存在与GNU Bash 版本小于等于4.3的*inux的系统之中,只要目标服务器开放着与Bash相交互的应用与服务,就有可能成功触发漏洞,获取目标系统当前Bash运行用户相同权限的shell接口。
该漏洞可以通过构造环境变量的值来执行想要执行的攻击代码脚本,会影响到与Bash交互的多种应用,包括HTTP、OpenSSH、DHCP等。

检测

有漏洞

[scutech@localhost ~]$ 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>
[scutech@localhost ~]$ env x='() { :;}; echo vulnerable' bash -c "echo This is a test"
vulnerable
This is a test

无漏洞

scutech@Yao:~$  bash --version
GNU bash, version 4.4.19(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2016 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.
scutech@Yao:~$  env x='() { :;}; echo vulnerable' bash -c "echo This is a test"
This is a test

解决办法

查看目前包信息:

[root@localhost ~]# yum list updates|grep bash
bash.x86_64                            4.1.2-48.el6                      base   
[root@localhost ~]# yum info bash.x86_64
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * base: mirrors.ustc.edu.cn
 * extras: mirrors.tuna.tsinghua.edu.cn
 * updates: mirrors.163.com
Installed Packages
Name        : bash
Arch        : x86_64
Version     : 4.1.2
Release     : 15.el6_4
Size        : 3.0 M
Repo        : installed
From repo   : anaconda-CentOS-201311272149.x86_64
Summary     : The GNU Bourne Again shell
URL         : http://www.gnu.org/software/bash
License     : GPLv3+
Description : The GNU Bourne Again shell (Bash) is a shell or command language
            : interpreter that is compatible with the Bourne shell (sh). Bash
            : incorporates useful features from the Korn shell (ksh) and the C shell
            : (csh). Most sh scripts can be run by bash without modification.

Available Packages
Name        : bash
Arch        : x86_64
Version     : 4.1.2
Release     : 48.el6
Size        : 910 k
Repo        : base
Summary     : The GNU Bourne Again shell
URL         : http://www.gnu.org/software/bash
License     : GPLv3+
Description : The GNU Bourne Again shell (Bash) is a shell or command language
            : interpreter that is compatible with the Bourne shell (sh). Bash
            : incorporates useful features from the Korn shell (ksh) and the C shell
            : (csh). Most sh scripts can be run by bash without modification.

可以看到在最新的release是48,当前安装的是15。我们将包下载到本地后升级。

# yumdownloader !$
yumdownloader bash.x86_64
Loaded plugins: fastestmirror, refresh-packagekit
Loading mirror speeds from cached hostfile
 * base: mirrors.ustc.edu.cn
 * extras: mirrors.tuna.tsinghua.edu.cn
 * updates: mirrors.163.com
bash-4.1.2-48.el6.x86_64.rpm                                                                                                                                                         | 910 kB     00:00     

[root@localhost ~]# rpm -Uvh bash-4.1.2-48.el6.x86_64.rpm 
warning: bash-4.1.2-48.el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing...                ########################################### [100%]
   1:bash                   ########################################### [100%]
[root@localhost ~]# yum info bash.x86_64
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * base: mirrors.ustc.edu.cn
 * extras: mirrors.tuna.tsinghua.edu.cn
 * updates: mirrors.163.com
Installed Packages
Name        : bash
Arch        : x86_64
Version     : 4.1.2
Release     : 48.el6
Size        : 3.0 M
Repo        : installed
Summary     : The GNU Bourne Again shell
URL         : http://www.gnu.org/software/bash
License     : GPLv3+
Description : The GNU Bourne Again shell (Bash) is a shell or command language
            : interpreter that is compatible with the Bourne shell (sh). Bash
            : incorporates useful features from the Korn shell (ksh) and the C shell
            : (csh). Most sh scripts can be run by bash without modification.

再测试,过了:

[root@localhost ~]# env x='() { :;}; echo vulnerable' bash -c "echo This is a test"
This is a test

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

姚远Oracle ACE

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值