金和OA Budget_CostApply.aspx SQL注入漏洞


漏洞简介

金和网络是专业信息化服务商,为城市监管部门提供了互联网+监管解决方案,为企事业单位提供组织协同OA系统开发平台,电子政务一体化平台,智慧电商平台等服务。金和OA C6 Budget_CostApply.aspx 接口处存在SQL注入漏洞,攻击者除了可以利用SQL注入漏洞获取数据库中的信息(例如,管理员后台密码、站点的用户个人信息)之外,甚至在高权限的情况可向服务器中写入木马,进一步获取服务器系统权限。

影响版本

金和OA C6

fofa语法

app="金和网络-金和OA"

漏洞分析

根据 Budget_CostApply.aspx 的源码,在 bin 目录下查找 JHBase.Web.CostControl.dll 将其进行反编译后找到 Budget_CostApply 的处理逻辑

protected void Page_Load(object sender, EventArgs e)
{
  Utility.RegisterTypeForAjax(typeof (Budget_CostApply));
  this.KeyCtrl("JHCostControl");
  ((HtmlInputControl) this.hidShowKyMoney).Value = this.cc.GetCkKyMoney();
  this.ToolBar1.IdeaUrl = "../../Control/";
  if (this.Request.QueryString["From"] != null && string.op_Equality(this.Request.QueryString["From"].ToString(), "GiveOutShow"))
  {
    this.ToolBar1.Style["display"] = "none";
    this.UploadFile1.ButtonAdd.Disabled = true;
    this.UploadFile1.ButtonDel.Disabled = true;
    this.UploadFile1.ButtonEditor.Disabled = true;
  }
  if (this.Request.QueryString["Projid"] != null)
  {
    string str = this.Request.QueryString["Projid"].ToString();
    this.ProName = this.costManager.GetProjName(str);
    DataRow row = this.costManager.GetProjPeriod(str).Rows[0];

跟进GetProjName方法

public string GetProjName(string pid)
{
  return this.db.ExecSQLReobject($"select projname from ProjectList  where ProjID='{pid}'").ToString();
}

至此,就非常明了了,参数Projid是被直接拼接进SQL语句中后执行,无任何过滤或校验,导致SQL注入漏洞。

漏洞复现

GET /c6/JHSoft.Web.CostControl/BudgetExecution/Budget_CostApply.aspx/?Projid=SQLI_POC HTTP/1.1
Host: jhsoft.mrxn.net

成功延时 4 秒


手机扫码阅读

天锐绿盾审批系统 downloadByUuid.do 任意文件读取+删除漏洞

金和OA Print1.aspx 权限绕过漏洞

评 论