Skip to content

Siemphony is in beta and still being built. How a rule earns its badge.

Siemphony’s repertoire

Detect scheduled task registered with a suspicious action

Matches Windows Security scheduled-job registration (4698) and modification (4702) where the task definition itself carries an encoded, download-oriented or living-off-the-land action, so the payload is inspectable at registration time rather than after svchost.exe launches it — MITRE's CommandLineEntropyThreshold knob applied to the registration event. The two event ids carry the task XML under different names: 4698 has `TaskContent` and 4702 has `TaskNewContent`, so each event id gets its own selection. ANDing one field name against both event ids, as the previous version did, silently killed the modification half. Two caveats a SOC needs before deploying: 4698 and 4702 live in the `Audit Other Object Access Events` subcategory, which is off by default and is not enabled by the Microsoft or CIS baselines, so this rule returns nothing at all until audit policy is changed; and the terms match the whole task XML, including RegistrationInfo, so a task whose author, description or URI merely mentions one of them matches without its action being suspicious. UNVERIFIED AS AUTHORED — derived from MITRE ATT&CK DET0441, not hand-written and not tested by its author. Any lab result is on this rule's own page.Full description

The detection

The 3 SIEM queries below are previews produced by Siemphony’s own translator, not pySigma, and none has been executed against a real backend — review before you deploy.

detection.yml

title: Detect scheduled task registered with a suspicious actionid: e1a2d627-d92d-4858-9448-64c9192bbfa6status: experimentaldescription: |  Matches Windows Security scheduled-job registration (4698) and modification  (4702) where the task definition itself carries an encoded, download-oriented  or living-off-the-land action, so the payload is inspectable at registration  time rather than after svchost.exe launches it — MITRE's  CommandLineEntropyThreshold knob applied to the registration event. The two  event ids carry the task XML under different names: 4698 has `TaskContent` and  4702 has `TaskNewContent`, so each event id gets its own selection. ANDing one  field name against both event ids, as the previous version did, silently  killed the modification half. Two caveats a SOC needs before deploying: 4698  and 4702 live in the `Audit Other Object Access Events` subcategory, which is  off by default and is not enabled by the Microsoft or CIS baselines, so this  rule returns nothing at all until audit policy is changed; and the terms match  the whole task XML, including RegistrationInfo, so a task whose author,  description or URI merely mentions one of them matches without its action  being suspicious.  UNVERIFIED AS AUTHORED — derived from MITRE ATT&CK DET0441, not hand-written and not tested by its author. Any lab result is on this rule's own page.references:  - https://attack.mitre.org/techniques/T1053/005  - https://attack.mitre.org/detectionstrategies/DET0441author: Siemphony pipeline (machine-derived from MITRE ATT&CK v19.2)date: 2026-08-16tags:  - attack.execution  - attack.persistence  - attack.privilege-escalation  - attack.t1053.005logsource:  product: windows  service: securitydetection:  selection_created:    EventID: 4698  selection_updated:    EventID: 4702  content_created:    - TaskContent|contains:        - 'FromBase64String'        - 'Invoke-Expression'        - 'Invoke-WebRequest'        - 'DownloadString'        - 'DownloadFile'        - 'mshta'        - 'regsvr32'        - 'certutil'        - '\AppData\Local\Temp\'        - '\AppData\Roaming\'        - '\Users\Public\'        - '\Windows\Temp\'        - '\PerfLogs\'    - TaskContent|re: '-e(c|n|nc|ncodedcommand)?[ :=]'  content_updated:    - TaskNewContent|contains:        - 'FromBase64String'        - 'Invoke-Expression'        - 'Invoke-WebRequest'        - 'DownloadString'        - 'DownloadFile'        - 'mshta'        - 'regsvr32'        - 'certutil'        - '\AppData\Local\Temp\'        - '\AppData\Roaming\'        - '\Users\Public\'        - '\Windows\Temp\'        - '\PerfLogs\'    - TaskNewContent|re: '-e(c|n|nc|ncodedcommand)?[ :=]'  condition: (selection_created and content_created) or (selection_updated and content_updated)falsepositives:  - "Group Policy Preferences Scheduled Task items. The client-side extension re-applies them on every Group Policy refresh (90 minutes plus jitter) and at every boot and logon, writing a fresh 4698 each time on every host in scope, and GPP tasks routinely stage an installer or script under `\\Windows\\Temp\\` or `\\Users\\Public\\`. On a domain with a handful of GPP task items this alone can outproduce the rest of the rule. MITRE's TaskNamePattern knob is where the recurring names belong."  - "Software deployment and patching platforms that register short-lived tasks pointing at a staged installer under `\\Windows\\Temp\\`, `\\Users\\Public\\` or a user profile. These fire under SYSTEM at predictable maintenance times, which is what MITRE's UserContext knob is for."  - "In-house administrative PowerShell that passes an encoded command to survive quoting problems in the task XML. Encoding is a convenience there, not evasion, so allow-list by the registering account and the task path rather than dropping the encoded-command pattern, which is the rule's best term."  - "Any edit to an existing task re-logs the complete new definition in 4702, so changing a trigger on a known-good task that happens to contain a matched string re-alerts every time it is touched, with nothing new having been added to the action."level: high

