top
Loading...
SunJavaWebServer能讓攻擊者遠程執行任意命令
涉及程序:
Solaris and Windows NT

描述:
Sun Java Web Server 能讓攻擊者遠程執行任意命令

詳細:
Sun 的 Java Web 服務器存在多個安全問題,允許攻擊者遠程以 web 服務器權限執行命令。

它的 Web 管理模塊監聽 9090 端口,通過 http 處理管理命令。
"com.sun.server.http.pagecompile.jsp92.JspServlet" servlet用來編譯并執行JSP文件的,
通過增加"/servlet/"前綴,遠程用戶可以使用這個servlet來編譯并執行管理目錄下的任意JSP
文件。

這個服務器缺省帶了一個留言版的演示程序,它允許用戶通過
http://jws.site:9090/examples/applications/bboard/bboard_frames.html
提交文章并將提交的內容儲存在board.html中。

攻擊者可以將某些JSP語句通過留言版輸入,然后調
用"com.sun.server.http.pagecompile.jsp92.JspServlet"去編譯執行board.html文件:

http://jws.site:9090/servlet/com.sun.server.http.pagecompile.jsp92.JspServlet/board.html

這將導致攻擊者遠程以web服務器權限執行命令。


以下代碼僅僅用來測試和研究這個漏洞,如果您將其用于不正當的途徑請后果自負


使用下面的JSP 代碼將打印出"Hello World":
% String s="Hello World"; %>
<%=s %>
在留言版中提交:
http://jws.site:9090/examples/applications/bboard/bboard_frames.html
然后通過 http://jws.site:9090/board.html 確認已經提交。
在下面編譯并執行代碼:
http://jws.site:9090/servlet/com.sun.server.http.pagecompile


解決方案:
下載并安裝補丁:
http://java.sun.com/products/java-server/jws113patch3.html
http://java.sun.com/products/java-server/jws20patch3.html


附加信息:
Saumil Shah (saumil.shah@foundstone.com)
Shreeraj Shah (shreeraj.shah@foundstone.com)
Stuart McClure (stuart.mcclure@foundstone.com)
Foundstone, Inc. (http://www.foundstone.com)

相關站點:
http://www.foundstone.com

北斗有巢氏 有巢氏北斗