<!--
MARDUK  /  SYSMON DYNAMIX

       ,,,,,,,,,,,,,,,,,,,,,,.     ,,,,,,,,,,,,,,,,,,,,,,
       ,,,,,,,,,,,,,,,,,,,,,,.     ,,,,,,,,,,,,,,,,,,,,,,
       ,,,,,,,,,,,,,,,,,,,,,,.     ,,,,,,,,,,,,,,,,,,,,,,
       ,,,,,,,,,,,,,,,,,,,,,,.     ,,,,,,,,,,,,,,,,,,,,,,
       ,,,,,,,,,,,,,,,,,,,,,,.     ,,,,,,,,,,,,,,,,,,,,,,
       ,,,,,,,,,,,,,,,,,,,,,,.     ,,,,,,,,,,,,,,,,,,,,,,
       ,,,,,,,,,,,,,,,,,,,,,,.     ,,,,,,,,,,,,,,,,,,,,,,
       ,,,,,,,,,,,,,,,,,,,,,,.     ,,,,,,,,,,,,,,,,,,,,,,
       ,,,,,,,,,,,,,,,,,,,,,,.     ,,,,,,,,,,,,,,,,,,,,,,
       ,,,,,,,,,,,,,,,,,,,,,,.     ,,,,,,,,,,,,,,,,,,,,,,
       ,,,,,,,,,,,,,,,,,,,,,,.     ,,,,,,,,,,,,,,,,,,,,,,
       ,,,,,,,,,,,..,,,,,,,,,.     ,,,,,,,,,,.,,,,,,,,,,,
       ,,,,,,,,,,,    ..,,,,,.     ,,,,,..    ,,,,,,,,,,,
       ,,,,,,,,,,,        ..,.    .,..        ,,,,,,,,,,,

