### 简要描述: 大汉版通系统再次getshell#2(前台且非setup) ,且同样存存在两处.. ### 详细说明: 注:该系统为信息公开系统(xxgk) #1 漏洞文件 ``` /xxgk/m_6_1/opr_modal.jsp /xxgk/m_6_1/attachupload.jsp ``` 选择其一贴下漏洞代码,这里为/xxgk/m_6_1/opr_modal.jsp.. [<img src="https://images.seebug.org/upload/201405/17144951cada5ecf212c8228767f5d4afdb2e5fe.jpg" alt="1.jpg" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201405/17144951cada5ecf212c8228767f5d4afdb2e5fe.jpg) ``` //.. if (strStatus.equals("S")) { blf.doUpload(request); out.println(Convert.getAlterScript("parent.location='./opr_modal.jsp'")); return; } //从下面可获取到文件上传的路径 if (strStatus.equals("V")) { int inModaltype = Integer.parseInt(strModaltype); entity = blf.getModal(strI_id, inModaltype); if (entity != null) { strModalName = entity.getVc_modalfilename(); } String strModalPath = application.getRealPath("") + "/jcms_files/jcms" + strAppID + "/web" + nWebID + "/site/zfxxgk/ysqgk/modal/" + strModaltype + "/" + strModalName; Convert convert = new Convert();...
### 简要描述: 大汉版通系统再次getshell#2(前台且非setup) ,且同样存存在两处.. ### 详细说明: 注:该系统为信息公开系统(xxgk) #1 漏洞文件 ``` /xxgk/m_6_1/opr_modal.jsp /xxgk/m_6_1/attachupload.jsp ``` 选择其一贴下漏洞代码,这里为/xxgk/m_6_1/opr_modal.jsp.. [<img src="https://images.seebug.org/upload/201405/17144951cada5ecf212c8228767f5d4afdb2e5fe.jpg" alt="1.jpg" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201405/17144951cada5ecf212c8228767f5d4afdb2e5fe.jpg) ``` //.. if (strStatus.equals("S")) { blf.doUpload(request); out.println(Convert.getAlterScript("parent.location='./opr_modal.jsp'")); return; } //从下面可获取到文件上传的路径 if (strStatus.equals("V")) { int inModaltype = Integer.parseInt(strModaltype); entity = blf.getModal(strI_id, inModaltype); if (entity != null) { strModalName = entity.getVc_modalfilename(); } String strModalPath = application.getRealPath("") + "/jcms_files/jcms" + strAppID + "/web" + nWebID + "/site/zfxxgk/ysqgk/modal/" + strModaltype + "/" + strModalName; Convert convert = new Convert(); String strModal = convert .readInputStream(strModalPath, "UTF-8"); if (Convert.getValue(strModal).length() == 0) { out .println("<a style='font:12px;color:#FF0000'>模板文件为空</a>"); return; } strModal = Convert.replaceString(strModal, "\"images/", "\"" + "../jcms_files/jcms" + strAppID + "/web" + nWebID + "/site/zfxxgk/ysqgk/modal/" + strModaltype + "/images/"); out.println(strModal); return; } %> ``` 从上面可以看出,文件上传仅在客户端采用javascript进行验证,服务端并没有任何的验证,可以说 可以直接上传任意文件,于是造成了任意文件上传漏洞。 #2 漏洞验证 由于网上有大量的实例,任意选取一个案例进行测试验证.. 这里选择 ``` http://xxgk.weifang.gov.cn/xxgk/m_6_1/opr_modal.jsp ``` [<img src="https://images.seebug.org/upload/201405/17145559075efa81ebaa60c844a63d0683ada28c.jpg" alt="2.jpg" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201405/17145559075efa81ebaa60c844a63d0683ada28c.jpg) step1 将我们要上传的users.jsp重命名为user.htm step2 上传时抓包,将user.htm再次命名为user.jsp即可,如下 [<img src="https://images.seebug.org/upload/201405/171459438226103c7b6c7fc22eeca4f271dfe660.jpg" alt="3.jpg" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201405/171459438226103c7b6c7fc22eeca4f271dfe660.jpg) 点击GO 即可在下面目录生成user.jsp ``` /xxgk/jcms_files/jcms1/web0/site/zfxxgk/ysqgk/modal/1/你的文件名 注意:由于代码中上传文件的路径为: "/jcms_files/jcms" + strAppID + "/web" + nWebID+ "/site/zfxxgk/ysqgk/modal/" + strModaltype + "/"+ 文件名; 所以路径可能要做适当的更改.@@@ ``` #3 连接shell shell路径为: ``` http://xxgk.site.cn/xxgk/jcms_files/jcms1/web0/site/zfxxgk/ysqgk/modal/1/users.jsp ``` 如图所示 [<img src="https://images.seebug.org/upload/201405/1715080218cbd45acd0ece817cdb9a6de7296513.jpg" alt="4.jpg" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201405/1715080218cbd45acd0ece817cdb9a6de7296513.jpg) ### 漏洞证明: #证明 这个系统均运行在很高的权限.. 控制下吧 [<img src="https://images.seebug.org/upload/201405/17151041b1614772e89d372232d8120a03ef89d4.jpg" alt="5.jpg" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201405/17151041b1614772e89d372232d8120a03ef89d4.jpg)