JSP页面SQL注入简单处理

方法如下:

      

public static String getFormatPara(String str) {
		String formatStr = "";
		if (str != null) {
			formatStr = str.replace("00:00:00.0", "").replace(":00.0", "").replace("'", "").replace("\"", "").replace("<", "").replace(">", "").replace("script", "").replace(" or ", "").replace(
					" and ", "").replace("-", "").replace("iframe", "").replace(" href ", "").replaceAll(".*([';]+|(--)+).*", " ").trim();
		}
		return formatStr;
	}

转载于:https://my.oschina.net/7shell/blog/108147

你可能感兴趣的:(JSP页面SQL注入简单处理)