ASP写的查ASP***的小东东,在肉鸡上使用,拿来把其他同行的webshell给接管掉~
说明:查asp、cer、cdx、asa及其嵌套调用的任意格式文件(图片asp***之类格查无论)
ASP写的查ASP***的小东东,在肉鸡上使用,拿来把其他同行的webshell给接管掉~
说明:查asp、cer、cdx、asa及其嵌套调用的任意格式文件(图片asp***之类格查无论)密码为pass!下载后,存为asp文件,上传至肉鸡上的web目录,然后访问此文件!
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
'设置密码
PASSWORD = "pass"
dim Report
if request.QueryString("act")="login" then
 if request.Form("pwd") = PASSWORD then session("pig")=1
end if
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "[url]http://www.w3.org/TR/html4/loose.dtd[/url]">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>ASPSecurity for Hacking</title>
</head>
<body>
<%If Session("pig") <> 1 then%>
<form name="form1" method="post" action="?act=login">
  <div align="center">Password:
    <input name="pwd" type="password" size="15">
    <input type="submit" name="Submit" value="提交">
  </div>
</form>
<%
else
 if request.QueryString("act")<>"scan" then
%>
    <form action="?act=scan" method="post">
    <b>填入你要检查的路径:</b>
    <input name="path" type="text" style="border:1px solid #999" value="." size="30" />
    <br>
    * 网站根目录的相对路径,填“\”即检查整个网站;“.”为程序所在目录
    <br>
    <br>
    <input type="submit" value=" 开始扫描 " style="background:#fff;border:1px solid #999;padding:2px 2px 0px 2px;margin:4px;border-width:1px 3px 1px 3px" />
    </form>
<%
 else
  server.ScriptTimeout = 600
  DimFileExt = "asp,cer,asa,cdx"
  Sun = 0
  SumFiles = 0
  SumFolders = 1
  if request.Form("path")="" then
   response.Write("No Hack")
   response.End()
  end if
  timer1 = timer
  if request.Form("path")="" then
   TmpPath = Server.MapPath("")
  elseif request.Form("path")="." then
   TmpPath = Server.MapPath(".")
  else
   TmpPath = Server.MapPath("")&""&request.Form("path")
  end if
  Call ShowAllFile(TmpPath)
%>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="CContent">
  <tr>
    <th>ASPSecurity For Hacking
  </tr>
  <tr>
    <td class="CPanel" style="padding:5px;line-height:170%;clear:both;font-size:12px">
        <div id="updateInfo" style="background:ffffe1;border:1px solid #89441f;padding:4px;display:none"></div>
扫描完毕!一共检查文件夹<font color="#FF0000"><%=SumFolders%></font>个,文件<font color="#FF0000"><%=SumFiles%></font>个,发现可疑点<font color="#FF0000"><%=Sun%></font>个
 <table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
   <td valign="top">
    <table width="100%" border="1" cellpadding="0" cellspacing="0" style="padding:5px;line-height:170%;clear:both;font-size:12px">
    <tr>
      <td width="20%">文件相对路径</td>
      <td width="20%">特征码</td>
      <td width="40%">描述</td>
      <td width="20%">创建/修改时间</td>
      </tr>
       <p>
    <%=Report%>
    <br/></p>
    </table></td>
  </tr>
 </table>
</td></tr></table>
<%
timer2 = timer
thetime=cstr(int(((timer2-timer1)*10000 )+0.5)/10)
response.write "<br><font size=""2"">本页执行共用了"&thetime&"毫秒</font>"
 end if
end if
%>
<hr>
<div align="center">本程序取自<a href="[url]http://www.0x54.org[/url]" target="_blank">雷客图ASP站长安全助手</a>的ASP***查找功能<br>
powered by <a href="[url]http://lake2.0x54.org[/url]" target=_blank>lake2</a>
</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)) 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
   
  'Check include file
  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
  
  'Check include virtual
  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
  
  'Check 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
  
  'Check 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
%>

转载于:https://blog.51cto.com/wyulnnhtg/31164

