gu.sql2java.manager.parser.InjectionAstNodeVisitor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sql2java-manager Show documentation
Show all versions of sql2java-manager Show documentation
sql2java manager class package for accessing database
The newest version!
package gu.sql2java.manager.parser;
import net.sf.jsqlparser.parser.CCJSqlParserDefaultVisitor;
import net.sf.jsqlparser.parser.SimpleNode;
import net.sf.jsqlparser.statement.select.UnionOp;
/**
* 基于抽象语法树(AST)的注入攻击分析实现
* @author guyadong
*
*/
public class InjectionAstNodeVisitor extends CCJSqlParserDefaultVisitor{
public InjectionAstNodeVisitor() {
}
@Override
public Object visit(SimpleNode node, Object data) {
Object value = node.jjtGetValue();
if(value instanceof UnionOp){
throw new InjectionAttackException("DISABLE UNION");
}
return super.visit(node, data);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy