<!--
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">
        <!-- Rule logic: OriginalFileName matches known Python binary names BUT process_name (Image) does NOT match the expected Python/pip/idle names, indicating a renamed Python binary execution. -->
        <!-- The SPL uses regex to match OriginalFileName against: py.exe, pyw.exe, python.exe, pythonw.exe, python32.exe, python64.exe, pythonw32.exe, pythonw64.exe, ipyw32.exe, ipyw64.exe, python3.exe, pythonw3.exe, python3.*.exe, pythonw3.*.exe -->
        <!-- The SPL then excludes process_name matching: py.exe, pyw.exe, pip.exe, pip3.exe, python.exe, pythonw.exe, python32.exe, python64.exe, pythonw32.exe, pythonw64.exe, ipyw32.exe, ipyw64.exe, python3.exe, pythonw3.exe, python3.*.exe, pythonw3.*.exe, pip3.*.exe, idle3.*.exe -->
        <!-- Additionally the SPL excludes process_name: dwagent.exe, WinUtils.exe -->
        <!-- Sysmon OriginalFileName is matched with condition="is" for exact known values. The Image (process_name) exclusion of the expected Python names is handled via excludes any. The explicit exclusions dwagent.exe and WinUtils.exe are also excluded from Image. -->
        <!-- Note: Sysmon cannot natively replicate the full regex wildcard matching (e.g. python3.\w+.exe). The fixed known values are enumerated below. Versioned names like python3.11.exe cannot be fully pre-enumerated; the rules below cover the non-versioned canonical names and flag any Image that is not a recognised Python/pip/idle binary. -->
        <Rule name="Windows Renamed Python Binary was Executed" groupRelation="and">
          <OriginalFileName name="technique_id=T1036.003,technique_name=Rename System Utilities" condition="is">py.exe</OriginalFileName>
          <Image name="technique_id=T1036.003,technique_name=Rename System Utilities" condition="excludes any">py.exe;pyw.exe;pip.exe;pip3.exe;python.exe;pythonw.exe;python32.exe;python64.exe;pythonw32.exe;pythonw64.exe;ipyw32.exe;ipyw64.exe;python3.exe;pythonw3.exe;dwagent.exe;WinUtils.exe</Image>
        </Rule>
        <Rule name="Windows Renamed Python Binary was Executed" groupRelation="and">
          <OriginalFileName name="technique_id=T1036.003,technique_name=Rename System Utilities" condition="is">pyw.exe</OriginalFileName>
          <Image name="technique_id=T1036.003,technique_name=Rename System Utilities" condition="excludes any">py.exe;pyw.exe;pip.exe;pip3.exe;python.exe;pythonw.exe;python32.exe;python64.exe;pythonw32.exe;pythonw64.exe;ipyw32.exe;ipyw64.exe;python3.exe;pythonw3.exe;dwagent.exe;WinUtils.exe</Image>
        </Rule>
        <Rule name="Windows Renamed Python Binary was Executed" groupRelation="and">
          <OriginalFileName name="technique_id=T1036.003,technique_name=Rename System Utilities" condition="is">python.exe</OriginalFileName>
          <Image name="technique_id=T1036.003,technique_name=Rename System Utilities" condition="excludes any">py.exe;pyw.exe;pip.exe;pip3.exe;python.exe;pythonw.exe;python32.exe;python64.exe;pythonw32.exe;pythonw64.exe;ipyw32.exe;ipyw64.exe;python3.exe;pythonw3.exe;dwagent.exe;WinUtils.exe</Image>
        </Rule>
        <Rule name="Windows Renamed Python Binary was Executed" groupRelation="and">
          <OriginalFileName name="technique_id=T1036.003,technique_name=Rename System Utilities" condition="is">pythonw.exe</OriginalFileName>
          <Image name="technique_id=T1036.003,technique_name=Rename System Utilities" condition="excludes any">py.exe;pyw.exe;pip.exe;pip3.exe;python.exe;pythonw.exe;python32.exe;python64.exe;pythonw32.exe;pythonw64.exe;ipyw32.exe;ipyw64.exe;python3.exe;pythonw3.exe;dwagent.exe;WinUtils.exe</Image>
        </Rule>
        <Rule name="Windows Renamed Python Binary was Executed" groupRelation="and">
          <OriginalFileName name="technique_id=T1036.003,technique_name=Rename System Utilities" condition="is">python32.exe</OriginalFileName>
          <Image name="technique_id=T1036.003,technique_name=Rename System Utilities" condition="excludes any">py.exe;pyw.exe;pip.exe;pip3.exe;python.exe;pythonw.exe;python32.exe;python64.exe;pythonw32.exe;pythonw64.exe;ipyw32.exe;ipyw64.exe;python3.exe;pythonw3.exe;dwagent.exe;WinUtils.exe</Image>
        </Rule>
        <Rule name="Windows Renamed Python Binary was Executed" groupRelation="and">
          <OriginalFileName name="technique_id=T1036.003,technique_name=Rename System Utilities" condition="is">python64.exe</OriginalFileName>
          <Image name="technique_id=T1036.003,technique_name=Rename System Utilities" condition="excludes any">py.exe;pyw.exe;pip.exe;pip3.exe;python.exe;pythonw.exe;python32.exe;python64.exe;pythonw32.exe;pythonw64.exe;ipyw32.exe;ipyw64.exe;python3.exe;pythonw3.exe;dwagent.exe;WinUtils.exe</Image>
        </Rule>
        <Rule name="Windows Renamed Python Binary was Executed" groupRelation="and">
          <OriginalFileName name="technique_id=T1036.003,technique_name=Rename System Utilities" condition="is">pythonw32.exe</OriginalFileName>
          <Image name="technique_id=T1036.003,technique_name=Rename System Utilities" condition="excludes any">py.exe;pyw.exe;pip.exe;pip3.exe;python.exe;pythonw.exe;python32.exe;python64.exe;pythonw32.exe;pythonw64.exe;ipyw32.exe;ipyw64.exe;python3.exe;pythonw3.exe;dwagent.exe;WinUtils.exe</Image>
        </Rule>
        <Rule name="Windows Renamed Python Binary was Executed" groupRelation="and">
          <OriginalFileName name="technique_id=T1036.003,technique_name=Rename System Utilities" condition="is">pythonw64.exe</OriginalFileName>
          <Image name="technique_id=T1036.003,technique_name=Rename System Utilities" condition="excludes any">py.exe;pyw.exe;pip.exe;pip3.exe;python.exe;pythonw.exe;python32.exe;python64.exe;pythonw32.exe;pythonw64.exe;ipyw32.exe;ipyw64.exe;python3.exe;pythonw3.exe;dwagent.exe;WinUtils.exe</Image>
        </Rule>
        <Rule name="Windows Renamed Python Binary was Executed" groupRelation="and">
          <OriginalFileName name="technique_id=T1036.003,technique_name=Rename System Utilities" condition="is">ipyw32.exe</OriginalFileName>
          <Image name="technique_id=T1036.003,technique_name=Rename System Utilities" condition="excludes any">py.exe;pyw.exe;pip.exe;pip3.exe;python.exe;pythonw.exe;python32.exe;python64.exe;pythonw32.exe;pythonw64.exe;ipyw32.exe;ipyw64.exe;python3.exe;pythonw3.exe;dwagent.exe;WinUtils.exe</Image>
        </Rule>
        <Rule name="Windows Renamed Python Binary was Executed" groupRelation="and">
          <OriginalFileName name="technique_id=T1036.003,technique_name=Rename System Utilities" condition="is">ipyw64.exe</OriginalFileName>
          <Image name="technique_id=T1036.003,technique_name=Rename System Utilities" condition="excludes any">py.exe;pyw.exe;pip.exe;pip3.exe;python.exe;pythonw.exe;python32.exe;python64.exe;pythonw32.exe;pythonw64.exe;ipyw32.exe;ipyw64.exe;python3.exe;pythonw3.exe;dwagent.exe;WinUtils.exe</Image>
        </Rule>
        <Rule name="Windows Renamed Python Binary was Executed" groupRelation="and">
          <OriginalFileName name="technique_id=T1036.003,technique_name=Rename System Utilities" condition="is">python3.exe</OriginalFileName>
          <Image name="technique_id=T1036.003,technique_name=Rename System Utilities" condition="excludes any">py.exe;pyw.exe;pip.exe;pip3.exe;python.exe;pythonw.exe;python32.exe;python64.exe;pythonw32.exe;pythonw64.exe;ipyw32.exe;ipyw64.exe;python3.exe;pythonw3.exe;dwagent.exe;WinUtils.exe</Image>
        </Rule>
        <Rule name="Windows Renamed Python Binary was Executed" groupRelation="and">
          <OriginalFileName name="technique_id=T1036.003,technique_name=Rename System Utilities" condition="is">pythonw3.exe</OriginalFileName>
          <Image name="technique_id=T1036.003,technique_name=Rename System Utilities" condition="excludes any">py.exe;pyw.exe;pip.exe;pip3.exe;python.exe;pythonw.exe;python32.exe;python64.exe;pythonw32.exe;pythonw64.exe;ipyw32.exe;ipyw64.exe;python3.exe;pythonw3.exe;dwagent.exe;WinUtils.exe</Image>
        </Rule>
        <!-- Note: The SPL regex also matches versioned OriginalFileName patterns such as python3.\w+.exe (e.g. python3.11.exe) and pythonw3.\w+.exe using \w+ wildcards. Sysmon's "is" condition cannot replicate regex wildcard matching for these versioned filenames. The rules below use "begin with" to approximate coverage for the versioned families. These will also catch the non-versioned forms already handled above, which is acceptable since the Image exclusion condition still applies. -->
        <Rule name="Windows Renamed Python Binary was Executed" groupRelation="and">
          <OriginalFileName name="technique_id=T1036.003,technique_name=Rename System Utilities" condition="begin with">python3.</OriginalFileName>
          <Image name="technique_id=T1036.003,technique_name=Rename System Utilities" condition="excludes any">py.exe;pyw.exe;pip.exe;pip3.exe;python.exe;pythonw.exe;python32.exe;python64.exe;pythonw32.exe;pythonw64.exe;ipyw32.exe;ipyw64.exe;python3.exe;pythonw3.exe;dwagent.exe;WinUtils.exe</Image>
        </Rule>
        <Rule name="Windows Renamed Python Binary was Executed" groupRelation="and">
          <OriginalFileName name="technique_id=T1036.003,technique_name=Rename System Utilities" condition="begin with">pythonw3.</OriginalFileName>
          <Image name="technique_id=T1036.003,technique_name=Rename System Utilities" condition="excludes any">py.exe;pyw.exe;pip.exe;pip3.exe;python.exe;pythonw.exe;python32.exe;python64.exe;pythonw32.exe;pythonw64.exe;ipyw32.exe;ipyw64.exe;python3.exe;pythonw3.exe;dwagent.exe;WinUtils.exe</Image>
        </Rule>
      </ProcessCreate>
    </RuleGroup>
  </EventFiltering>
</Sysmon>