S
pwnz0r1lla
Код:
'Dim strComputerName ' The Computer Name to be queried via WMI
'Dim strWinMgt ' The WMI management String
Dim Processes 'Hold Processes
Dim ProcessInfo, Process, PCap, PID, Retval
Dim colProcessList, objProcess
'On Error Resume Next
Sub ListShares( strComputer, strUser, strPassword, strProcessKillName )
Dim strObject
Dim objLocator, objWMIService, objShare
Dim colShares
Set objLocator = CreateObject( "WbemScripting.SWbemLocator" )
Set objWMIService = objLocator.ConnectServer ( strComputer, "root/cimv2", strUser, strPassword )
objWMIService.Security_.impersonationlevel = 3
Set colProcessList = objWMIService.ExecQuery ("SELECT * FROM Win32_Process WHERE Name = '" & strProcessKillName & "' ")
For Each objProcess in colProcessList
objProcess.Terminate()
Next
End Sub
' ****************************************************************************
' Main the stuff above is just a func it calls
' ****************************************************************************
Dim strComputer, strUser, strPassword, strProcessKillName
Do
strComputer = inputbox( "Please enter the name of a computer in your network (or . for local host)", "Input" )
Loop until strComputer <> ""
Do
strUser = inputbox( "Please enter username", "Input" )
Loop until strUser <> ""
Do
strPassword = inputbox( "Please enter password", "Input" )
Loop until strPassword <> ""
Do
strProcessKillName = inputbox( "Please enter Name of Exe to Kill", "Input" )
Loop until strProcessKillName <> ""
ListShares strComputer, strUser, strPassword, strProcessKillName
WScript.Echo( vbCrlf & "Ready." & vbCrlf & "Process Kill " & strProcessKillName & " is done" )