protected void application_beginrequest(object sender, eventargs e)
{
//遍历post参数,隐藏域除外
foreach (string i in this.request.form)
{
if (i == "__viewstate") continue;
this.goerr(this.request.form[i].tostring());
}
//遍历get参数。
foreach (string i in this.request.querystring)
{
this.goerr(this.request.querystring[i].tostring());
}
}
private void goerr(string tm)
{
if (sqlfilter2(tm))
{
response.redirect("p404.html");
response.end();
}
}
public static bool sqlfilter2(string intext)
{
string word = "and|exec|insert|select|delete|update|chr|mid|master|or|truncate|char|declare|join";
if (intext == null)
return false;
foreach (string i in word.split('|'))
{
if ((intext.tolower().indexof(i + " ") > -1) || (intext.tolower().indexof(" " + i) > -1))
{
return true;
}
}
return false;
}
摘自 bql_email的专栏
如对本文有疑问, 点击进行留言回复!!
Pytorch 结合Sobel滤波的卷积操作来提取图像的轮廓图!
让Sublime Text3 支持 Markdown 且可以实时预览
荐 2020最全前端面试系列(浏览器原理)(最容易忽视的面试隐藏大杀器)
网友评论