沈阳市安全局:asp代码解除判断是否直接输入地址访问本系统的后台管理页面的限制

来源:百度文库 编辑:高校问答 时间:2024/04/29 09:59:19
下面是一段代码他限制了你直接输入后台地址登入!
要怎么改才能解除限制!
我是在IIS上测试的时候,无论我怎么输入!他都会提示对不起,为了系统安全,不允许直接输入地址访问本系统的后台管理页

面。
但是我的服务器上测试就不会!

' ============================================
' 判断是否直接输入地址访问本系统的后台管理页面
' ============================================
sub ComeUrl
dim ComeUrl,cUrl
ComeUrl=lcase(trim(request.ServerVariables("HTTP_REFERER")))
if ComeUrl="" then
response.write "<br><p align=center><font color='red'>对不起,为了系统安全,不允许直接输入地址访问本系统的后台管理页

面。</font></p>"
response.end
else
cUrl=trim("http://" & Request.ServerVariables("SERVER_NAME"))
if mid(ComeUrl,len(cUrl)+1,1)=":" then
cUrl=cUrl & ":" & Request.ServerVariables("SERVER_PORT")
end if
cUrl=lcase(cUrl & request.ServerVariables("SCRIPT_NAME"))
if lcase(left(ComeUrl,instrrev(ComeUrl,"/")))<>lcase(left(cUrl,instrrev(cUrl,"/"))) then
response.write "<br><p align=center><font color='red'>对不起,为了系统安全,不允许从外部链接地址访问本系统的

后台管理页面。</font></p>"
response.end
end if
end if
end sub
也可以提示我这样设置IIS!

回答者:lwping0214我刚刚测试了一下!不可以啊!
回答者: tjoy7d 去掉这段,网页无法显示啊!

sub ComeUrl
dim ComeUrl,cUrl
ComeUrl=lcase(trim(request.ServerVariables("HTTP_REFERER")))

cUrl=trim("http://" & Request.ServerVariables("SERVER_NAME"))
if mid(ComeUrl,len(cUrl)+1,1)=":" then
cUrl=cUrl & ":" & Request.ServerVariables("SERVER_PORT")
end if
cUrl=lcase(cUrl & request.ServerVariables("SCRIPT_NAME"))
if lcase(left(ComeUrl,instrrev(ComeUrl,"/")))<>lcase(left(cUrl,instrrev(cUrl,"/"))) then
response.write "<br><p align=center><font color='red'>对不起,为了系统安全,不允许从外部链接地址访问本系统的

后台管理页面。</font></p>"
response.end
end if
end sub

你把这段判断URL来源的程序去掉不就可以了么?