防注入真的有用吗?

本帖最后由 Green_leaves 于 2012-6-15 16:45 编辑

现在网上流传很多|注入代码。这些真的有用吗?这是在网上找的一个防注入代码
例如
<%’’’’--------定义部份------------------
Dim Fy_Post,Fy_Get,Fy_In,Fy_Inf,Fy_Xh,Fy_db,Fy_dbstr
’’’’自定义需要过滤的字串,用 "|" 分隔
Fy_In = "’’’’|;|and|exec|insert|select|delete|update|count|*|%|chr|mid|master|truncate|char|declare|<|>|||-|_"
Fy_Inf = split(Fy_In,"|")
If Request.Form<>"" Then
For Each Fy_Post In Request.Form

For Fy_Xh=0 To Ubound(Fy_Inf)
If Instr(LCase(Request.Form(Fy_Post)),Fy_Inf(Fy_Xh))<>0 Then
Response.Write "<Script Language=JavaScript>alert(’’’’网长友情提示↓ 网站在conn.asp插入上述代码把基本上能过滤的查询语句都过滤了。带式仔细找,貌似一个=(等号)没有过滤。。大家再找找。。。
等等。。
一个等号就可以。。。。当我们我们输入and 1=1和和1=2时出现对话框。。记录了我们的ip和提交方式什么的。
我们是不是可以吧 and变成没有这些字符的语句呢?找了想到 base64字符。我们接着实验。。。成功。

又找了几个站,发现有的可以用这种方法注入。有的不可以。。大家不妨在注入的时候试一下。

QQ截图20120222212413.pngQQ截图20120222212747.png

stopsqlin.zip
有时间大家试试这个,也是防注入代码 <%
dim sql_injdata ,SQL_inj,SQL_Get,SQL_Post,SQL_Cookies,SQL_Data
SQL_injdata = "<%|script|insert|select|delete|exec|cast|update|chr|master|truncate|declarei|eval"
if stopwords<>"" and instr(LCase(Request.ServerVariables("PATH_INFO")),"siteconfig.asp")=0 then
SQL_injdata= SQL_injdata&"|"&stopwords
end if
SQL_inj = split(SQL_Injdata,"|")

if checksqlin="Yes" then
	If Request.Form<>"" Then StopInjection(Request.Form)
	If Request.QueryString<>"" Then StopInjection(Request.QueryString)
	If Request.Cookies<>"" Then StopInjection(Request.Cookies)
end if

Function StopInjection(values)
For Each SQL_Get In values
For SQL_Data=0 To Ubound(SQL_inj)
'if instr(LCase(request(SQL_Get)),Sql_Inj(Sql_DATA))>0 Then
if instr(LCase(replace(request(SQL_Get),chr(34),"'")),Sql_Inj(Sql_DATA))>0 Then
'“"”无法直接写入到变量“SQL_injdata”中,在这里替换“"”为“'”提示之
Response.Write "<script>alert('检测到非法信息,已禁止本次提交!');history.back()</script>"
Response.end
end if
next
Next
end function
%>

回帖内容很长,我已写成单独的帖子,楼主请看这里:

http://www.90sec.org/thread-1555-1-1.html

楼主你有点坑爹了。。base64编码你放上去asp的网站能解析?

我想说...母用的.这个一般都是在conn那调用的吧

**回复 4# 风之传说 **

这个你可以去试验。。。再说这个好多用在url加密。比如说讯雷的下载地址加密。。。我昨晚试验成功了。

**回复 6# 798146410 **

恩 那要取决于程序怎么写。

楼主你有点坑爹了。。base64编码你放上去asp的网站能解析?
风之传说 发表于 2012-2-23 09:48 [[img]http://www.90sec.org/images/common/back.gif[/img\]](http://www.90sec.org/redirect.php?goto=findpost&pid=15994&ptid=1554)

我觉得也是,直接get了参数就直接嵌入到sql查询里面了有的网站,这样不可能可以自动解码base64啊,对吧

回帖内容很长,我已写成单独的帖子,楼主请看这里:
核攻击 发表于 2012-2-22 23:58 [[img]http://www.90sec.org/images/common/back.gif[/img\]](http://www.90sec.org/redirect.php?goto=findpost&pid=15965&ptid=1554)

核老大,来这边了?

必须学习学习。。