T1497.002 Sumo Logic CSE · Sumo

Detect User Activity Based Checks in Sumo Logic CSE

Adversaries may employ various user activity checks to detect and avoid virtualization and analysis environments. This includes checking mouse movement speed/frequency, click patterns, browser history and bookmarks, number of files on the desktop or in common directories, recently opened documents, and presence of user-created files. Some malware requires specific user interaction before activating, such as waiting for a document to close, a user to double-click an embedded image, or waiting for mouse button presses. Darkhotel checks mouse cursor position repeatedly, Okrum requires three left-clicks before executing, and FIN7 used embedded images requiring double-clicks to activate.

MITRE ATT&CK

Tactic
Defense Evasion Discovery
Technique
T1497 Virtualization/Sandbox Evasion
Sub-technique
T1497.002 User Activity Based Checks
Canonical reference
https://attack.mitre.org/techniques/T1497/002/

Sumo Detection Query

Sumo Logic CSE (Sumo)
sql
_sourceCategory=*windows*sysmon* OR _sourceCategory=*wineventlog*security*
| where EventID = 1 OR EventCode = 1
| parse regex "(?i)<Data Name='CommandLine'>(?<CommandLine>[^<]+)" nodrop
| parse regex "(?i)<Data Name='Image'>(?<Image>[^<]+)" nodrop
| parse regex "(?i)<Data Name='ParentImage'>(?<ParentImage>[^<]+)" nodrop
| parse regex "(?i)<Data Name='User'>(?<User>[^<]+)" nodrop
| parse regex "(?i)<Data Name='ParentCommandLine'>(?<ParentCommandLine>[^<]+)" nodrop
| eval cmd_lower = toLowerCase(CommandLine)
| eval img_lower = toLowerCase(Image)
| eval mouse_check = if(matches(cmd_lower, "(?i)(getcursorpos|getlastinputinfo|mouse_event|setcursorpos|getasynckeystate)"), 1, 0)
| eval window_check = if(matches(cmd_lower, "(?i)(getforegroundwindow|getdesktopwindow)"), 1, 0)
| eval file_count_check = if(matches(cmd_lower, "(?i)(desktop|recent|downloads|documents)") and matches(cmd_lower, "(?i)(count|\.count|find /c|measure-object|wc -l)"), 1, 0)
| eval recentdocs_check = if(matches(cmd_lower, "(?i)recentdocs"), 1, 0)
| eval browser_history_check = if(matches(cmd_lower, "(?i)(history|bookmarks|cookies|places\.sqlite)") and !matches(img_lower, "(?i)(chrome|firefox|msedge|brave|opera)\.exe"), 1, 0)
| eval suspicion_score = (mouse_check * 2) + (window_check * 2) + file_count_check + recentdocs_check + browser_history_check
| where suspicion_score > 0
| fields _messageTime, Computer, User, Image, CommandLine, ParentImage, ParentCommandLine, mouse_check, window_check, file_count_check, recentdocs_check, browser_history_check, suspicion_score
| sort by _messageTime desc
medium severity medium confidence

Sumo Logic detection for T1497.002 using Sysmon EventID 1 (Process Create) events. Parses XML-structured Sysmon event payloads to extract CommandLine, Image, ParentImage, and User fields, then applies a weighted suspicion scoring model across five user activity enumeration subcategories. Events scoring above zero are surfaced for analyst triage. Requires Sysmon deployed with a configuration that captures command line data.

Data Sources

Sumo Logic Sysmon App (Windows Sysmon EventID 1)Windows Security Event Log with process creation auditing and command line capture (EventID 4688)

Required Tables

_sourceCategory=*windows*sysmon*_sourceCategory=*wineventlog*security*

False Positives & Tuning

  • Legitimate Robotic Process Automation workflows using AutoHotkey, Sikuli, or WinAppDriver that programmatically invoke mouse and window Win32 APIs during UI-driven automation
  • Scheduled PowerShell tasks executed by endpoint management tooling that count files in Desktop or Downloads directories as part of periodic housekeeping or telemetry collection
  • Browser migration utilities or password managers that read browser history, cookies, or bookmarks paths during profile import or credential synchronisation operations
Download portable Sigma rule (.yml)

Other platforms for T1497.002


Testing Methodology

Validate this detection against 3 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 1Check desktop file count for sandbox detection

    Expected signal: Sysmon Event ID 1: Process Create for cmd.exe with 'dir /b' + Desktop path, piped to find.exe. Two process events generated.

  2. Test 2Check RecentDocs registry for user activity

    Expected signal: Sysmon Event ID 1: Process Create for reg.exe with RecentDocs query. Sysmon Event ID 13: Registry key access event for the RecentDocs path.

  3. Test 3PowerShell mouse position check for sandbox detection

    Expected signal: Sysmon Event ID 1: PowerShell process with GetCursorPos in command line. PowerShell ScriptBlock Log Event ID 4104 with the full P/Invoke code and mouse check logic.

Unlock Pro Content

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

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections