publicbooleancheckSQLInjection(Stringmodel0){booleanresult=false;Stringmodel=model0.toLowerCase();if(!model.contains(" or ")&&!model.contains("'or ")&&!model.contains("||")&&!model.contains("==")&&!model.contains("--")){if(model.contains("union")&&model.contains("select")){if(this.checkCommentStr(model,"union","select")){result=true;}}elseif(model.contains("case")&&model.contains("when")){if(this.checkCommentStr(model,"case","when")){result=true;}}elseif(model.contains("into")&&model.contains("dumpfile")){if(this.checkCommentStr(model,"into","dumpfile")){result=true;}}elseif(model.contains("into")&&model.contains("outfile")){if(this.checkCommentStr(model,"into","outfile")){result=true;}}elseif(model.contains(" where ")&&model.contains("select ")){result=true;}elseif(model.contains("benchmark")){result=true;}elseif(model.contains("select")&&model.contains("from")){if(this.checkCommentStr(model,"select","from")){result=true;}}elseif(model.contains("select/*")){result=true;}elseif(model.contains("delete")&&model.contains("from")){if(this.checkCommentStr(model,"delete","from")){result=true;}}elseif(model.contains("drop")&&model.contains("table")||model.contains("drop")&&model.contains("database")){if(this.checkCommentStr(model,"drop","table")){result=true;}if(this.checkCommentStr(model,"drop","database")){result=true;}}elseif(!model.contains("sleep(")&&!model.contains(" rlike ")&&!model.contains("rlike(")&&!model.contains(" like ")){if(model.startsWith("'")&&model.endsWith("#")&&model.length()>5){result=true;}elseif((model.startsWith("9999'")||model.endsWith("#9999")||model.contains("#9999"))&&model.length()>10){result=true;}elseif(model.contains("getRuntime().exec")||model.contains("getruntime().exec")||model.contains("getRuntime()")){result=true;}}else{result=true;}}else{result=true;}if(result){System.out.println("Error: SQL Injection Vulnerability detected in ["+model0+"]");}returnresult;}