GET方式SQL注入攻击网站入侵防守代码.

GET方式SQL注入攻击网站入侵防守代码.,第1张

概述GET方式SQL注入攻击网站入侵防守代码. '--------------------------------------------------------------------------http://61.144.185.39/System_BBS_ShowInfo.asp?pid=1&cid=8';exec%20master.dbo.xp_cmdshe... GET方式sql注入攻击网站入侵防守代码.
'--------------------------------------------------------------------------
http://61.144.185.39/System_BBS_ShowInfo.asp?pID=1&cID=8';exec%20master.dbo.xp_cmdshell%20"net user test test /add;--&aID=8&sID=4&page=1
http://61.144.185.39/System_BBS_ShowInfo.asp?pID=1&cID=8';exec%20master.dbo.xp_cmdshell%20"net localgroup administrators test /add;--&aID=8&sID=4&page=1
'--------------------------------------------------------
以上代码即为sql inject即sql注入攻击网站方案.
如果以上的系统采用的是sql数据库而且是SA帐号.
且无以下代码作为防守.则以上代码执行后的结果就是
机器上的超管组增加一个TEST用户.

闲人勿试以上代码,否则被网警....与本人无关......

以下代码仅供WEB工作者使用.

qs=request.servervariables("query_string")
dim nothis(18)
nothis(0)="net user"
nothis(1)="xp_cmdshell"
nothis(2)="/add"
nothis(3)="exec%20master.dbo.xp_cmdshell"
nothis(4)="net localgroup administrators"
nothis(5)="select"
nothis(6)="count"
nothis(7)="asc"
nothis(8)="char"
nothis(9)="mID"
nothis(10)="'"
nothis(11)=":"
nothis(12)=""""
nothis(13)="insert"
nothis(14)="delete"
nothis(15)="drop"
nothis(16)="truncate"
nothis(17)="from"
nothis(18)="%"
errc=false
for i= 0 to ubound(nothis)
if instr(Qs,nothis(i))<>0 then
errc=true
end if
next
if errc then
response.write "<script language=""JavaScript"">"
response.write "parent.alert('很抱歉!你正在试图攻击本服务器或者想取得本服务器最高管理权!将直接转向首页..');"
response.write "self.location.href='default.asp';"
response.write "</script>"
response.end
end if


--------------------

以上只能防止GET方式的sql注入攻击.
采用的时候只须在接受任何参数前使用即可.
可以依需要增加过滤参数.
马上把此代码加入到conn.asp中.
可以增加一定的安全强度.但并不是绝对安全.

POST防守方式要小心过滤一些必要的参数. 总结

以上是内存溢出为你收集整理的GET方式SQL注入攻击网站入侵防守代码.全部内容,希望文章能够帮你解决GET方式SQL注入攻击网站入侵防守代码.所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/1220025.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-05
下一篇 2022-06-05

发表评论

登录后才能评论

评论列表(0条)

保存