Sentinel · KQL

Run this as a search.

SecurityEvent| where ((EventID == 4698 and ((TaskContent contains "FromBase64String" or TaskContent contains "Invoke-Expression" or TaskContent contains "Invoke-WebRequest" or TaskContent contains "DownloadString" or TaskContent contains "DownloadFile" or TaskContent contains "mshta" or TaskContent contains "regsvr32" or TaskContent contains "certutil" or TaskContent contains "\\AppData\\Local\\Temp\\" or TaskContent contains "\\AppData\\Roaming\\" or TaskContent contains "\\Users\\Public\\" or TaskContent contains "\\Windows\\Temp\\" or TaskContent contains "\\PerfLogs\\") or TaskContent matches regex "(?i)-e(c|n|nc|ncodedcommand)?[ :=]")) or (EventID == 4702 and ((TaskNewContent contains "FromBase64String" or TaskNewContent contains "Invoke-Expression" or TaskNewContent contains "Invoke-WebRequest" or TaskNewContent contains "DownloadString" or TaskNewContent contains "DownloadFile" or TaskNewContent contains "mshta" or TaskNewContent contains "regsvr32" or TaskNewContent contains "certutil" or TaskNewContent contains "\\AppData\\Local\\Temp\\" or TaskNewContent contains "\\AppData\\Roaming\\" or TaskNewContent contains "\\Users\\Public\\" or TaskNewContent contains "\\Windows\\Temp\\" or TaskNewContent contains "\\PerfLogs\\") or TaskNewContent matches regex "(?i)-e(c|n|nc|ncodedcommand)?[ :=]")))

Splunk · SPL

Run this as a search.

index=* | where ((EventID=4698 AND ((match(TaskContent, "(?i)FromBase64String") OR match(TaskContent, "(?i)Invoke-Expression") OR match(TaskContent, "(?i)Invoke-WebRequest") OR match(TaskContent, "(?i)DownloadString") OR match(TaskContent, "(?i)DownloadFile") OR match(TaskContent, "(?i)mshta") OR match(TaskContent, "(?i)regsvr32") OR match(TaskContent, "(?i)certutil") OR match(TaskContent, "(?i)\\\\AppData\\\\Local\\\\Temp\\\\") OR match(TaskContent, "(?i)\\\\AppData\\\\Roaming\\\\") OR match(TaskContent, "(?i)\\\\Users\\\\Public\\\\") OR match(TaskContent, "(?i)\\\\Windows\\\\Temp\\\\") OR match(TaskContent, "(?i)\\\\PerfLogs\\\\")) OR match(TaskContent, "-e(c|n|nc|ncodedcommand)?[ :=]"))) OR (EventID=4702 AND ((match(TaskNewContent, "(?i)FromBase64String") OR match(TaskNewContent, "(?i)Invoke-Expression") OR match(TaskNewContent, "(?i)Invoke-WebRequest") OR match(TaskNewContent, "(?i)DownloadString") OR match(TaskNewContent, "(?i)DownloadFile") OR match(TaskNewContent, "(?i)mshta") OR match(TaskNewContent, "(?i)regsvr32") OR match(TaskNewContent, "(?i)certutil") OR match(TaskNewContent, "(?i)\\\\AppData\\\\Local\\\\Temp\\\\") OR match(TaskNewContent, "(?i)\\\\AppData\\\\Roaming\\\\") OR match(TaskNewContent, "(?i)\\\\Users\\\\Public\\\\") OR match(TaskNewContent, "(?i)\\\\Windows\\\\Temp\\\\") OR match(TaskNewContent, "(?i)\\\\PerfLogs\\\\")) OR match(TaskNewContent, "-e(c|n|nc|ncodedcommand)?[ :=]"))))

Wazuh · XML rule

Deploy to your manager — this is a rule, not a search.

<group name="sigma,windows,">  <!-- Rule ids must be unique on your manager; 100000+ is the user range. -->  <!-- 2 rules: the Sigma condition ORs across different fields,       which one rule cannot express. Any one matching is a hit. -->  <rule id="100000" level="12">    <!-- Set <if_sid> to the decoder/base rule for windows so this only evaluates relevant events. -->    <field name="EventID" type="pcre2">(?i)^4698$</field>    <field name="TaskContent" type="pcre2">(?i)((FromBase64String|Invoke-Expression|Invoke-WebRequest|DownloadString|DownloadFile|mshta|regsvr32|certutil|\\AppData\\Local\\Temp\\|\\AppData\\Roaming\\|\\Users\\Public\\|\\Windows\\Temp\\|\\PerfLogs\\)|-e(c|n|nc|ncodedcommand)?[ :=])</field>    <description>Detect scheduled task registered with a suspicious action (1/2)</description>    <mitre>      <id>T1053.005</id>    </mitre>  </rule>   <rule id="100001" level="12">    <!-- Set <if_sid> to the decoder/base rule for windows so this only evaluates relevant events. -->    <field name="EventID" type="pcre2">(?i)^4702$</field>    <field name="TaskNewContent" type="pcre2">(?i)((FromBase64String|Invoke-Expression|Invoke-WebRequest|DownloadString|DownloadFile|mshta|regsvr32|certutil|\\AppData\\Local\\Temp\\|\\AppData\\Roaming\\|\\Users\\Public\\|\\Windows\\Temp\\|\\PerfLogs\\)|-e(c|n|nc|ncodedcommand)?[ :=])</field>    <description>Detect scheduled task registered with a suspicious action (2/2)</description>    <mitre>      <id>T1053.005</id>    </mitre>  </rule></group>

Elastic · ES|QL

Run this as a search.

Elastic cannot express this construct. ES|QL RLIKE uses Lucene regexp syntax, which has no case-insensitive flag, and Sigma regexes are case-insensitive. Use |contains/|startswith/|endswith, or write the ES|QL by hand. The Sigma source is on the first tab, unchanged.

Verdicts · reactions · comments

Community

Verdicts from engineers who actually deployed it, and the conversation around it.

Log in to react
Not yet reported on

Nobody has run this in a real environment and said what happened.

Verdicts from engineers who deployed it

0 cast

No verdicts reported yet. The first one is worth more than the tenth — say what you ran it against.

Log in to report a verdict.

Log in to join the discussion.

1 thread

  • @hana-kobayashi

    Rolled this out to three tenants and got zero hits on all three, which felt like a clean estate until we read the description properly: 4698 and 4702 live in Audit Other Object Access Events, off by default and not enabled by the Microsoft or CIS baselines, and none of the three had it on. The rule was not quiet, it was blind, and nothing on the dashboard distinguishes the two. After the audit-policy change, two tenants produce events and the third's forwarder truncates the task XML, so the terms have nothing to match on. Fire a benign registration through the whole pipe before you count this as coverage.

    • @priya-raman

      Validated the registration leg on the range: a task carrying a FromBase64String action fires 4698 exactly as written. The field-name split is real, too — our first local port matched TaskContent on both event ids, and the 4702 modification leg was silently dead, which is precisely the bug the description says an earlier version of this rule had. One trap from the terms matching the whole task XML: RegistrationInfo counts, so a task whose author or description merely mentions certutil matches with a perfectly innocent action. We hit it with our own inventory job, whose description read "replaces certutil download job".