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

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - leohuang

C#日期函数使用大全 replace(/\s/g,"")中的/g是什么意思? 及replace函数的用法 - leohuang - 博客园 Timestamp (rowversion) Data Type 为什么就没有中文版 数据库设计和优化 的书呢 - leohuang 巧用httpModules实现网站域名更换 asp.net 下发布水晶报表调试经验 C#操作Access的一些小结 - leohuang Photoshop制作Favicon.ico图标(转载) 取消ie6自动打开excel - leohuang - 博客园 oracle多表查询分页 库存出入库算法 Page_Load为什么会执行两次 - leohuang - 博客园 Windows Service开发日志(转载csdn) IFrame 下返回登录页 访问母板页的updatepanel 及 设置 密码框字符 - leohuang 垃圾的江苏电信 amd 2500 boot设置 总算下到 Expert C# 2008 Business Objects 了 读《Expert C# 2005 Business Object》 - leohuang
asp网站(asp+access)怎么防注入呢
leohuang · 2009-09-21 · via 博客园 - leohuang

2009-09-02 11:10:48

近日有部分黑客通过我们网站进行sql注入来实现他的黑客成功的喜悦,多次造成本公司门户网站(http://www.gogochina.cn/)显示不正常,甚至内容和后台管理都无法进行.因此本人也是多次进行文件的上传工作,使得网站也是多次受到客户的对我提出为什么网站又无法打开或是打开内容显示不全等.

  今天本人在网上搜了一些有关asp+access网上的sql注入问题的解决与防sql注入代码以及防sql代码注放在那个文件等.经多方查找和对比本人找到不少有关文件.其中最新祥细的我也来出与大家分享一下:

---------------------------------------------------------------------------------------------
以下为代码内容:放入conn.asp中(拒绝攻击 万能Asp防注入代码)
第一种:
squery=lcase(Request.ServerVariables("QUERY_STRING"))
sURL=lcase(Request.ServerVariables("HTTP_HOST"))

SQL_injdata =":|;|>|<|--|sp_|xp_|\|dir|cmd|^|(|)|+|$|'|copy|format|and|exec|insert|select|delete|update|count|*|%|chr|mid|master|truncate|char|declare"

SQL_inj = split(SQL_Injdata,"|")

For SQL_Data=0 To Ubound(SQL_inj)
if instr(squery&sURL,Sql_Inj(Sql_DATA))>0 Then
Response.Write "SQL通用防注入系统"
Response.end
end if
next

第二种:
SQL_injdata =":|;|>|<|--|sp_|xp_|\|dir|cmd|^|(|)|+|$|'|copy|format|and|exec|insert|select|delete|update|count|*|%|chr|mid|master|truncate|char|declare"

SQL_inj = split(SQL_Injdata,"|")
If Request.QueryString<>"" Then
For Each SQL_Get In Request.QueryString
For SQL_Data=0 To Ubound(SQL_inj)
if instr(Request.QueryString(SQL_Get),Sql_Inj(Sql_DATA))>0 Then
Response.Write "SQL通用防注入系统"
Response.end
end if
next
Next
End If

If Request.Form<>"" Then
For Each Sql_Post In Request.Form
For SQL_Data=0 To Ubound(SQL_inj)
if instr(Request.Form(Sql_Post),Sql_Inj(Sql_DATA))>0 Then
Response.Write "SQL通用防注入系统"
Response.end
end if
next
next
end if

本文出自 51CTO.COM技术博客