7月5

比翼马收信系统赏析

| |
19:42    ukidhulei 本站原创   From: 本站原创 不指定
         比翼马虽然让中国广大游戏爱好者深痛恶绝,但它的技术含量还是值得肯定的。本文只做技术探讨,不代表本站赞成其观点。

          精彩代码赏析:
                1.
if sDataPath=sDataPathCheck AND sdo="" then
   UrlRedirect("?Game=biyima&do=setup")
end if


if sDataPath=sDataPathCheck then '如果数据库路径未改
   newDataPath="biyima-#-"&md5(now)&".aspx" '新数据库名称为biyima-#-加安装时间的MD5值.aspx

                              检查数据库名称是否改变,未改变则为初次安装,跳到安装段(会更改数据库名称),增加了安全性。

                 2.
function LevelLight(tValue)
  if cint(tValue)>sLevelLight then
       LevelLight="<font color='red'>"&tValue&"</font>"
  else
       LevelLight=tValue
  end if
end function

                              检查所盗的号的等级,高于设定的值则加红色。

                 3.
'======================================== 防SQL注入(高效精简版,可还原) =========
function CheckSQL(theCode)
   if theCode<>"" then
   theCode=trim(theCode) '过滤左右空格
   theCode=replace(theCode,"-","{$line$}")
   theCode=replace(theCode,"%","{$percent$}") '防编码
   theCode=replace(theCode,"&","{$AndCode$}") '防编码
   theCode=replace(theCode,"and","{$an.d$}")
   theCode=replace(theCode,"or","{$o.r$}")
   theCode=replace(theCode,"insert","{$inser.t$}")
   theCode=replace(theCode,"update","{$updat.e$}")
   theCode=replace(theCode,"select","{$selec.t$}")
   theCode=replace(theCode,"execute","{$execut.e$}") '防一句话木马 %execute request("value")%
   theCode=replace(theCode,"eval","{$eva.l$}") '防一句话木马  JSCRIPT的eval
   theCode=replace(theCode,"'","&#39;")
   end if
   CheckSQL=theCode
end function
'======================================== 编码还原 =========
function ClearHTML(theCode)
   if theCode<>"" then
   theCode=replace(theCode,"<","&lt;")
   theCode=replace(theCode,"{$line$}","-")
   theCode=replace(theCode,"{$percent$}","%")
   theCode=replace(theCode,"{$AndCode$}","&")
   theCode=replace(theCode,"{$an.d$}","and")
   theCode=replace(theCode,"{$o.r$}","or")
   theCode=replace(theCode,"{$inser.t$}","insert")
   theCode=replace(theCode,"{$updat.e$}","update")
   theCode=replace(theCode,"{$selec.t$}","select")
   theCode=replace(theCode,"{$execut.e$}","execute")
   theCode=replace(theCode,"{$eva.l$}","eval")
   end if
   response.Write(theCode)
end function

                            将特殊字符转换存储,输出时在还原达到防注入。

原文件贴出来下……
下载文件 (已下载 483 次)

                            
阅读(4583) | 评论(3) | 引用(0)
jianyongjian Homepage
12/15/2008 09:57
kill
ukidhulei 回复于 12/17/2008 01:24
别动刀……

            我怕怕……
54654 Email Homepage
09/18/2008 14:45
我要号
ukidhulei 回复于 09/19/2008 15:40
这个版本已过期……  这里只做技术探讨啦!~~
游客
08/06/2008 13:35
zan
ukidhulei 回复于 08/07/2008 12:24
shy谢谢!~
分页: 1/1 第一页 1 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]