惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

The Hacker News
The Hacker News
MyScale Blog
MyScale Blog
Hugging Face - Blog
Hugging Face - Blog
WordPress大学
WordPress大学
GbyAI
GbyAI
罗磊的独立博客
M
MIT News - Artificial intelligence
J
Java Code Geeks
P
Proofpoint News Feed
月光博客
月光博客
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Google DeepMind News
Google DeepMind News
The Cloudflare Blog
T
The Blog of Author Tim Ferriss
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
雷峰网
雷峰网
V
V2EX
有赞技术团队
有赞技术团队
Microsoft Security Blog
Microsoft Security Blog
博客园 - Franky
IT之家
IT之家
博客园 - 三生石上(FineUI控件)
Webroot Blog
Webroot Blog
S
Secure Thoughts
Recent Announcements
Recent Announcements
T
Troy Hunt's Blog
Engineering at Meta
Engineering at Meta
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Hacker News: Ask HN
Hacker News: Ask HN
酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
Schneier on Security
Schneier on Security
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
H
Heimdal Security Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Cyberwarzone
Cyberwarzone
N
News and Events Feed by Topic
T
Threat Research - Cisco Blogs
Martin Fowler
Martin Fowler
Hacker News - Newest:
Hacker News - Newest: "LLM"
Microsoft Azure Blog
Microsoft Azure Blog
Help Net Security
Help Net Security
S
SegmentFault 最新的问题
A
Arctic Wolf
C
Cybersecurity and Infrastructure Security Agency CISA
V
Vulnerabilities – Threatpost
腾讯CDC
K
Kaspersky official blog
博客园_首页

博客园 - 江湖工夫

TextBox控件TextMode=Password时赋值 [转]随滚动条滚动的层(支持IE6,FF2) Iframe页面内容变更页面自动改变大小(非加载时自适应大小) 抓取网络文件的URL地址作附件发送 Visual SourceSafe应用守则[转] Microsoft SQL Server 分析服务 SQL中使用DISTINCT显示多个字段的方法(不使用DISTINCT了) GridView分页后跳转其他页面进行添加,编辑,删除操作后,仍返回到当前页码[原] Ajax的按钮事件效果 层的移动,使用了jquery asp.net(C#)处理数据一个通用类,包括存储过程,适用于初学者[转] IE和Firefox在JavaScript方面的兼容性(汇编) asp.net 对xml文件的读写,添加,修改,删除操作[转] 一些动画进度的图标链接 邹建的通用分页存储过程[转] 一个存储过程实现将Excel数据导入数据库 SQL SERVER事务处理[转] SQL与MDX语法的比较 一个存储过程
SQL注入的漏洞,过滤httprequest
江湖工夫 · 2008-05-09 · via 博客园 - 江湖工夫

在Global.asax文件中

protected void Application_BeginRequest(Object sender, EventArgs e)
        
{
            
//SQL防注入
            string Sql_1 = "exec|insert+|select+|delete|update|count|chr|mid|master+|truncate|char|declare|drop+|drop+table|creat+|creat+table";
            
string Sql_2 = "exec+|insert+|delete+|update+|count(|count+|chr+|+mid(|+mid+|+master+|truncate+|char+|+char(|declare+|drop+|creat+|drop+table|creat+table";
            
string[] sql_c = Sql_1.Split('|');
            
string[] sql_c1 = Sql_2.Split('|');
  
            
if(Request.QueryString != null)
            
{
                
foreach (string sl in sql_c)
                
{
                    
if(Request.QueryString.ToString().ToLower().IndexOf(sl.Trim()) >=0)
                    
{
                        Response.Write(
"警告!你的IP已经被记录!");//吓唬人的
                        Response.Write(sl);
                        Response.Write(Request.QueryString.ToString());
                        
//System.Windows.Forms.MessageBox.Show("禁止提交外部数据","1",System.Windows.F
                        
//orms.MessageBoxButtons.OK,System.Windows.Forms.MessageBoxIcon.Error,System.Windows.Forms.MessageBoxDefaultButton.Button1,System.Windows.Forms.MessageBoxOptions.DefaultDesktopOnly);
                        
//Response.Redirect("http://www.163.com");
                        Response.End();
                        
break;
                    }

                }

            }

   
            
if(Request.Form.Count > 0)
            
{
    
                
string s1 = Request.ServerVariables["SERVER_NAME"].Trim();//服务器名称
                if(Request.ServerVariables["HTTP_REFERER"!= null)
                
{
                    
string s2 = Request.ServerVariables["HTTP_REFERER"].Trim();//http接收的名称
                    string s3 = "";
                    
if(s1.Length > (s2.Length -7))
                    
{
                        s3 
= s2.Substring(7);
                    }

                    
else
                    
{
                        s3 
= s2.Substring(7,s1.Length);
                    }

                    
if(s3 != s1)
                    
{
                        Response.Write(
"你的IP已被记录!警告!");//吓人的
                        
//System.Windows.Forms.MessageBox.Show("禁止提交外部数据","1",System.Windows.Forms.MessageBoxButtons.OK,Sy
                        
//stem.Windows.Forms.MessageBoxIcon.Error,System.Windows.Forms.MessageBoxDefaultButton.Button1,System.Windows.Forms.MessageBoxOptions.DefaultDesktopOnly);
                        
//Response.Redirect("http://www.163.com");
                        Response.End();
                    }

                }
 
            }

        }