破晓 发表于 2007 年 2 月 1 日 12:50:11

mg2相册漏洞的修补(原创方法阿)

自己动手写了一句
我写的修补语句
不知道有没有写错,,

if ($_REQUEST['filename'] = ".php"){header("Location:http://fengye.net.ru");}



漏洞原因

Apache最新安全漏洞与利用
Bug Find By Cooldiyer @ 2006/12/13 15:05
描述: 任意以.php开头的文件名,Apache都当做php文件解析

如".php.comment"将被当做php文件解析,由此引发一系列漏洞.

MG2是在国外非常流行的一个PHP+HTML的图片管理程序,由于商业版被破解,程序流传甚广,
在google搜索关键字为"owered by MG2 v0.5.1"
最新版本存在着文件写入漏洞,可配和Apache漏洞直接得shell

includes/mg2_functions.php中addcomment()函数如下

CODE:

function addcomment() {
$_REQUEST['filename'] = $this->charfix($_REQUEST['filename']);
$_REQUEST['input'] = $this->charfix($_REQUEST['input']);
$_REQUEST['email'] = $this->charfix($_REQUEST['email']);
$_REQUEST['name'] = $this->charfix($_REQUEST['name']);
$_REQUEST['input'] = strip_tags($_REQUEST['input'], "<b></b><i></i><u></u><strong></strong><em></em>");
$_REQUEST['input'] = str_replace("/n","<br />",$_REQUEST['input']);
$_REQUEST['input'] = str_replace("/r","",$_REQUEST['input']);
if ($_REQUEST['input'] != "" && $_REQUEST['name'] != "" && $_REQUEST['email'] != "") {
    $this->readcomments("pictures/" . $_REQUEST['filename'] . ".comment");
    $comment_exists = $this->select($_REQUEST['input'],$this->comments,3,1,0);
    $comment_exists = $this->select($_REQUEST['name'],$comment_exists,1,1,0);
    $comment_exists = $this->select($_REQUEST['email'],$comment_exists,2,1,0);
    if (count($comment_exists) == 0) {
    $this->comments[] = array(time(), $_REQUEST['name'], $_REQUEST['email'], $_REQUEST['input']);
    $this->writecomments($_REQUEST['filename'] . ".comment");
........


[ 本帖最后由 破晓 于 2007-2-1 13:09 编辑 ]

xicn55 发表于 2007 年 2 月 1 日 12:51:23

这漏洞管用么?我昨天试了我自己的相册啊 ,好像没反映啊!

破晓 发表于 2007 年 2 月 1 日 12:52:13

原帖由 xicn55 于 2007-2-1 12:51 发表
这漏洞管用么?我昨天试了我自己的相册啊 ,好像没反映啊!
要有写入权限。。
否则。。

聶十八 发表于 2007 年 2 月 1 日 12:52:39

未知数...

破晓 发表于 2007 年 2 月 1 日 12:54:51

////
没有人拉

xicn55 发表于 2007 年 2 月 1 日 12:58:11

http://photo4.yupoo.com/20061215/070241_308772017.jpg 是这个图么
我昨天试了啊! 没反映 注入不了啊!

破晓 发表于 2007 年 2 月 1 日 13:09:50

原帖由 xicn55 于 2007-2-1 12:58 发表
http://photo4.yupoo.com/20061215/070241_308772017.jpg 是这个图么
我昨天试了啊! 没反映 注入不了啊!
是的。。
但是。。最好还是网页利用,这种工具不好用

破晓 发表于 2007 年 2 月 1 日 13:46:48

6楼同志。。这是注入失败马?

xicn55 发表于 2007 年 2 月 1 日 17:16:42

原帖由 破晓 于 2007-2-1 13:46 发表
6楼同志。。这是注入失败马?
这东西我有注入成功的 昨天才注入的!给你个地址 不过我没挂马!
你们拿去耍一下!

xicn55 发表于 2007 年 2 月 1 日 17:18:22

我的地址http;//www.yoyi.org.ru/mg2 你们注入下!给我留个明显点的标志!要不我不知道你们注入了!
页: [1] 2
查看完整版本: mg2相册漏洞的修补(原创方法阿)