CVE-2014-6271“破壳”

简介: CVE-2014-6271广泛存在与GNU Bash 版本小于等于4.3的*inux的系统之中

简介


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
相关文章
|
API 索引
es实战-分片分配失败解决方案
分片无法分配情况的一些解决办法
3741 0
|
5月前
|
人工智能 数据可视化 数据挖掘
Harness工具是什么?Harness可为AI编程工具扩展联网搜索、代码解释器、网页抓取等能力
Harness是阿里云百炼Token Plan为Qwen系列模型(如Qwen3.8-Max-Preview)内置的增强工具集,支持联网搜索、代码解释器、网页抓取、文搜图、图搜图等能力,按调用次数计费,从套餐Credits中抵扣,开箱即用,无需额外配置。在阿里云百炼官网:https://t.aliyun.com/U/fPVHqY 免费领取千万Tokens
|
5月前
|
人工智能 自然语言处理 IDE
阿里云Qoder CN详细介绍:核心能力、适用场景与计费标准和最新活动参考
Qoder CN(原"通义灵码")是阿里云面向软件开发场景的AI智能体产品,提供IDE、JetBrains、VS Code等多种插件形态,核心能力涵盖代码补全、智能问答、多文件编辑及编程智能体四大模式。产品支持GLM、DeepSeek、Kimi、MiniMax等国内主流大模型自由切换,具备工程自动感知、记忆学习、专家团协作等特性,适配金融、政务等高合规行业。Qoder CN产品家族还包括QoderWork CN(办公助手)、QoderWake CN(数字员工)、Clouds Agents(云端Agent)等子产品,提供企业标准版与专属版方案,助力企业研发智能化与办公自动化升级。
|
9月前
|
Linux 开发工具 git
你的终端神器之Oh My Zsh
Oh My Zsh 是一款强大的 Zsh 配置框架,提供数百款插件(如自动补全、语法高亮)与精美主题,大幅提升终端颜值与效率。支持 Linux/macOS/WSL2,一键安装,轻松定制。开源免费,社区活跃!
1876 2
|
安全 Linux 数据安全/隐私保护
Linux 密码复杂度设置pam_pwquality、pam_passwdqc(centos7)
1、Linux对应的密码策略模块有:pam_passwdqc 和 pam_pwquality 。其中pam_passwdqc模块对应的是/etc/login.
8049 0
|
安全 开发者 Windows
Win10/11系统永久暂停更新教程,避免频繁更新 Win 系统出问题,一个小工具就能搞定。
Win10/11系统永久暂停更新教程,避免频繁更新 Win 系统出问题,一个小工具就能搞定。
4894 7
|
12月前
|
人工智能 JSON 数据挖掘
大模型应用开发中MCP与Function Call的关系与区别
MCP与Function Call是大模型应用中两大关键技术。前者为跨模型标准化通信协议,实现工具与模型解耦;后者是模型调用外部功能的内置机制。二者互补协作,推动AI应用向更开放、灵活、可扩展的方向发展。
|
SQL 关系型数据库 MySQL
MySQL操作利器大公开!这几款客户端让你事半功倍
本文介绍了多种MySQL数据库管理工具,包括命令行工具、图形化用户界面(GUI)工具和Web界面工具。主要工具有: 1. **Navicat for MySQL**:功能强大,支持多种数据库管理任务,但需付费。 2. **DBeaver**:开源免费,支持多种数据库,安装包较大。 3. **MySQL Workbench**:官方提供的图形化工具,适合MySQL全家桶用户。 4. **HeidiSQL**:轻量级Windows客户端,简单易用。 5. **phpMyAdmin**:基于Web的管理工具,易于部署和使用。 6. **SQLyog**:适用于Windows,功能丰富,有免费
3294 3
|
安全 前端开发 JavaScript
vmware-17虚拟机安装教程(保姆级,包含图文讲解,不需注册账户)
vmware-17虚拟机安装教程(保姆级,包含图文讲解,不需注册账户)