ScheduledTasks
Windowsv1.2
Author: Eric Zimmerman, Reece394
description
Scheduled tasks (*.job and XML)
paths
13 paths
› paths use Windows environment syntax
collection commands
# PowerShell Artifact Collection Script
# Target: ScheduledTasks
# Run as Administrator
#Requires -RunAsAdministrator
$ErrorActionPreference = "SilentlyContinue"
$DestBase = "D:\Evidence"
# Function to handle artifact collection with robocopy
function Collect-Artifact {
param (
[string]$SourceDir,
[string]$FolderName,
[string]$FileMask = "*"
)
$FullDest = Join-Path -Path $DestBase -ChildPath $FolderName
robocopy "$SourceDir" "$FullDest" "$FileMask" /E /COPY:DAT /R:0 /W:0 /NP /NFL /NDL /NJH /NJS | Out-Null
}
# 1. at .job
Collect-Artifact -SourceDir "C:\Windows\Tasks\" -FileMask "*.job" -FolderName "at__job"
# 2. at .job
Collect-Artifact -SourceDir "C:\Windows.old\Windows\Tasks\" -FileMask "*.job" -FolderName "at__job"
# 3. at SchedLgU.txt
Collect-Artifact -SourceDir "C:\Windows\" -FileMask "SchedLgU.txt" -FolderName "at_SchedLgU_txt"
# 4. at SchedLgU.txt
Collect-Artifact -SourceDir "C:\Windows.old\Windows\" -FileMask "SchedLgU.txt" -FolderName "at_SchedLgU_txt"
# 5. XML
Collect-Artifact -SourceDir "C:\Windows\System32\Tasks\" -FolderName "XML"
# 6. XML
Collect-Artifact -SourceDir "C:\Windows\syswow64\Tasks\" -FolderName "XML"
# 7. XML
Collect-Artifact -SourceDir "C:\Windows.old\Windows\System32\Tasks\" -FolderName "XML"
# 8. PowerShell Scheduled_Jobs
$UserPath = Join-Path $env:USERPROFILE "AppData\Local\Microsoft\Windows\PowerShell\ScheduledJobs\"
Collect-Artifact -SourceDir "$UserPath" -FolderName "PowerShell_Scheduled_Jobs"
# 9. PowerShell Scheduled_Jobs Output
$UserPath = Join-Path $env:USERPROFILE "AppData\Local\Microsoft\Windows\PowerShell\ScheduledJobs\*\Output\*\"
Collect-Artifact -SourceDir "$UserPath" -FolderName "PowerShell_Scheduled_Jobs_Output"
# 10. PowerShell Scheduled_Jobs Systemprofile
Collect-Artifact -SourceDir "C:\Windows\System32\config\systemprofile\AppData\Local\Microsoft\Windows\PowerShell\ScheduledJobs\" -FolderName "PowerShell_Scheduled_Jobs_Systemprofile"
# 11. PowerShell Scheduled_Jobs Output Systemprofile
Collect-Artifact -SourceDir "C:\Windows\System32\config\systemprofile\AppData\Local\Microsoft\Windows\PowerShell\ScheduledJobs\*\Output\*\" -FolderName "PowerShell_Scheduled_Jobs_Output_Systemprofile"
# 12. PowerShell Scheduled_Jobs WOW64 Systemprofile
Collect-Artifact -SourceDir "C:\Windows\SysWOW64\config\systemprofile\AppData\Local\Microsoft\Windows\PowerShell\ScheduledJobs\" -FolderName "PowerShell_Scheduled_Jobs_WOW64_Systemprofile"
# 13. PowerShell Scheduled_Jobs Output WOW64 Systemprofile
Collect-Artifact -SourceDir "C:\Windows\SysWOW64\config\systemprofile\AppData\Local\Microsoft\Windows\PowerShell\ScheduledJobs\*\Output\*\" -FolderName "PowerShell_Scheduled_Jobs_Output_WOW64_Systemprofile"
Write-Host "Collection complete!" -ForegroundColor Green› Save as .ps1 and run as Administrator. Use: powershell -ExecutionPolicy Bypass -File script.ps1
› cyberchef recipes
Open in CyberChef to decode values extracted from this artifact.