ASP只允许指定IP访问网站管理后台 黑客有帐号密码也没用
2018-09-06 12:35
  后台限制IP访问 只允许指定IP 访问后台黑客有后台帐号密码也没用
 '下面的例子只允许127.0.0.1登陆后台 或者10.110.8.8
 10.110.8.8 这个是管理员自己的远程IP
 '限制指定IP断 黑客就算得到后台密码 也无法登陆
 adminIP=Request.ServerVariables("REMOTE_ADDR")
 if (left(adminIP,10)="110.8.8") or (adminIP="127.0.0.1") then
 '允许执行
 else
 Response.Write"<script language=javascript>alert('非指定IP段,不允许访问后台!\r\n你可以到拉登哥哥Blog学习下');location.href='';</script>"
 response.end
 end if
 你也可以改成这样 只允许127.0.0.1访问 就是说只有在服务器上才能访问了
 adminIP=Request.ServerVariables("REMOTE_ADDR")
 if adminIP="127.0.0.1" then
 '允许执行
 else
 Response.Write"<script language=javascript>alert('非指定IP段,不允许访问后台!\r\n你可以到拉登哥哥Blog学习下'); location.href='';</script>"
 response.end
 end if
下一篇:ASP中页面限权访问的几种方法
文章标题:ASP只允许指定IP访问网站管理后台 黑客有帐号密码也没用
文章链接:http://soscw.com/index.php/essay/10470.html