当前位置:WooYun >> 漏洞信息

漏洞概要 关注数(24) 关注此漏洞

缺陷编号:wooyun-2014-048342

漏洞标题:新东方某分站源码泄露源码审计中发现若干问题

相关厂商:新东方

漏洞作者: Mr .LZH

提交时间:2014-01-17 15:52

修复时间:2014-03-03 15:53

公开时间:2014-03-03 15:53

漏洞类型:系统/服务运维配置不当

危害等级:中

自评Rank:20

漏洞状态:厂商已经确认

漏洞来源: http://www.wooyun.org,如有疑问或需要帮助请联系 [email protected]

Tags标签:

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

2014-01-17: 细节已通知厂商并且等待厂商处理中
2014-01-20: 厂商已经确认,细节仅向厂商公开
2014-01-30: 细节向核心白帽子及相关领域专家公开
2014-02-09: 细节向普通白帽子公开
2014-02-19: 细节向实习白帽子公开
2014-03-03: 细节向公众公开

简要描述:

放下面说吧

详细说明:

网站地址:http://coolcampdv2011.xdf.cn
一.源码泄露问题:svn备份文件未删除导致泄露,以下目录存在.svn目录.根目录不存在,幸好数据库连接信息在根目录下的文件.

1.jpg


二.审计源码,发现advideo/login.php文件可直接注册管理员帐号.注册后进后台.
后台地址:http://coolcampdv2011.xdf.cn/advideo/adindex.php
页面源码如下:

