最近一波勒索让畅捷通火了一把,我们来简单看看其中代码
首先将安装好的bin目录导入dnspy
根据各种消息,确定漏洞为上传,所以重点关注upload
确定位置
代码如下
protected void Page_Load(object sender, EventArgs e)
{
this.ReadResources();
if (base.Request.Files.Count == 1)
{
string text = "images/index.gif";
object obj = this.ViewState["fileName"];
if (obj != null)
{
text = obj.ToString();
}
if (this.File1.PostedFile.ContentLength > 204800)
{
base.Response.Write(string.Concat(new string[]
{
"<script language='javascript'>alert('",
this.PhotoTooLarge,
"'); parent.document.getElementById('myimg').src='",
text,
"';</script>"
}));
return;
}
if (this.File1.PostedFile.ContentType != "image/jpeg" && this.File1.PostedFile.ContentType != "image/bmp" && this.File1.PostedFile.ContentType != "image/gif" && this.File1.PostedFile.ContentType != "image/pjpeg")
{
base.Response.Write(string.Concat(new string[]
{
"<script language='javascript'>alert('",
this.PhotoTypeError,
"'); parent.document.getElementById('myimg').src='",
text,
"';</script>"
}));
return;
}
string fileName = this.File1.PostedFile.FileName;
string text2 = fileName.Substring(fileName.LastIndexOf('\') + 1);
this.File1.PostedFile.SaveAs(base.Server.MapPath(".") + "\images\" + text2);
string value = base.Server.MapPath(".") + "\images\" + text2;
this.ViewState["fileName"] = "images/" + text2;
this.Session["ImageName"] = value;
}
}
上传会校验权限加上preload=1即可绕过,路径后续等别人的poc吧,或者自己下载分析。
补丁下载:
https://www.chanjetvip.com/product/goods/goods-detail?id=53aaa40295d458e44f5d3ce5
原文始发于微信公众号(安全学习与分享):畅捷通文件上传
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论