相關(guān)關(guān)鍵詞
關(guān)于我們
最新文章
- iis7導(dǎo)入偽靜態(tài)規(guī)則httpd.ini或.htaccess
- 如何把.htaccess文件轉(zhuǎn)換成httpd.cof、httpd.ini或web.config
- URL優(yōu)化之IIS7如何開(kāi)啟偽靜態(tài)
- sqlserver連接未能加載文件或程序集“System.Data
- Rewrite解決問(wèn)號(hào)匹配的寫(xiě)法
- Rewrite規(guī)約
- IIS設(shè)置靜態(tài)內(nèi)容緩存時(shí)間
- win2003取消按ctrl+alt+del開(kāi)機(jī)實(shí)現(xiàn)自動(dòng)登錄
- Windows的登錄類(lèi)型介紹
- WIN2003服務(wù)器防止黑客入侵5大招--防止被建管理員用戶
Struts2再曝S2-020補(bǔ)丁繞過(guò)漏洞 – 萬(wàn)惡的正則表達(dá)式
4月24日,網(wǎng)絡(luò)曝出文章“安全研究人員指出Apache Struts2在漏洞公告S2-020里,在處理修復(fù)CVE-2014-0094的漏洞修補(bǔ)方案存在漏洞,導(dǎo)致補(bǔ)丁被完全繞過(guò)。”
受影響產(chǎn)品:
Struts 2.0.0 – Struts 2.3.16.1
成因與威脅:
Apache Struts 2.0.0-2.3.16版本的默認(rèn)上傳機(jī)制是基于Commons FileUpload 1.3版本,其附加的ParametersInterceptor允許訪問(wèn)'class' 參數(shù)(該參數(shù)直接映射到getClass()方法),并允許控制ClassLoader。在具體的Web容器部署環(huán)境下(如:Tomcat),攻擊者利用 Web容器下的Java Class對(duì)象及其屬性參數(shù)(如:日志存儲(chǔ)參數(shù)),可向服務(wù)器發(fā)起遠(yuǎn)程代碼執(zhí)行攻擊,進(jìn)而植入網(wǎng)站后門(mén)控制網(wǎng)站服務(wù)器主機(jī)。
讓我們一起來(lái)回顧一下Struts縫縫補(bǔ)補(bǔ)的歷史(萬(wàn)惡的正則表達(dá)式):
漏洞詳情:Struts 2.3.15.1之前的版本,參數(shù)action的值redirect以及redirectAction沒(méi)有正確過(guò)濾,導(dǎo)致ognl代碼執(zhí)行。
修復(fù)方式:將 '^class\.*'添加到excludeParams列表內(nèi)
2014年4月……
從目前公布的信息來(lái)看,這個(gè)漏洞的局限性很高,利用范圍仍然有限。
目前官方在GitHub上對(duì)該問(wèn)題做出了修正(臨時(shí))。
代碼修復(fù)詳情:
core/src/main/resources/struts-default.xml - <param name="excludeParams">^class\..*,^dojo\..*,^struts\..*,^session\..*,^request\..*,^application\..*,^servlet(Request|Response)\..*,^parameters\..*,^action:.*,^method:.*</param> + <param name="excludeParams">(.*\.|^)class\..*,^dojo\..*,^struts\..*,^session\..*,^request\..*,^application\..*,^servlet(Request|Response)\..*,^parameters\..*,^action:.*,^method:.*</param>
請(qǐng)注意多處都要修改。
在4月24日下午,又有同學(xué)貼出了終極修改方案:
修改struts源碼
com.opensymphony.xwork2.interceptor.ParametersInterceptor
將此處代碼:
public void setExcludeParams(String commaDelim) { Collection<String> excludePatterns = ArrayUtils.asCollection(commaDelim); if (excludePatterns != null) { excludeParams = new HashSet<Pattern>(); for (String pattern : excludePatterns) { excludeParams.add(Pattern.compile(pattern)); } } }
修改為:
public void setExcludeParams(String commaDelim) { Collection<String> excludePatterns = ArrayUtils.asCollection(commaDelim); if (excludePatterns != null) { excludeParams = new HashSet<Pattern>(); for (String pattern : excludePatterns) { excludeParams.add(Pattern.compile(pattern)); } } //s021 zhenzheteng Pattern s021_1 = Pattern.compile("(.*\\.|^)class\\..*",Pattern.CASE_INSENSITIVE); Pattern s021_2 = Pattern.compile(".*'class&'.*",Pattern.CASE_INSENSITIVE); Pattern s021_3 = Pattern.compile("(.*\\.|^)class\\[.*",Pattern.CASE_INSENSITIVE); excludeParams.add(s021_1); excludeParams.add(s021_2); excludeParams.add(s021_3); }
Struts歷史漏洞回顧:
S2-020: http://struts.apache.org/release/2.3.x/docs/s2-020.html
S2-019的遠(yuǎn)程代碼執(zhí)行漏洞: http://sebug.net/vuldb/ssvid-61048
S2-016官方補(bǔ)丁分析:http://www.freebuf.com/articles/web/11234.html
S2-013的漏洞分析:http://www.freebuf.com/vuls/9757.html
Struts2最近幾個(gè)漏洞分析&穩(wěn)定利用Payload: http://www.freebuf.com/articles/web/25337.html
希望Struts官方能在爆出漏洞的第一時(shí)間完美的堵上…..
另外關(guān)于S2-020:http://sec.baidu.com/index.php?research/detail/id/18
參考:
apache:http://struts.apache.org/release/2.3.x/docs/s2-020.html
cnvd:http://www.cnvd.org.cn/webinfo/show/3427
piyolog:http://d.hatena.ne.jp/Kango/20140417/139775019
scutum:http://www.scutum.jp/information/waf_tech_blog/2014/04/waf-blog-036.html
ipa.jp:http://www.ipa.go.jp/security/ciadr/vul/20140417-struts.html
空虛浪子心的博客:http://www.inbreak.net/
還有各路微博……
相關(guān)鏈接
- Struts 的詳細(xì)介紹:請(qǐng)點(diǎn)這里
- Struts 的下載地址:請(qǐng)點(diǎn)這里
相關(guān)文章
- Windows下IIS以FastCGI模式運(yùn)行PHP
- 檢查HTTP狀態(tài)提高PHP服務(wù)器安全性
- 網(wǎng)站建設(shè)安全之:關(guān)閉錯(cuò)誤提示display_errors
- 常規(guī)PHP網(wǎng)站建設(shè)安全性設(shè)置
- 怎樣安裝Ubuntu操作系統(tǒng)
- 常用的網(wǎng)站漏洞掃描工具
- Struts2再曝S2-020補(bǔ)丁繞過(guò)漏洞 – 萬(wàn)惡的正則表達(dá)式 》
- NGINX+PHP(FASTCGI)好,還是NGINX+APACHE+PHP好?
- Windows的登錄類(lèi)型介紹
- WIN2003服務(wù)器防止黑客入侵5大招--防止被建管理員用戶