slasher-B

Results 2 issues of slasher-B

### 1. ![sql注入](https://user-images.githubusercontent.com/67090589/170457101-0f7c6815-7da0-4355-a2c1-0f360fc8c19e.png) Don't rely too much on mybatis generator,It brings SQL injection. In addition,receiving parameters with "${}" will prevent mybatis from executing SQL in precompiled form,this leads to SQL...

### 概述: 我在使用springboot1版本进行二次开发,最后测试时发现本项目以及springboot1版本的项目存在两个比较严重的漏洞,分别是**任意文件上传**,**shiro权限绕过**。 ### 问题: #### 1.任意文件上传 http://domain/admin/sys/user/avatar.html(漏洞页面,即头像上传处) url:http://domain/file/upload **原因:** 漏洞在文件SysFileController.java中52-100行,头像上传功能处。代码中只对上传的头像判空,并未做任何校验。只需要将webshell写入图片然后抓包修改后缀即可上传成功,点击提交修改的时候暴露了上传地址,直接访问即可getshell。 **效果:** ![b55bf715d9b0c2babf6e7e13abd2d71](https://user-images.githubusercontent.com/67090589/145154238-20872c97-8e03-4276-be21-b38803d1f435.png) ![c661c665ddd1b5f700d457221098716](https://user-images.githubusercontent.com/67090589/145154292-4ae9c97d-06e3-4791-9209-52ab2d071169.png) ![getshell](https://user-images.githubusercontent.com/67090589/145154552-b6f73806-fbea-4ce5-ba00-845fe67b6ac2.png) #### 2.shiro权限绕过 payload:http://domain/;/需要授权页面路径 **原因:** 利用了spring控制器和shiro的路由处理方式不同,当这两个一起使用时,url先进入shiro鉴权,分号起到截断作用,"/;/admin/index.html"变成"/",从而绕过shiro。在spring中,分号路由默认会被去掉,"/;/admin/index.html"当成"/admin/index.html"解析,然后匹配相应路由。详细请参考漏洞编号**cve-2020-11989**。 **效果:** ![shiro1](https://user-images.githubusercontent.com/67090589/145154065-ef2e4eeb-b4e4-4969-aa63-f9ed3df98d43.png) ![shiro2](https://user-images.githubusercontent.com/67090589/145154117-478e4ece-69fa-4341-b6e1-4a2443d39858.png) ### 解决方案: #### 1.文件上传漏洞 在代码中增加上传校验步骤,并将上传路径加密传输。例如: ``` /**...