<?php
require_once '../configure.php';
require_once 'class/class_admin.php';
require_once '../class/class_memcache.php';
$conf = new configure ( );
$mysqldb = $conf->mysql ();
$smarty = $conf->smarty ();
$memcache = new class_memcache ( $conf->memcache_host, $conf->memcache_post, $conf );
$admin = new class_admin ( $mysqldb, $memcache, $conf );
session_start ();
$do = empty ( $_GET ['do'] ) ? '' : addslashes ( $_GET ['do'] );
// smarty
$smarty->assign ( 'crumbs', '0' ); // 面包屑
$smarty->assign ( 'crumbs1', '' ); // 面包屑 第一级
$smarty->assign ( 'crumbs2', '' ); // 面包屑 第二级
if ($do == 'zhuce') {

// advideo/adindex.php 页面点击‘注册’链接进入
$smarty->assign ( 'title', '管理后台-管理员注册' ); // 页面title
$smarty->display ( 'templates/zhuce.html' );
} elseif ($do == 'modifypwd') {

// 在space.php?do=input或list的‘修改密码’链接进入
$smarty->assign ( 'title', '管理后台-管理员修改密码' ); // 页面title
$smarty->assign ( 'email', empty ( $_SESSION ['usrInfo'] ['email'] ) ? '' : $_SESSION ['usrInfo'] ['email'] );
$smarty->display ( 'templates/modifypwd.html' );
} elseif ($do == 'inmodifypwd') {

// 在advideo/login.php?do=modifypwd 修改密码页面中点击‘修改密码’按钮
$email = empty ( $_POST ['email'] ) ? '' : $_POST ['email'];
$oldpwd = empty ( $_POST ['oldpwd'] ) ? '' : $_POST ['oldpwd'];
$newpwd = empty ( $_POST ['newpwd'] ) ? '' : $_POST ['newpwd'];
$data = $admin->updatepwd ( $email, $oldpwd, $newpwd );
header ( "Content-Type: text/html; charset=utf8" );
if ($data == 1) {
echo "<script> alert('修改密码成功!'); window.location.href='adindex.php'</script>";
} elseif ($data == 2) {
echo "<script> alert('修改密码失败!有相同邮箱名称的管理员存在'); window.location.href='login.php?do=modifypwd'</script>";
} elseif ($data == 0) {
echo "<script> alert('修改密码失败!管理员邮箱或者密码错误'); window.location.href='login.php?do=modifypwd'</script>";
} elseif ($data == 3) {
echo "<script> alert('修改密码失败!未知错误'); window.location.href='login.php?do=modifypwd'</script>";
}
} elseif ($do == 'register') {

// advideo/login.php?do=zhuce 页面点击‘注册’按钮
$email = empty ( $_POST ['email'] ) ? '' : $_POST ['email'];
$pwd = empty ( $_POST ['pwd'] ) ? '' : $_POST ['pwd'];
$data = $admin->insert ( $email, $pwd );
header ( "Content-Type: text/html; charset=utf8" );
if ($data == 1) {
echo "<script> alert('注册成功!'); window.location.href='adindex.php'</script>";
} elseif ($data == 2) {
echo "<script> alert('注册失败!有相同邮箱名称的管理员存在'); window.location.href='login.php?do=zhuce'</script>";
} elseif ($data == 0) {
echo "<script> alert('注册失败!未知错误'); window.location.href='login.php?do=zhuce'</script>";
}
} elseif ($do == 'adlogin') {

// admin/adindex.php 页面点击‘登陆’按钮
$email = empty ( $_POST ['email'] ) ? '' : $_POST ['email'];
$pwd = empty ( $_POST ['password'] ) ? '' : $_POST ['password'];
$data = $admin->login ( $email, $pwd ); // 1 有此人 0 无此人
header ( "Content-Type: text/html; charset=utf8" );
if ($data > 1) {
echo "<script> alert('登陆失败!有相同邮箱名称的管理员存在'); window.location.href='adindex.php'</script>";
} elseif ($data == 1) {
if (empty ( $_SESSION ['usrInfo'] )) {
$_SESSION ['usrInfo'] = array ();
}
$_SESSION ['usrInfo'] ['email'] = $email; // 管理员邮箱
$_SESSION ['usrInfo'] ['type'] = 1; // 是管理员
$_SESSION ['usrInfo'] ['adminID'] = $admin->admininfo ['id']; // 管理员id
$_SESSION ['usrInfo'] ['adminAuth'] = $admin->admininfo ['auth']; // 管理员权限
echo "<script> window.location.href='space.php?do=list'</script>";
} elseif ($data == 0) {
echo "<script> alert('登陆失败!管理员邮箱或者密码错误'); window.location.href='adindex.php'</script>";
}
} elseif ($do == 'login') {

// advideo/index.php 页面点击‘登陆’按钮
$email = empty ( $_POST ['email'] ) ? '' : $_POST ['email'];
$pwd = empty ( $_POST ['password'] ) ? '' : $_POST ['password'];
$userHandler = $conf->userHandle ();
$userHandler->CheckLogin ( $email, $pwd );
$resp = $userHandler->LoginReturn ();
if ($resp == 'succ') {
// stdClass Object(
// [Token] => 0EB4AA80D9B183B00A11524BAB1A56E8
// [NickName] => liugj
// [UserId] => xdf00426 )
if (empty ( $_SESSION ['usrInfo'] )) {
$_SESSION ['usrInfo'] = array ();
}
$_SESSION ['usrInfo'] ['email'] = $email;
$_SESSION ['usrInfo'] ['nick'] = $userHandler->checkLoginUserInfo->NickName;
$_SESSION ['usrInfo'] ['UserId_Xdf'] = $userHandler->checkLoginUserInfo->UserId;
$_SESSION ['usrInfo'] ['Token'] = $userHandler->checkLoginUserInfo->Token;
$_SESSION ['usrInfo'] ['type'] = 2; // 是普通用户
header ( "Content-Type: text/html; charset=utf8" );
echo '<script> window.location.href="space.php?do=input" </script>';
} else {
header ( "Content-Type: text/html; charset=utf8" );
echo '<script> alert("' . $userHandler->message . '"); window.location.href="index.php"</script>';
}
} elseif ($do == 'logout') {

$type = empty ( $_GET ['type'] ) ? 0 : intval ( $_GET ['type'] );
session_start ();
session_destroy ();
if ($type == 2) {
header ( "Location: index.php" );
} elseif ($type == 1) {
header ( "Location: adindex.php" );
} else {
header ( "Location: index.php" );
}
}
?>


三.文件上传可拿shell.
查看class_upload.php文件可知.文件上传只简单验证文件Content-type类型,并保留原后缀.视频放在/uploads_video/dvdasai/时间/time ()_随机数.图片放在/uploads_img/time ()_随机数.
此处time ()_随机数可由前端界面看到.故找到真实地址不难.
四.注入.(此处只说明可能性)
这里还是看源码得到的,源码多处使用直接拼接sql,并传递给class_mysql.php,没有任何过滤.具体自己看源码吧.
当然,对于php,只要搭建环境时把配置里一个参数设置为on就可以防止注入,没具体查环境怎样,所以此处只说明可能性.
服务器环境具体看http://coolcampdv2011.xdf.cn/uploads/phpinfo.php

漏洞证明:

2.jpg

修复方案:

相信你们比我懂的。

版权声明:转载请注明来源 Mr .LZH@乌云


漏洞回应

厂商回应:

危害等级:低

漏洞Rank:4

确认时间:2014-01-20 14:54

厂商回复:

谢谢提供信息,我们会尽快确认。

最新状态:

暂无