(Add Vul: Struts2) Struts2 远程代码执行漏洞(S2-053)

This commit is contained in:
Medicean 2017-09-08 00:56:15 +08:00
parent a5550df0b0
commit 3ce5b6a521
5 changed files with 62 additions and 0 deletions

View File

@ -16,3 +16,4 @@
* [S2-046](./s2-046/)
* [S2-048](./s2-048/)
* [S2-052](./s2-052/)
* [S2-053](./s2-053/)

View File

@ -0,0 +1,14 @@
FROM tomcat:8-jre8
MAINTAINER Medici.Yan@Gmail.com
ENV WAR_URL http://oe58q5lw3.bkt.clouddn.com/s/struts2/struts2/s2-053.war
WORKDIR /tmp
RUN set -ex \
&& rm -rf /usr/local/tomcat/webapps/* \
&& chmod a+x /usr/local/tomcat/bin/*.sh \
&& wget -qO /usr/local/tomcat/webapps/ROOT.war $WAR_URL
EXPOSE 8080
CMD ["/usr/local/tomcat/bin/catalina.sh", "run"]

View File

@ -0,0 +1,47 @@
## Struts2 Freemarker tags 远程代码执行漏洞(S2-053)环境
### 漏洞信息
* [S2-053 公告](https://cwiki.apache.org/confluence/display/WW/S2-053)
### 获取环境:
1. 拉取镜像到本地
```
$ docker pull medicean/vulapps:s_struts2_s2-053
```
2. 启动环境
```
$ docker run -d -p 80:8080 medicean/vulapps:s_struts2_s2-053
```
> `-p 80:8080` 前面的 80 代表物理机的端口,可随意指定。
### 使用与利用
访问 `http://你的 IP 地址:端口号/`
#### PoC
1. 访问 Demo 页面, 随便输入值,可看到页面输出我们提交的值
![](https://github.com/Medicean/VulApps/raw/master/s/struts2/s2-053/poc-1.png)
2. 在输入框中输入 `%{100-3}`,然后提交,发现 `%{}` 中的表达式被执行
![](https://github.com/Medicean/VulApps/raw/master/s/struts2/s2-053/poc-2.png)
#### Exp
暂不公开
### 修复建议
升级Apache struts 至 2.5.12 版本 或者 2.3.34 版本
### 参考链接
* [S2-053 公告](https://cwiki.apache.org/confluence/display/WW/S2-053)
* [S2-053 复现分析过程(附POC) - 猎户攻防实验室](https://mp.weixin.qq.com/s/4CiKgVn7Y-hWUKRjgECsuA)

BIN
s/struts2/s2-053/poc-1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

BIN
s/struts2/s2-053/poc-2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB