好久没碰过Javaweb了,但是感觉自己配环境的时候还是满熟练的哈,这一篇算是超级简单那种了,就开启我的Java审计之旅吧
环境配置我这里是老古董无敌兼容版本Jdk1.8,开启配置
分析漏洞点在http://url/admin/system/generate/create.json?sqlid=,在com/ofsoft/cms/admin/controller/system/SystemGenerateController.java,能看到这里直接接收了sql参数 看看传参方式,跟踪getpara函数,只是一个get请求罢了
再来跟踪update方法
public static int update(String sql) { return MAIN.update(sql); }再跟进
public int update(String sql) { return this.update(sql, DbKit.NULL_PARA_ARRAY); }终于到了最关键的地方吧,这里...是可变长参数,也就是相当于一个数组,能够传入0个至n个参数,好久没碰java有点忘了,一般可以用foreach取得每个参数
public int update(String sql, Object... paras) { Connection conn = null; int var4; try { conn = this.config.getConnection(); var4 = this.update(this.config, conn, sql, paras); } catch (Exception var8) { throw new ActiveRecordException(var8); } finally { this.config.close(conn); } return var4; }看到先建立数据库