ASP Webshell查***代码的小东东相关推荐

  1. ASP WebShell 后门脚本与免杀

    随着时间的推移和其它新型动态网页技术的兴起,使用ASP(Active Server Page)技术构建的Web应用越来越少.ASP的衰落.旧资料和链接的失效.前辈们早期对ASP较多的研究,都导致了新型 ...

  2. webshell查杀工具

    D盾_Web查杀:http://www.d99net.net/index.asp 河马webshell查杀:http://www.shellpub.com 深信服Webshell网站后门检测工具:ht ...

  3. d盾web查杀 linux,D盾扫描_D盾_Web查杀 [webshell查杀]

    因为某些特殊目录无法删除,D盾_web查杀 加入了这类目录和文件的删除. 删除目录功能只能删除特殊的目录,如选定的目录不是特殊目录,此功能是无效的,防止误删除! 『D盾_Web查杀』 2015-07- ...

  4. 常见的 Webshell 查杀工具

    前言 当网站服务器被入侵时,我们需要一款Webshell检测工具,来帮助我们发现webshell,进一步排查系统可能存在的安全漏洞. 本文推荐了10款 WebShll 检测工具,用于网站入侵排查.当然 ...

  5. 应急响应之Webshell查杀工具

    当网站服务器被入侵时,我们需要一款Webshell检测工具,来帮助我们发现webshell,进一步排查系统可能存在的安全漏洞. 本文推荐了10款Webshll检测工具,用于网站入侵排查.当然,目前市场 ...

  6. C#访问SQLite完整增删改查代码

    以下代码都是经过我测试可用的: 一 一个控制台示例 using System; using System.Data.SQLite;namespace SQLiteSamples {class Prog ...

  7. ASP.NET常用代码

    1. 打开新的窗口并传送参数: 传送参数: response.write("<script>window.open('*.aspx?id="+this.DropDown ...

  8. java增删改一键生成_easyCode(java自动生成增删改查代码)

    [实例简介]读取数据库表结构 自动生成增删改查代码 [实例截图] [核心代码] package com.isoftstone.autocoding; import com.isoftstone.aut ...

  9. dmo Java_java DMO及增删改查代码的自动生成

    在web开发过程中,尤其是后台管理系统的开发中,少不了增删改成的基础操作,原来我自己的做法是一份一份的拷贝粘贴,然后修改其中的不同,然而这样既枯燥无味又浪费了大量的时间,所以根据自己项目结构的特点写了 ...

最新文章

  1. 面向生信分析的高性 RStudio 服务器
  2. 你想要的生物信息知识全在这——生信宝典文章目录
  3. 连续低频脑电图解码手臂运动,实现机械手臂的闭环自然控制
  4. android内存代码,Android内存优化(五) Lint代码扫描工具
  5. 遇到的一些小的tips
  6. [问答]-ARM文档中的†和‡的含义
  7. ABAPプログラム開発において使用実績のある汎用モジュール一覧
  8. CentOS虚拟机不能联网状况下yum方式从本地安装软件包
  9. 自定义方法中英文字符截取
  10. 「技术人生」第2篇:学会分析事物的本质
  11. SAAS产业趋势洞察——乘风破浪会有时
  12. java thread等特,进阶之路|奇妙的Thread之旅
  13. 一个3年工作经验的Web工程师的经验之谈
  14. Thrift在windows7下的安装与实践
  15. 车牌号对应归属地及城市JSON带简码
  16. python控制电机正反转_连接电动机正反转控制电路,要求具备电气互锁功能,拍照上传...
  17. eclipse代码补全、代码提示及防空格自动补全
  18. [PhotoShop]用ps制作遮罩图层
  19. 史上最简单的spark教程第十三章-SparkSQL编程Java案例实践(终章)
  20. GPU运算能力对比(详细)

热门文章

  1. “明年AI会如何?”英伟达问了13位不同行业的专家
  2. 于是,我们给前端分享会定义了一个未定义的名字
  3. 为什么要使用Redis?
  4. 未来两年九大信息安全威胁
  5. 《在你彷徨时候,总有人在前行》
  6. windows系统上安装与使用Android NDK r8d(二)
  7. 【截至2006.12.31】毒霸反间谍可清除的部分流氓软件清单
  8. 《敏捷可执行需求说明 Scrum提炼及实现技术》—— 3.5 小结
  9. 【原创】brew 和 brew cask
  10. ios 友盟第三方登录遇到的各种坑。