Detection attribution and licensing are documented in THIRD_PARTY_NOTICES.md.
MITRE ATT&amp;CK mapping: © 2026 The MITRE Corporation. This work is reproduced
and distributed with the permission of The MITRE Corporation.
-->
<Sysmon schemaversion="4.90">
  <EventFiltering>
    <RuleGroup name="" groupRelation="or">
      <ProcessCreate onmatch="include">
        <!-- Macro `process_powershell` resolves to: process_name=powershell.exe OR process_name=powershell_ise.exe (common process definition) -->
        <!-- Macro `process_cmd` resolves to: process_name=cmd.exe (common process definition) -->
        <!-- Condition 1: PowerShell launched with parent from WindowsApps directory -->
        <Rule name="Windows PowerShell Script From WindowsApps Directory" groupRelation="and">
          <Image name="technique_id=T1059.001,technique_name=Command and Scripting Interpreter: PowerShell" condition="image">powershell.exe</Image>
          <ParentImage name="technique_id=T1059.001,technique_name=Command and Scripting Interpreter: PowerShell" condition="contains">\WindowsApps\</ParentImage>
        </Rule>
        <Rule name="Windows PowerShell Script From WindowsApps Directory" groupRelation="and">
          <OriginalFileName name="technique_id=T1059.001,technique_name=Command and Scripting Interpreter: PowerShell" condition="is">PowerShell.EXE</OriginalFileName>
          <ParentImage name="technique_id=T1059.001,technique_name=Command and Scripting Interpreter: PowerShell" condition="contains">\WindowsApps\</ParentImage>
        </Rule>
        <Rule name="Windows PowerShell Script From WindowsApps Directory" groupRelation="and">
          <Image name="technique_id=T1059.001,technique_name=Command and Scripting Interpreter: PowerShell" condition="image">powershell_ise.exe</Image>
          <ParentImage name="technique_id=T1059.001,technique_name=Command and Scripting Interpreter: PowerShell" condition="contains">\WindowsApps\</ParentImage>
        </Rule>
        <Rule name="Windows PowerShell Script From WindowsApps Directory" groupRelation="and">
          <OriginalFileName name="technique_id=T1059.001,technique_name=Command and Scripting Interpreter: PowerShell" condition="is">PowerShell_ISE.EXE</OriginalFileName>
          <ParentImage name="technique_id=T1059.001,technique_name=Command and Scripting Interpreter: PowerShell" condition="contains">\WindowsApps\</ParentImage>
        </Rule>
        <!-- Condition 2: cmd.exe launched with parent from WindowsApps directory -->
        <Rule name="Windows PowerShell Script From WindowsApps Directory" groupRelation="and">
          <Image name="technique_id=T1059.001,technique_name=Command and Scripting Interpreter: PowerShell" condition="image">cmd.exe</Image>
          <ParentImage name="technique_id=T1059.001,technique_name=Command and Scripting Interpreter: PowerShell" condition="contains">\WindowsApps\</ParentImage>
        </Rule>
        <Rule name="Windows PowerShell Script From WindowsApps Directory" groupRelation="and">
          <OriginalFileName name="technique_id=T1059.001,technique_name=Command and Scripting Interpreter: PowerShell" condition="is">Cmd.Exe</OriginalFileName>
          <ParentImage name="technique_id=T1059.001,technique_name=Command and Scripting Interpreter: PowerShell" condition="contains">\WindowsApps\</ParentImage>
        </Rule>
        <!-- Condition 3: PowerShell with WindowsApps -file argument in command line -->
        <Rule name="Windows PowerShell Script From WindowsApps Directory" groupRelation="and">
          <Image name="technique_id=T1059.001,technique_name=Command and Scripting Interpreter: PowerShell" condition="image">powershell.exe</Image>
          <CommandLine name="technique_id=T1059.001,technique_name=Command and Scripting Interpreter: PowerShell" condition="contains all">WindowsApps;-file </CommandLine>
        </Rule>
        <Rule name="Windows PowerShell Script From WindowsApps Directory" groupRelation="and">
          <OriginalFileName name="technique_id=T1059.001,technique_name=Command and Scripting Interpreter: PowerShell" condition="is">PowerShell.EXE</OriginalFileName>
          <CommandLine name="technique_id=T1059.001,technique_name=Command and Scripting Interpreter: PowerShell" condition="contains all">WindowsApps;-file </CommandLine>
        </Rule>
        <Rule name="Windows PowerShell Script From WindowsApps Directory" groupRelation="and">
          <Image name="technique_id=T1059.001,technique_name=Command and Scripting Interpreter: PowerShell" condition="image">powershell_ise.exe</Image>
          <CommandLine name="technique_id=T1059.001,technique_name=Command and Scripting Interpreter: PowerShell" condition="contains all">WindowsApps;-file </CommandLine>
        </Rule>
        <Rule name="Windows PowerShell Script From WindowsApps Directory" groupRelation="and">
          <OriginalFileName name="technique_id=T1059.001,technique_name=Command and Scripting Interpreter: PowerShell" condition="is">PowerShell_ISE.EXE</OriginalFileName>
          <CommandLine name="technique_id=T1059.001,technique_name=Command and Scripting Interpreter: PowerShell" condition="contains all">WindowsApps;-file </CommandLine>
        </Rule>
        <!-- Condition 4: cmd.exe with WindowsApps -file argument in command line -->
        <Rule name="Windows PowerShell Script From WindowsApps Directory" groupRelation="and">
          <Image name="technique_id=T1059.001,technique_name=Command and Scripting Interpreter: PowerShell" condition="image">cmd.exe</Image>
          <CommandLine name="technique_id=T1059.001,technique_name=Command and Scripting Interpreter: PowerShell" condition="contains all">WindowsApps;-file </CommandLine>
        </Rule>
        <Rule name="Windows PowerShell Script From WindowsApps Directory" groupRelation="and">
          <OriginalFileName name="technique_id=T1059.001,technique_name=Command and Scripting Interpreter: PowerShell" condition="is">Cmd.Exe</OriginalFileName>
          <CommandLine name="technique_id=T1059.001,technique_name=Command and Scripting Interpreter: PowerShell" condition="contains all">WindowsApps;-file </CommandLine>
        </Rule>
        <!-- Condition 5: PowerShell with WindowsApps .ps1 reference in command line -->
        <Rule name="Windows PowerShell Script From WindowsApps Directory" groupRelation="and">
          <Image name="technique_id=T1059.001,technique_name=Command and Scripting Interpreter: PowerShell" condition="image">powershell.exe</Image>
          <CommandLine name="technique_id=T1059.001,technique_name=Command and Scripting Interpreter: PowerShell" condition="contains all">WindowsApps;.ps1</CommandLine>
        </Rule>
        <Rule name="Windows PowerShell Script From WindowsApps Directory" groupRelation="and">
          <OriginalFileName name="technique_id=T1059.001,technique_name=Command and Scripting Interpreter: PowerShell" condition="is">PowerShell.EXE</OriginalFileName>
          <CommandLine name="technique_id=T1059.001,technique_name=Command and Scripting Interpreter: PowerShell" condition="contains all">WindowsApps;.ps1</CommandLine>
        </Rule>
        <Rule name="Windows PowerShell Script From WindowsApps Directory" groupRelation="and">
          <Image name="technique_id=T1059.001,technique_name=Command and Scripting Interpreter: PowerShell" condition="image">powershell_ise.exe</Image>
          <CommandLine name="technique_id=T1059.001,technique_name=Command and Scripting Interpreter: PowerShell" condition="contains all">WindowsApps;.ps1</CommandLine>
        </Rule>
        <Rule name="Windows PowerShell Script From WindowsApps Directory" groupRelation="and">
          <OriginalFileName name="technique_id=T1059.001,technique_name=Command and Scripting Interpreter: PowerShell" condition="is">PowerShell_ISE.EXE</OriginalFileName>
          <CommandLine name="technique_id=T1059.001,technique_name=Command and Scripting Interpreter: PowerShell" condition="contains all">WindowsApps;.ps1</CommandLine>
        </Rule>
        <!-- Condition 6: cmd.exe with WindowsApps .ps1 reference in command line -->
        <Rule name="Windows PowerShell Script From WindowsApps Directory" groupRelation="and">
          <Image name="technique_id=T1059.001,technique_name=Command and Scripting Interpreter: PowerShell" condition="image">cmd.exe</Image>
          <CommandLine name="technique_id=T1059.001,technique_name=Command and Scripting Interpreter: PowerShell" condition="contains all">WindowsApps;.ps1</CommandLine>
        </Rule>
        <Rule name="Windows PowerShell Script From WindowsApps Directory" groupRelation="and">
          <OriginalFileName name="technique_id=T1059.001,technique_name=Command and Scripting Interpreter: PowerShell" condition="is">Cmd.Exe</OriginalFileName>
          <CommandLine name="technique_id=T1059.001,technique_name=Command and Scripting Interpreter: PowerShell" condition="contains all">WindowsApps;.ps1</CommandLine>
        </Rule>
      </ProcessCreate>
    </RuleGroup>
  </EventFiltering>
</Sysmon>