Sun Java Web Server 能让攻击者远程执行任意命令 

2000-12-11 10:35:42  作者
涉及程序
Solaris and Windows NT

描述
Sun Java Web Server 能让攻击者远程执行任意命令

具体
Sun 的 Java Web 服务器存在多个安全问题,答应攻击者远程以 web 服务器权限执行命令。

它的 Web 治理模块监听 9090 端口,通过 http 处理治理命令。
%26quot;com.sun.server.http.pagecompile.jsp92.JspServlet%26quot; servlet用来编译并执行JSP文件的,
通过增加%26quot;/servlet/%26quot;前缀,远程用户可以使用这个servlet来编译并执行治理目录下的任意JSP
文件。

这个服务器缺省带了一个留言版的演示程序,它答应用户通过
http://jws.site:9090/examples/applications/bboard/bboard_frames.html
提交文章并将提交的内容储存在board.html中。

攻击者可以将某些JSP语句通过留言版输入,然后调
用%26quot;com.sun.server.http.pagecompile.jsp92.JspServlet%26quot;去编译执行board.html文件

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

这将导致攻击者远程以web服务器权限执行命令。


以下代码仅仅用来测试和研究这个漏洞,假如您将其用于不正当的途径请后果自负


使用下面的JSP 代码将打印出%26quot;Hello World%26quot;:
% String s=%26quot;Hello World%26quot;; %%26gt;
%26lt;%=s %%26gt;
在留言版中提交
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