All Downloads are FREE. Search and download functionalities are using the official Maven repository.

gu.sql2java.manager.parser.InjectionAstNodeVisitor Maven / Gradle / Ivy

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