public partial class SecretUtil { //正則過濾字符 private const string StrRegex = @"<[^>]+?style=[\w]+?:expression\(|\b(alert|confirm|prompt)\b|^\+/v(8|9)|<[^>]*?=[^>]*?&#[^>]*?>|\b(and|or)\b.{1,6}?(=|>|<|\bin\b|\blike\b)|/\*.+?\*/|<\s*script\b|<\s*img\b|\bEXEC\b|UNION.+?SELECT|UPDATE.+?SET|INSERT\s+INTO.+?VALUES|(SELECT|DELETE).+?FROM|(CREATE|ALTER|DROP|TRUNCATE)\s+(TABLE|DATABASE)"; /// <summary> /// POST請(qǐng)求 /// </summary> /// <param name="putData">輸出非法字符串</param> /// <returns></returns> public static bool PostData(out string putData) { bool result = false; putData = string.Empty; for (int i = 0; i < HttpContext.Current.Request.Form.Count; i++) { result = CheckData(HttpCo
文章來源地址http://www.zghlxwxcb.cn/news/detail-501390.html
文章來源:http://www.zghlxwxcb.cn/news/detail-501390.html
到了這里,關(guān)于防御諸如跨站腳本攻擊XSS)、SQL注入攻擊等惡意攻擊的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!