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

Siemphony@siemphonyhighT1053.005unverified
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

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.

No comments yet. Someone who deploys this will have something to say about it.