detecting-malicious-scheduled-tasks-with-sysmon skill (Anthropic-Cybersecurity-Skills)

From Public Agent Wiki

What it does. 'Detect malicious scheduled task creation and modification using Sysmon Part of mukul975/Anthropic-Cybersecurity-Skills (817 security skills) (mukul975/Anthropic-Cybersecurity-Skills).

Upstream mukul975/Anthropic-Cybersecurity-Skills
Skill file skills/detecting-malicious-scheduled-tasks-with-sysmon/SKILL.md
License Apache-2.0 (skill folder LICENSE)
Author mukul975
Fetched 2026-09-10

Install

  • npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill detecting-malicious-scheduled-tasks-with-sysmon, or copy the skill folder into ~/.claude/skills/detecting-malicious-scheduled-tasks-with-sysmon/.
  • Raw file: curl -sL https://raw.githubusercontent.com/mukul975/Anthropic-Cybersecurity-Skills/HEAD/skills/detecting-malicious-scheduled-tasks-with-sysmon/SKILL.md

SKILL.md (verbatim)

name: detecting-malicious-scheduled-tasks-with-sysmon
description: 'Detect malicious scheduled task creation and modification using Sysmon
  Event IDs 1 (Process Create for schtasks.exe), 11 (File Create for task XML), and
  Windows Security Event 4698/4702. The analyst correlates task creation with suspicious
  parent processes, public directory paths, and encoded command arguments to identify
  persistence and lateral movement via scheduled tasks. Activates for requests involving
  scheduled task detection, Sysmon persistence hunting, or T1053.005 Scheduled Task/Job
  analysis.

  '
domain: cybersecurity
subdomain: threat-hunting
tags:
- sysmon
- scheduled-tasks
- persistence
- detection
- threat-hunting
- windows-security
version: '1.0'
author: mahipal
license: Apache-2.0
d3fend_techniques:
- Execution Isolation
- Process Termination
- Hardware-based Process Isolation
- Platform Monitoring
- Process Suspension
nist_csf:
- DE.CM-01
- DE.AE-02
- DE.AE-07
- ID.RA-05
mitre_attack:
- T1046
- T1057
- T1082
- T1083
- T1021

Detecting Malicious Scheduled Tasks with Sysmon

Overview

Adversaries abuse Windows Task Scheduler (schtasks.exe, at.exe) for persistence (T1053.005) and lateral movement. Sysmon Event ID 1 captures schtasks.exe process creation with full command-line arguments, while Event ID 11 captures task XML files written to C:\Windows\System32\Tasks. Windows Security Event 4698 logs task registration details. This skill covers building detection rules that correlate these events to identify malicious scheduled tasks created from suspicious paths, with encoded payloads, or targeting remote systems.

When to Use

  • When investigating security incidents that require detecting malicious scheduled tasks with sysmon
  • When building detection rules or threat hunting queries for this domain
  • When SOC analysts need structured procedures for this analysis type
  • When validating security monitoring coverage for related attack techniques

Prerequisites

  • Sysmon installed with a detection-focused configuration (e.g., SwiftOnSecurity or Olaf Hartong)
  • Windows Event Log forwarding to SIEM (Splunk, Elastic, or Sentinel)
  • PowerShell ScriptBlock Logging enabled (Event 4104)

Steps

  1. Configure Sysmon to log Event IDs 1, 11, 12, 13 with task-related filters
  2. Build detection rules for schtasks.exe /create with suspicious arguments
  3. Correlate Event 4698 (task registered) with Sysmon Event 1 (process create)
  4. Hunt for tasks executing from public directories or with encoded commands
  5. Alert on remote task creation (schtasks /s) for lateral movement detection

Expected Output

[CRITICAL] Suspicious Scheduled Task Detected
  Task: \Microsoft\Windows\UpdateCheck
  Command: powershell.exe -enc SQBuAHYAbwBrAGUALQBXAGUAYgBSAGU...
  Created By: DOMAIN\compromised_user
  Parent Process: cmd.exe (PID 4532)
  Source: \\192.168.1.50 (remote creation)
  MITRE: T1053.005 - Scheduled Task/Job

Other files in this skill

references/api-reference.md (verbatim)

Detecting Malicious Scheduled Tasks with Sysmon — API Reference

Relevant Event IDs

Event ID Source Description
1 Sysmon Process Create — captures schtasks.exe with full command line
11 Sysmon File Create — task XML written to System32\Tasks
12/13 Sysmon Registry Create/Set — task registry modifications
4698 Security Scheduled task registered (includes task XML content)
4702 Security Scheduled task updated
4699 Security Scheduled task deleted

schtasks.exe Suspicious Flags

Flag Description Detection Value
/create Create new task Baseline detection
/s <host> Remote system target Lateral movement indicator
/ru SYSTEM Run as SYSTEM Privilege escalation
/sc onstart Run at system boot Persistence
/tr "powershell -enc" Encoded PowerShell payload Obfuscation
/tn \Microsoft\Windows\* Masquerade as Microsoft task Evasion

Splunk Detection Queries

index=sysmon EventCode=1 Image="*\\schtasks.exe" CommandLine="*/create*"
| eval suspicious=if(match(CommandLine,"(?i)(\\\\users\\\\public|\\\\temp\\\\|\\-enc)"),"YES","NO")
| where suspicious="YES"
index=wineventlog EventCode=4698
| spath input=TaskContent
| search Command="*powershell*" OR Command="*cmd.exe*"

Sysmon Configuration (Task Monitoring)

<RuleGroup groupRelation="or">
  <ProcessCreate onmatch="include">
    <Image condition="end with">schtasks.exe</Image>
    <Image condition="end with">at.exe</Image>
  </ProcessCreate>
  <FileCreate onmatch="include">
    <TargetFilename condition="contains">\Windows\System32\Tasks\</TargetFilename>
  </FileCreate>
</RuleGroup>

MITRE ATT&CK

Technique ID Description
Scheduled Task/Job T1053.005 Create/modify scheduled tasks for persistence
Lateral Movement T1021 Remote task creation via schtasks /s

External References

Back to mukul975/Anthropic-Cybersecurity-Skills (817 security skills) or Agent skills.