源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

在线扫描探测检查asp站点木马后门的程序

  • 时间:2020-10-17 05:58 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:在线扫描探测检查asp站点木马后门的程序
[url=http://www.pifoo.com]</div> </body> </html> <% '遍历处理path及其子目录所有文件 Sub ShowAllFile(Path) Set FSO = createObject("Scripting.FileSystemObject") if not fso.FolderExists(path) then exit sub Set f = FSO.GetFolder(Path) Set fc2 = f.files For Each myfile in fc2 If CheckExt(FSO.GetExtensionName(path&"\"&myfile.name)) and (myfile.size<=maxfilesize) Then Call ScanFile(Path&Temp&"\"&myfile.name, "") SumFiles = SumFiles + 1 End If Next Set fc = f.SubFolders For Each f1 in fc ShowAllFile path&"\"&f1.name SumFolders = SumFolders + 1 Next Set FSO = Nothing End Sub '检测文件 Sub ScanFile(FilePath, InFile) If InFile <> "" Then Infiles = "该文件被<a href=""http://"&Request.Servervariables("server_name")&"\"&InFile&""" target=_blank>"& InFile & "</a>文件包含执行" End If Set FSOs = createObject("Scripting.FileSystemObject") on error resume next set ofile = fsos.OpenTextFile(FilePath) filetxt = Lcase(ofile.readall()) If err Then Exit Sub end if if len(filetxt)>0 then '特征码检查 temp = "<a href=""http://"&Request.Servervariables("server_name")&"\"&replace(FilePath,server.MapPath("\")&"\","",1,1,1)&""" target=_blank>"&replace(FilePath,server.MapPath("\")&"\","",1,1,1)&"</a>" 'Check "WScr"&DoMyBest&"ipt.Shell" If instr( filetxt, Lcase("WScr"&DoMyBest&"ipt.Shell") ) or Instr( filetxt, Lcase("clsid:72C24DD5-D70A"&DoMyBest&"-438B-8A42-98424B88AFB8") ) then Report = Report&"<tr><td>"&temp&"</td><td>WScr"&DoMyBest&"ipt.Shell 或者 clsid:72C24DD5-D70A"&DoMyBest&"-438B-8A42-98424B88AFB8</td><td>危险组件,一般被ASP木马利用。"&infiles&"</td><td>"&GetDatecreate(filepath)&"<br>"&GetDatemodify(filepath)&"</td></tr>" Sun = Sun + 1 End if 'Check "She"&DoMyBest&"ll.Application" If instr( filetxt, Lcase("She"&DoMyBest&"ll.Application") ) or Instr( filetxt, Lcase("clsid:13709620-C27"&DoMyBest&"9-11CE-A49E-444553540000") ) then Report = Report&"<tr><td>"&temp&"</td><td>She"&DoMyBest&"ll.Application 或者 clsid:13709620-C27"&DoMyBest&"9-11CE-A49E-444553540000</td><td>危险组件,一般被ASP木马利用。"&infiles&"</td><td>"&GetDatecreate(filepath)&"<br>"&GetDatemodify(filepath)&"</td></tr>" Sun = Sun + 1 End If 'Check .Encode Set regEx = New RegExp regEx.IgnoreCase = True regEx.Global = True regEx.Pattern = "@\s*LANGUAGE\s*=\s*[""]?\s*(vbscript|jscript|javascript).encode\b" If regEx.Test(filetxt) Then Report = Report&"<tr><td>"&temp&"</td><td>(vbscript|jscript|javascript).Encode</td><td>似乎脚本被加密了,一般ASP文件是不会加密的。"&infiles&"</td><td>"&GetDatecreate(filepath)&"<br>"&GetDatemodify(filepath)&"</td></tr>" Sun = Sun + 1 End If 'Check my ASP backdoor :( regEx.Pattern = "\bEv"&"al\b" If regEx.Test(filetxt) Then Report = Report&"<tr><td>"&temp&"</td><td>Ev"&"al</td><td>e"&"val()函数可以执行任意ASP代码,被一些后门利用。其形式一般是:ev"&"al(X)<br>但是javascript代码中也可以使用,有可能是误报。"&infiles&"</td><td>"&GetDatecreate(filepath)&"<br>"&GetDatemodify(filepath)&"</td></tr>" Sun = Sun + 1 End If 'Check exe&cute backdoor regEx.Pattern = "[^.]\bExe"&"cute\b" If regEx.Test(filetxt) Then Report = Report&"<tr><td>"&temp&"</td><td>Exec"&"ute</td><td>e"&"xecute()函数可以执行任意ASP代码,被一些后门利用。其形式一般是:ex"&"ecute(X)。<br>"&infiles&"</td><td>"&GetDatecreate(filepath)&"<br>"&GetDatemodify(filepath)&"</td></tr>" Sun = Sun + 1 End If Set regEx = Nothing '检查包含文件 Set regEx = New RegExp regEx.IgnoreCase = True regEx.Global = True regEx.Pattern = "<!--\s*#include\s*file\s*=\s*"".*""" Set Matches = regEx.Execute(filetxt) For Each Match in Matches tFile = Replace(Mid(Match.Value, Instr(Match.Value, """") + 1, Len(Match.Value) - Instr(Match.Value, """") - 1),"/","\") If Not CheckExt(FSOs.GetExtensionName(tFile)) Then Call ScanFile( Mid(FilePath,1,InStrRev(FilePath,"\"))&tFile, replace(FilePath,server.MapPath("\")&"\","",1,1,1) ) SumFiles = SumFiles + 1 End If Next Set Matches = Nothing Set regEx = Nothing '检查虚拟目录 Set regEx = New RegExp regEx.IgnoreCase = True regEx.Global = True regEx.Pattern = "<!--\s*#include\s*virtual\s*=\s*"".*""" Set Matches = regEx.Execute(filetxt) For Each Match in Matches tFile = Replace(Mid(Match.Value, Instr(Match.Value, """") + 1, Len(Match.Value) - Instr(Match.Value, """") - 1),"/","\") If Not CheckExt(FSOs.GetExtensionName(tFile)) Then Call ScanFile( Server.MapPath("\")&"\"&tFile, replace(FilePath,server.MapPath("\")&"\","",1,1,1) ) SumFiles = SumFiles + 1 End If Next Set Matches = Nothing Set regEx = Nothing '检查特殊命令:Server&.Execute|Transfer Set regEx = New RegExp regEx.IgnoreCase = True regEx.Global = True regEx.Pattern = "Server.(Exec"&"ute|Transfer)([ \t]*|\()"".*""" Set Matches = regEx.Execute(filetxt) For Each Match in Matches tFile = Replace(Mid(Match.Value, Instr(Match.Value, """") + 1, Len(Match.Value) - Instr(Match.Value, """") - 1),"/","\") If Not CheckExt(FSOs.GetExtensionName(tFile)) Then Call ScanFile( Mid(FilePath,1,InStrRev(FilePath,"\"))&tFile, replace(FilePath,server.MapPath("\")&"\","",1,1,1) ) SumFiles = SumFiles + 1 End If Next Set Matches = Nothing Set regEx = Nothing 'Check Server&.Execute|Transfer Set regEx = New RegExp regEx.IgnoreCase = True regEx.Global = True regEx.Pattern = "Server.(Exec"&"ute|Transfer)([ \t]*|\()[^""]\)" If regEx.Test(filetxt) Then Report = Report&"<tr><td>"&temp&"</td><td>Server.Exec"&"ute</td><td>不能跟踪检查Server.e"&"xecute()函数执行的文件。请管理员自行检查。<br>"&infiles&"</td><td>"&GetDatecreate(filepath)&"<br>"&GetDatemodify(filepath)&"</td></tr>" Sun = Sun + 1 End If Set Matches = Nothing Set regEx = Nothing '检查createobject命令 Crea"&"teObject Set regEx = New RegExp regEx.IgnoreCase = True regEx.Global = True regEx.Pattern = "createO"&"bject[ |\t]*\(.*\)" Set Matches = regEx.Execute(filetxt) For Each Match in Matches If Instr(Match.Value, "&") or Instr(Match.Value, "+") or Instr(Match.Value, """") = 0 or Instr(Match.Value, "(") <> InStrRev(Match.Value, "(") Then Report = Report&"<tr><td>"&temp&"</td><td>Creat"&"eObject</td><td>Crea"&"teObject函数使用了变形技术,仔细复查。"&infiles&"</td><td>"&GetDatecreate(filepath)&"<br>"&GetDatemodify(filepath)&"</td></tr>" Sun = Sun + 1 exit sub End If Next Set Matches = Nothing Set regEx = Nothing end if set ofile = nothing set fsos = nothing End Sub '检查文件后缀,如果与预定的匹配即返回TRUE Function CheckExt(FileExt) If DimFileExt = "*" Then CheckExt = True Ext = Split(DimFileExt,",") For i = 0 To Ubound(Ext) If Lcase(FileExt) = Ext(i) Then  CheckExt = True Exit Function End If Next End Function Function GetDatemodify(filepath) Set fso = createObject("Scripting.FileSystemObject") Set f = fso.GetFile(filepath)  s = f.DateLastModified  set f = nothing set fso = nothing GetDatemodify = s End Function Function GetDatecreate(filepath) Set fso = createObject("Scripting.FileSystemObject") Set f = fso.GetFile(filepath)  s = f.Datecreated  set f = nothing set fso = nothing GetDatecreate = s End Function %>
【asp木马探测器】-在线扫描探测检查asp站点木马后门的程序 可以在线扫描检查探测站点内的所有asp程序代码,检测代码中是否含有危险代码 目前检测的特征码有:CreateObject、Execute、Shell.Application、WScript.Shell、Eval、include......等。 对程序的改进是:增加扩展名后缀列表自定义、扫描文件大小限制、扫描超时限制、session验证改复杂了一点点...... 具体请自己打开原始代码查看。 使用后,要么及时删除,要么将登陆密码改掉,尽量改复杂点。(虽然这个程序不会直接提供在线打开文件的功能,但仍然有可能被hacker利用) 准备下一个修改版本加入检查iframe特征码的功能,目前太多站点都是被人挂了iframe,当然,那只是表现,具体漏洞根源还是在程序或其他方面。 点击这里下载asp木马探测器[/url] [注意:解压密码和默认登陆密码都是[url=http://www.pifoo.com/]www.pifoo.com[/url]] 原作者:雷客图 jspadmin=阿笨狗=飞云 修改于2006.07.07 '获取最新修改版本,请关注[url=http://www.pifoo.com/]http://www.pifoo.com[/url] 'QQ:33323489 Email:subaoliang@etang.com Guestbook:http://www.pifoo.com/lyb
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部