T1010 Google Chronicle · YARA-L

Detect Application Window Discovery in Google Chronicle

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/

YARA-L Detection Query

Google Chronicle (YARA-L)
yaral
rule t1010_application_window_discovery {
  meta:
    author = "Detection Engineering"
    description = "Detects T1010 Application Window Discovery via script interpreter window API calls, automation tools with unusual parents, or known window enumeration utilities"
    severity = "MEDIUM"
    priority = "MEDIUM"
    mitre_attack_tactic = "Discovery"
    mitre_attack_technique = "T1010"
    platform = "Windows"
    reference = "https://attack.mitre.org/techniques/T1010/"

  events:
    $e.metadata.event_type = "PROCESS_LAUNCH"
    (
      (
        re.regex($e.target.process.file.full_path,
          `(?i)(powershell|pwsh|wscript|cscript|mshta|python[23]?|ruby|perl)\.exe$`) and
        (
          re.regex($e.target.process.command_line,
            `(?i)(getforegroundwindow|enumwindows|findwindow|getwindowtext|getactivewindow|enumchildwindows|getwindowlong|getwindowrect|findwindowex|getwindowinfo)`) or
          (
            re.regex($e.target.process.command_line, `(?i)(add-type|dllimport)`) and
            re.regex($e.target.process.command_line, `(?i)user32`) and
            re.regex($e.target.process.command_line, `(?i)(window|hwnd)`)
          ) or
          (
            re.regex($e.target.process.command_line, `(?i)shell\.application`) and
            re.regex($e.target.process.command_line, `(?i)\.windows\(\)`)
          )
        )
      ) or
      (
        re.regex($e.target.process.file.full_path,
          `(?i)(autoit3|autohotkey|ahk2exe)(_x64)?\.exe$`) and
        not re.regex($e.principal.process.file.full_path,
          `(?i)(explorer|devenv|code|notepad\+\+|sublime_text|atom|cursor)\.exe$`)
      ) or
      re.regex($e.target.process.file.full_path,
        `(?i)(winlister|wintitles|windowdetective|spyxx(_amd64)?|winspector)\.exe$`)
    )

  condition:
    $e
}
medium severity medium confidence

Chronicle YARA-L 2.0 rule detecting T1010 Application Window Discovery using UDM PROCESS_LAUNCH events. Evaluates three detection vectors using UDM principal/target process model: (1) script interpreters (PowerShell, Python, WScript, etc.) with command lines referencing window enumeration API names or containing P/Invoke user32.dll loading patterns, (2) automation tools (AutoHotkey, AutoIt) where the initiating principal process is not a recognized development or desktop environment, and (3) known third-party window listing utilities historically abused by malware families including njRAT and DarkWatchman.

Data Sources

Google Chronicle SIEMChronicle Unified Data Model (UDM)Windows endpoint telemetry via Chronicle Forwarder or partner ingestion

Required Tables

UDM PROCESS_LAUNCH events

False Positives & Tuning

  • Desktop automation workflows using AutoHotkey or AutoIt for legitimate UI scripting where the parent process is a scheduled task host, RPA engine, or custom launcher not matched by the principal process exclusion regex
  • Security engineers and Windows GUI developers executing Spy++ (spyxx.exe, spyxx_amd64.exe) for window message spy and control hierarchy inspection during normal Visual Studio debugging workflows
  • PowerShell-based configuration management or deployment scripts using Add-Type with DllImport targeting user32.dll for programmatic window handling during unattended application setup or accessibility provisioning
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