bash环境变量存在随意代码运行漏洞:“通过CGI请求方式能够导致远程代码运行,进而导致server被入侵。危害严重。且官方发布补丁也被绕过”

【漏洞影响】:

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

2)入侵方式:结合CGI方式能够导致远程代码运行,入侵server。

了解系统当前bash的版本号

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

Linux Bash严重漏洞修复紧急通知(2014年9月25日更新)

日前Linux官方内置Bash中新发现一个很严重安全漏洞。黑客能够利用该Bash漏洞全然控制目标系统并发起攻击,为了避免您Linuxserver受影响。建议您尽快完毕漏洞修补。修复方法例如以下:

漏洞检測方法

能够使用例如以下命令来检查系统存在此漏洞:

env -i  X='() { (a)=>\' bash -c 'echo date'; cat echo
修复前输出:当前系统时间

使用修补方案修复后

date

特别提示:该修复不会有不论什么影响,假设您的脚本使用以上方式定义环境变量,修复后您的脚本运行会报错。

输出结果中包括date字符串就修复成功了。

修补方案

centos:

yum clean all
yum makecache
yum -y update bash

ubuntu:

apt-cache gencaches
apt-get -y install --only-upgrade bash

debian 7.5 64bit && 32bit :

apt-cache gencaches
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+deb6u2_amd64.deb &&  dpkg -i bash_4.1-3+deb6u2_amd64.deb

debian 6.0.x 32bit

wget http://mirrors.aliyun.com/debian/pool/main/b/bash/bash_4.1-3+deb6u2_i386.deb &&  dpkg -i bash_4.1-3+deb6u2_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

Shell升级,/bin/bash版本号4.1到4.3的更多相关文章

  1. 【解决】org.apache.hadoop.util.Shell$ExitCodeException: /bin/bash: line 0: fg: no job control

    [环境信息] Hadoop版本:2.4.0 客户端OS:Windows Server 2008 R2 服务器端OS:CentOS 6.4 [问题现象] 在通过Windows客户端向Linux服务器提交 ...

  2. CentOS6 Shell脚本/bin/bash^M: bad interpreter错误解决方法

    在windows下保存了一个脚本文件,用ssh上传到centos,添加权限执行nginx提示没有那个文件或目录.shell脚本放到/etc/init.d/目录下,再执行/etc/init.d/ngin ...

  3. Linux - Shell - #!/bin/bash

    概述 简单解释一下 shell 脚本卡头的 #!/bin/bash 水一篇, 少一篇 背景 shell 脚本中的注释 通常是 以# 卡头的行 但是有时候执行 shell 的时候, 会有这种内容 #!/ ...

  4. /bin/bash: line 0: fg: no job control一般解决方法

    測试版本号:CDH5.0,(Hadoop2.3) 在使用windows调用Hadoop yarn平台的时候,一般都会遇到例如以下的错误: 2014-05-28 17:32:19,761 WARN or ...

  5. 远程ssh登陆时报错:/bin/bash: Permission denied

    远程普通用户ssh登录时,提示/bin/bash: Permission denied,用户名mas,密码正确. 首先上个图,用户远程登录步骤,转自http://www.tldp.org/LDP/LG ...

  6. 在使用windows调用Hadoop 错误 /bin/bash: line 0: fg: no job control一般解决方法

    在使用windows调用Hadoop yarn平台的时候,一般都会遇到如下的错误: 2014-05-28 17:32:19,761 WARN org.apache.hadoop.yarn.server ...

  7. linux shell中的 #!/bin/bash

    #!/bin/bash是指此脚本使用/bin/bash来解释执行. 其中,#!是一个特殊的表示符,其后,跟着解释此脚本的shell路径. bash只是shell的一种,还有很多其它shell,如:sh ...

  8. ./ . 和#!/bin/bash 辨析Linux如何选择当前执行脚本的shell

    最近遇到一个有趣的问题,让我搞清楚Linux如何选择当前执行脚本的shell 执行cts的的 media stress test 需要安装 android-cts-media-1.0.zip 把这个文 ...

  9. Shell脚本报错:-bash: ./switch.sh: /bin/bash^M: bad interpreter: No such file or directory

    在学习shell中测试case参数命令代码如下 #!/bin/bash #switch测试 case $1 in     start)         echo 'start'     ;;      ...

随机推荐

  1. Ubuntu下安装Python3.6并在终端输入Python就能显示Python3.6

      Ubuntu17.04自带Python2.7与Python3.5.3的版本,由于Python2与Python3有着一些差距可能需要安装更新Python3的版本,并且切换默认的Python解释器. ...

  2. LightOJ - 1179 Josephus Problem(约瑟夫环)

    题目链接:https://vjudge.net/contest/28079#problem/G 题目大意:约瑟夫环问题,给你n和k(分别代表总人数和每次要数到k),求最后一个人的位置. 解题思路:因为 ...

  3. 父元素的mousedown事件上父元素的mousedown事件上的offsetX和offsetY错误的offsetX和offsetY错误

    https://stackoverflow.com/questions/35360704/wrong-offsetx-and-offsety-on-mousedown-event-of-parent- ...

  4. HDRtools-OpenExr

    转:http://blog.csdn.net/lqhbupt/article/details/7917764 OpenEXR是由工业光魔(Industrial Light& Magic)开发的 ...

  5. js 正则验证多个邮箱,用;隔开的那种

    var r = /^((([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6}\;))*(([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\. ...

  6. Python全栈开发之11、进程和线程

    一.线程 多任务可以由多进程完成,也可以由一个进程内的多线程完成,一个进程内的所有线程,共享同一块内存python中创建线程比较简单,导入threading模块,下面来看一下代码中如何创建多线程. d ...

  7. LoadRunner中常用的字符串操作函数

    LoadRunner中常用的字符串操作函数有:                strcpy(destination_string, source_string);               strc ...

  8. openssl源码目录结构

    openssl源代码主要由eay库.ssl库.工具源码.范例源码以及测试源码组成. eay库是基础的库函数,提供了很多功能.源代码放在crypto目录下.包括如下内容: 1) asn.1 DER编码解 ...

  9. 《java虚拟机》----垃圾收集、内存分配

    No1: 程序计数器.虚拟机栈.本地方法栈3个区域随线程而生,随线程而灭:栈中的栈帧随着方法的进入和退出而有条不紊的执行着出栈和入栈操作.每一个栈帧中分配多少内存基本上市在类结构确定下来时就已知的,因 ...

  10. CodeForces 909D Colorful Points

    题解: 暴力,模拟. 把字符串压缩一下,相同的处理成一位,记录下个数,然后暴力模拟即可. #include <bits/stdc++.h> using namespace std; con ...