asp get和post数据接收过滤
来源:asp之家 发布时间:2011-04-06 10:52:00
代码如下:
<%
'--------定义部份------------------
Dim XH_Post,XH_Get,XH_In,XH_Inf,XH_Xh,XH_db,XH_dbstr
'自定义需要过滤的字串,用 "|" 分隔
XH_In = "'|;|and|exec|insert|select|delete%20from|update|count|*|%|chr|mid|master|truncate|char|declare|drop%20table|from|net%20user|xp_cmdshell|/add|net%20localgroup%20administrators|Asc|char"
'----------------------------------
%>
<%
XH_Inf = split(XH_In,"|")
'--------POST部份------------------
If Request.Form<>"" Then
For Each XH_Post In Request.Form
For XH_Xh=0 To Ubound(XH_Inf)
If Instr(LCase(Request.Form(XH_Post)),XH_Inf(XH_Xh))<>0 Then
Response.Write "<Script Language=JavaScript>alert('请不要在参数中包含非法字符尝试注入!');</Script>"
Response.Write "非法操作!系统做了如下记录↓<br>"
Response.Write "操作IP:"&Request.ServerVariables("REMOTE_ADDR")"<br>"
Response.Write "操作时间:"&Now"<br>"
Response.Write "操作页面:"&Request.ServerVariables("URL")"<br>"
Response.Write "提交方式:POST<br>"
Response.Write "提交参数:"&XH_Post"<br>"
Response.Write "提交数据:"&Request.Form(XH_Post)
Response.End
End If
Next
Next
End If
'----------------------------------
'--------GET部份-------------------
If Request.QueryString<>"" Then
For Each XH_Get In Request.QueryString
For XH_Xh=0 To Ubound(XH_Inf)
If Instr(LCase(Request.QueryString(XH_Get)),XH_Inf(XH_Xh))<>0 Then
Response.Write "<Script Language=JavaScript>alert('请不要在参数中包含非法字符尝试注入!');</Script>"
Response.Write "非法操作!系统做了如下记录↓<br>"
Response.Write "操作IP:"&Request.ServerVariables("REMOTE_ADDR")"<br>"
Response.Write "操作时间:"&Now"<br>"
Response.Write "操作页面:"&Request.ServerVariables("URL")"<br>"
Response.Write "提交方式:GET<br>"
Response.Write "提交参数:"&XH_Get"<br>"
Response.Write "提交数据:"&Request.QueryString(XH_Get)
Response.End
End If
Next
Next
End If
'----------------------------------
%>
猜你喜欢
- 前面介绍了python在ubuntu16.04环境下,python的虚拟环境virtualenv的安装,下面介绍在windows环境下的安装
- 以发布目录为例:<OBJECT ID="agobjOraSession" RUNAT=&quo
- 一些简单的代码简化下面是一个简单示例,它说明了 jQuery 对代码的影响。要执行一些真正简单和常见的任务,比方说为页面的某一区域中的每个链
- tkinter库:Python的标准Tk GUI工具包的接口示例:from tkinter import *root = Tk()#你的ui
- 引子编程世界里只存在两种基本元素,一个是数据,一个是代码。编程世界就是在数据和代码千丝万缕的纠缠中呈现出无限的生机和活力。数据天生就是文静的
- declare @i int set @i='a' &
- 这是我使用python写的第一个类(也算是学习面向对象语言以来正式写的第一个解耦的类),记录下改进的过程。分析需求最初,因为使用time模块
- 学习自然语言的最好方法就是溶入相应的语言环境在交流中学习,学习一种编程语言的最好方法就是看例程。为了帮助大家建立wml应用的第一印象,所以请
- 前言Pycharm学习过程中,每次在一个Pycharm窗口建立一个新的文件夹,都需要重新配置anaconda环境。由于本人是初学者,所以写一
- mysql基础数据类型mysql常用数据类型概览![1036857-20170801181433755-146301178](D:\笔记\m
- 优先级两者放置相同条件,之所以可能会导致结果集不同,就是因为优先级。on的优先级是高于where的。首先明确两个概念:LEFT JOIN 关
- 1 Video介绍引用我翻译文档《在HTML5页面中嵌入音频和视频》中的介绍文字:“当今,在网页上嵌入视频且所有用户不管使用任何浏览器或者操
- 微服务架构在现代软件开发中日益普及,它将复杂的应用程序拆分成多个可独立部署的小型服务。本文将介绍如何使用 Python 的 FastAPI
- Xception是继Inception后提出的对Inception v3的另一种改进,学一学总是好的什么是Xception模型Xceptio
- 简要讨论为什么它不提供++作为运算符 正常情况下,当有人问起++原因而不是Python中的运算符时,这一行引起了我的注意。如果您想知道最初的
- 在mysql的手册中已经对max_user_connections有一点说明,它是用来限制用户资源的,怎么限制用户资源呢?这里做了个小测试。
- 一、python批量解压提示:如果是重要数据解压前请先备份,解压后会覆盖原压缩文件!!解压前:解压后:文件名为英文:文件名中包含中文:代码如
- 项目总览创建虚拟环境mkvirtualenv meiduo_malls创建项目django-admin startproject meidu
- IPython是Python的交互式Shell,提供了代码自动补完,自动缩进,高亮显示,执行Shell命令等非常有用的特性。特别是它的代码补
- 1.regex-coach ——正则表达式工具2. IECookiesView——IE的cookie查看工具3.Flex Trace Pan