目标达成 感谢每一位支持者 — 我们达成了 100% 目标!

目标: 1000 元 · 已筹: 1336

100%

CVE-2014-6271 PoC — GNU Bash 远程代码执行漏洞

来源
关联漏洞
标题: GNU Bash 远程代码执行漏洞 (CVE-2014-6271)
Description:GNU Bash是美国软件开发者布莱恩-福克斯(Brian J. Fox)为GNU计划而编写的一个Shell(命令语言解释器),它运行于类Unix操作系统中(Linux系统的默认Shell),并能够从标准输入设备或文件中读取、执行命令,同时也结合了一部分ksh和csh的特点。 GNU Bash 4.3及之前版本中存在安全漏洞,该漏洞源于程序没有正确处理环境变量值内的函数定义。远程攻击者可借助特制的环境变量利用该漏洞执行任意代码。以下产品和模块可能会被利用:OpenSSH sshd中的ForceComman
Description
patched-bash-4.3 for CVE-2014-6271
介绍
patched-bash-4.3
================

patched-bash-4.3 for CVE-2014-6271


This is just bash 4.3 , pulled from the gnu website, and patched with the patches available on 9/26/2014, including the pkgsrc functionality changes that just disable the silly "execute functions in env variables" altogether.

The patches are also included here, but I've already applied them to the sourcecode (for those unfamiliar with the ```patch``` command)

Don't use this, if you don't know and trust me.  Build it yourself.

I'm putting this on github so I can point friends and co-workers here.

#### For hotpatching this in a SmartOS zone (like in JPC):

- clone this repo

``` git clone https://github.com/ryancnelson/patched-bash-4.3 ```

- ```cd bash-4.3```
- ```make clean ; ./configure ; make ; make install ```
- look at 
```
/usr/local/bin/bash --version 
GNU bash, version 4.3.25(1)-release (i386-pc-solaris2.11)
Copyright (C) 2013 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.

```

- mount this file, using the lofs mount trick , ON TOP of /usr/bin/bash :
  - you may need to reboot to kill off any currently running bash shells
  - after reboot, log back in, and run ``` exec /bin/sh ``` to confirm you're not using bash at the moment.
  - ``` ps -ef | grep bash ``` should return nothing.
  - then, mount /usr/local/bin/bash over /usr/bin/bash with: ```mount -O -F lofs /usr/local/bin/bash /usr/bin/bash ```
  - this lofs mount is not permanent.  re-do after reboots, or wait for a patched platform image.

- confirm that ```/usr/bin/bash --version ``` returns the new 4.3 version you expect after the ```lofs mount``` command


### for extra credit:

If you're interested, in SmartOS, in watching your system to see when ```bash``` is executed, you can, using DTrace:
run this at your command line: 
```
dtrace -n 'proc:::exec-success /basename(execname)=="bash"/ {printf("%d executed %s\n", ppid, execname);}'
```
... then, log in again, or spawn some bash shells.  You should see lines like:
```
CPU     ID                    FUNCTION:NAME
  1  11422         exec_common:exec-success 91178 executed bash
```

... this'll let you know whether your application(s) are forking bash under the covers, unbeknownst to you, as part of their normal operations, and whether you're exposed to external intruders being able to spawn bash and exploit it, remotely.

文件快照

登录后查看神龙缓存的 POC 文件快照

登录查看
备注
    1. 建议优先通过来源进行访问。
    2. 本地 POC 快照面向订阅用户开放;当原始来源失效或无法访问时,本地镜像作为订阅权益的一部分提供。
    3. 持续抓取、验证、维护这份 POC 档案需要不少投入,因此本地快照已纳入付费订阅。您的订阅是让这份资料能继续走下去的关键,由衷感谢。 查看订阅方案 →