Skip to content

Siemphony is in beta and still being built. What ships today, and what does not.

Siemphony’s repertoire

Window enumeration entry points in a PowerShell script block

Siemphony@siemphonylowT1010unverified
AN0271 offers two Windows sources and only one of them can carry this behaviour. Enumerating windows through user32 reads the window manager; it does not open a handle on the process that owns the window, so Sysmon process access events are not emitted for EnumWindows or GetWindowText and a process_access rule for this technique would render in every backend and match nothing. This rule therefore takes the PowerShell script block leg, matching the user32 entry points that window enumeration goes through together with the .NET MainWindowTitle property, which is how the same listing is usually obtained without a P/Invoke declaration at all. Those names populate MITRE's AccessedFunction knob and are authored here rather than supplied by MITRE; the UserContext and TimeWindow knobs need session attributes and counting over an interval, neither of which Sigma expresses, so this is a content test on the script text alone. It follows that only enumeration written in PowerShell is visible: a compiled implant calling EnumWindows through the API leaves nothing in this channel, and the rule sees the script that was compiled rather than proof any window was actually listed. EventID 4104 requires PowerShell Script Block Logging, which is off in a default install, so confirm it is enabled before treating an absence of hits as an absence of enumeration. UNVERIFIED AS AUTHORED — derived from MITRE ATT&CK DET0097, not hand-written and not tested by its author. Any lab result is on this rule's own page.Full description

The detection

The 4 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.

Event| where (EventID == 4104 and (ScriptBlockText contains "EnumWindows" or ScriptBlockText contains "EnumChildWindows" or ScriptBlockText contains "GetForegroundWindow" or ScriptBlockText contains "GetWindowText" or ScriptBlockText contains "GetWindowTextLength" or ScriptBlockText contains "GetWindowThreadProcessId" or ScriptBlockText contains "MainWindowTitle"))

Splunk · SPL

Run this as a search.

index=* (EventID="4104" AND (ScriptBlockText="*EnumWindows*" OR ScriptBlockText="*EnumChildWindows*" OR ScriptBlockText="*GetForegroundWindow*" OR ScriptBlockText="*GetWindowText*" OR ScriptBlockText="*GetWindowTextLength*" OR ScriptBlockText="*GetWindowThreadProcessId*" OR ScriptBlockText="*MainWindowTitle*"))

Elastic · ES|QL

Run this as a search.

FROM logs-*| WHERE (event.code == 4104 AND (TO_LOWER(powershell.file.script_block_text) LIKE "*enumwindows*" OR TO_LOWER(powershell.file.script_block_text) LIKE "*enumchildwindows*" OR TO_LOWER(powershell.file.script_block_text) LIKE "*getforegroundwindow*" OR TO_LOWER(powershell.file.script_block_text) LIKE "*getwindowtext*" OR TO_LOWER(powershell.file.script_block_text) LIKE "*getwindowtextlength*" OR TO_LOWER(powershell.file.script_block_text) LIKE "*getwindowthreadprocessid*" OR TO_LOWER(powershell.file.script_block_text) LIKE "*mainwindowtitle*"))

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. -->  <rule id="100000" level="5">    <!-- Set <if_sid> to the decoder/base rule for windows so this only evaluates relevant events. -->    <field name="EventID" type="pcre2">(?i)^4104$</field>    <field name="ScriptBlockText" type="pcre2">(?i)(EnumWindows|EnumChildWindows|GetForegroundWindow|GetWindowText|GetWindowTextLength|GetWindowThreadProcessId|MainWindowTitle)</field>    <description>Window enumeration entry points in a PowerShell script block</description>    <mitre>      <id>T1010</id>    </mitre>  </rule></group>

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.