MATCH (source:Method {NAME:"invoke", PARAMETER_SIZE:3}) WHERE ( source.CLASSNAME STARTS WITH "com.rctf.server.tool." OR source.CLASSNAME STARTS WITH "java.util." OR source.CLASSNAME STARTS WITH "org.apache.commons.logging." OR source.CLASSNAME STARTS WITH "org.springframework.beans." OR source.CLASSNAME STARTS WITH "org.springframework.jndi." )
// 2. 查找 Sink (出口) // 直接指定类名和方法名 MATCH (sink:Method {NAME:"getBean", CLASSNAME:"org.springframework.jndi.support.SimpleJndiBeanFactory"}) where sink.SUB_SIGNATURE ="java.lang.Object getBean(java.lang.String,java.lang.Class)"
WHERE ALL(n IN nodes(path) WHERE n.CLASSNAME STARTS WITH "com.rctf.server.tool." OR n.CLASSNAME STARTS WITH "java.util." OR n.CLASSNAME STARTS WITH "org.apache.commons.logging." OR n.CLASSNAME STARTS WITH "org.springframework.beans." OR n.CLASSNAME STARTS WITH "org.springframework.jndi." )
classInvokerHandlerextendsClass { InvokerHandler() { this.getASupertype*().getQualifiedName() = "java.lang.reflect.InvocationHandler" and ( this.getQualifiedName().regexpMatch("java.util.+") or this.getQualifiedName().regexpMatch("org.apache.commons.logging.+") or this.getQualifiedName().regexpMatch("org.springframework.beans.+") or this.getQualifiedName().regexpMatch("org.springframework.jndi.+") ) } }
classHessianObjectFactoryextendsMethod { HessianObjectFactory() { // this.getASupertype*().getQualifiedName() = "org.springframework.beans.factory.ObjectFactory" this.getName() = "getObject" and this.hasNoParameters() and ( this.getQualifiedName().regexpMatch("java.util.+") or this.getQualifiedName().regexpMatch("org.apache.commons.logging.+") or this.getQualifiedName().regexpMatch("org.springframework.beans.+") or this.getQualifiedName().regexpMatch("org.springframework.jndi.+") ) } }
// from HessianObjectFactory i, DangerousMethod m // where i.calls(m) // select i from DangerousMethod m select m, m.getName()