T1010 Elastic Security · Elastic

Detect Application Window Discovery in Elastic Security

Adversaries may attempt to get a listing of open application windows. Window listings convey information about how the system is used and help adversaries identify potential data sources and security tooling to evade. Malware families including Attor, njRAT, DarkWatchman, Grandoreiro, InvisiMole, and Lazarus Group tooling use this technique to obtain window titles and correlate them with keylogger output, identify running security products by window name, locate cryptocurrency wallets, and determine sandbox environments. Adversaries typically implement this via native Windows API functions (EnumWindows, GetForegroundWindow, FindWindow, GetWindowText from user32.dll), scripting languages using P/Invoke or COM automation, or automation tools such as AutoHotkey and AutoIt. On Linux and macOS, adversaries may use xdotool, wmctrl, or Quartz/Cocoa APIs to achieve equivalent capability.

MITRE ATT&CK

Tactic
Discovery
Technique
T1010 Application Window Discovery
Canonical reference
https://attack.mitre.org/techniques/T1010/

Elastic Detection Query

Elastic Security (Elastic)
eql
process where event.type == "start" and (
  (
    process.name in~ ("powershell.exe", "pwsh.exe", "wscript.exe", "cscript.exe", "mshta.exe", "python.exe", "python3.exe", "ruby.exe", "perl.exe") and
    (
      process.command_line like~ "*GetForegroundWindow*" or
      process.command_line like~ "*EnumWindows*" or
      process.command_line like~ "*FindWindow*" or
      process.command_line like~ "*GetWindowText*" or
      process.command_line like~ "*GetActiveWindow*" or
      process.command_line like~ "*EnumChildWindows*" or
      process.command_line like~ "*GetWindowLong*" or
      process.command_line like~ "*FindWindowEx*" or
      process.command_line like~ "*GetWindowInfo*" or
      (
        process.command_line like~ "*Add-Type*" and
        process.command_line like~ "*DllImport*" and
        process.command_line like~ "*user32*" and
        (process.command_line like~ "*window*" or process.command_line like~ "*hwnd*")
      ) or
      (
        process.command_line like~ "*Shell.Application*" and
        process.command_line like~ "*Windows()*"
      )
    )
  ) or
  (
    process.name in~ ("autoit3.exe", "autohotkey.exe", "ahk2exe.exe", "autoit3_x64.exe") and
    not process.parent.name in~ ("explorer.exe", "devenv.exe", "code.exe", "notepad++.exe", "sublime_text.exe", "atom.exe", "cursor.exe")
  ) or
  process.name in~ ("winlister.exe", "wintitles.exe", "windowdetective.exe", "spyxx.exe", "spyxx_amd64.exe", "winspector.exe")
)
medium severity medium confidence

Detects T1010 Application Window Discovery via three vectors: (1) script interpreters (PowerShell, Python, WScript, etc.) invoking Windows window enumeration API names in command-line arguments or using P/Invoke patterns to load user32.dll, (2) automation tools (AutoHotkey, AutoIt) launched from non-IDE and non-desktop parent processes suggesting malware-driven execution, and (3) execution of known third-party window inspection utilities used by adversaries to enumerate running application windows.

Data Sources

Elastic Endpoint SecurityElastic SIEMWinlogbeat with Sysmon module

Required Tables

logs-endpoint.events.process-*winlogbeat-*

False Positives & Tuning

  • Legitimate QA automation frameworks using AutoHotkey or AutoIt scripts for UI regression testing where the launching parent process is a CI/CD build agent or test runner not covered by the parent exclusion list (e.g., jenkins.exe, bamboo-agent.exe)
  • Windows GUI developers and security researchers using Spy++ (spyxx.exe, spyxx_amd64.exe) included with Visual Studio for window property inspection and message tracing during application debugging sessions
  • IT administrators or RMM platform agents running PowerShell scripts that use Add-Type with DllImport to call user32.dll for legitimate window management tasks during unattended software installations or accessibility configuration
Download portable Sigma rule (.yml)

Other platforms for T1010


Testing Methodology

Validate this detection against 4 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.

  1. Test 1PowerShell P/Invoke Window Enumeration via GetForegroundWindow

    Expected signal: Sysmon Event ID 1: Process Create with Image=powershell.exe, CommandLine containing 'Add-Type', 'DllImport', 'user32.dll', 'GetForegroundWindow', and 'GetWindowText'. PowerShell ScriptBlock Log Event ID 4104 in Microsoft-Windows-PowerShell/Operational will capture the full deobfuscated Add-Type code block including the user32.dll import declarations.

  2. Test 2PowerShell COM Shell.Application Window Enumeration

    Expected signal: Sysmon Event ID 1: Process Create with Image=powershell.exe, CommandLine containing 'Shell.Application' and 'Windows()'. PowerShell ScriptBlock Log Event ID 4104 with the full COM enumeration code. No network connection events expected as this is a local enumeration call.

  3. Test 3PowerShell Full Window Enumeration via EnumWindows Callback

    Expected signal: Sysmon Event ID 1: Process Create with Image=powershell.exe, CommandLine containing 'Add-Type', 'EnumWindows', 'GetWindowText', 'IsWindowVisible', and 'user32.dll'. PowerShell ScriptBlock Log Event ID 4104 with the full multi-line Add-Type type definition including all three DllImport declarations and the callback delegate pattern.

  4. Test 4VBScript COM Window Enumeration via Shell.Application

    Expected signal: File creation event (Sysmon Event ID 11) for %TEMP%\df00tech_wintenum.vbs. Sysmon Event ID 1: Process Create with Image=cscript.exe, CommandLine containing '//e:vbscript' and the .vbs filename. The VBScript content (Shell.Application COM enumeration) will be visible in script file artifacts but not the cscript command line itself — emphasizing the need for script content logging where available.

Unlock Pro Content

Get the full detection package for T1010 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections