T1497.003 Microsoft Sentinel · KQL

Detect Time Based Checks in Microsoft Sentinel

Adversaries may employ various time-based methods to detect virtualization and analysis environments, particularly those that attempt to manipulate time mechanisms to simulate longer elapses of time. This includes using GetTickCount and GetSystemTimeAsFileTime to detect time acceleration in sandboxes, implementing long sleep delays (minutes to hours) to outlast sandbox analysis timeouts, checking system uptime to verify the machine has been running for a reasonable period, computing execution timing differences before and after sleep to detect sandbox time manipulation, and using API hammering (excessive printf or I/O calls) to delay execution. Notable examples include SUNBURST (2-week dormancy), Ursnif (30-minute delay), Bumblebee (hardcoded and randomized sleep intervals), and TrickBot (printf-based API hammering).

MITRE ATT&CK

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

KQL Detection Query

Microsoft Sentinel (KQL)
kusto
let TimingAPIs = dynamic(["GetTickCount", "GetSystemTimeAsFileTime", "QueryPerformanceCounter", "NtQuerySystemTime", "timeGetTime", "GetSystemTime"]);
let SleepCommands = dynamic(["Start-Sleep", "timeout /t", "ping -n", "WScript.Sleep", "Thread.Sleep", "kernel32!Sleep", "sleep("]);
let UptimeChecks = dynamic(["systeminfo | find \"Boot Time\"", "net statistics", "wmic os get lastbootuptime", "GetTickCount64"]);
DeviceProcessEvents
| where Timestamp > ago(24h)
| where ProcessCommandLine has_any (TimingAPIs)
    or (ProcessCommandLine has_any (SleepCommands) and InitiatingProcessFileName !in~ ("svchost.exe", "explorer.exe", "taskhostw.exe"))
    or ProcessCommandLine has_any (UptimeChecks)
    or (FileName =~ "timeout.exe" and ProcessCommandLine matches regex @"timeout\s+/t\s+\d{3,}")
    or (FileName =~ "ping.exe" and ProcessCommandLine matches regex @"ping\s+-n\s+\d{3,}\s+127\.0\.0\.1")
| extend TimingAPICheck = ProcessCommandLine has_any (TimingAPIs)
| extend LongSleep = (FileName =~ "timeout.exe" and ProcessCommandLine matches regex @"\d{3,}")
    or (FileName =~ "ping.exe" and ProcessCommandLine has "127.0.0.1" and ProcessCommandLine matches regex @"-n\s+\d{3,}")
| extend SleepCommand = ProcessCommandLine has_any ("Start-Sleep", "WScript.Sleep", "Thread.Sleep")
| extend UptimeQuery = ProcessCommandLine has_any ("lastbootuptime", "Boot Time", "net statistics")
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
         InitiatingProcessFileName, InitiatingProcessCommandLine,
         TimingAPICheck, LongSleep, SleepCommand, UptimeQuery
| sort by Timestamp desc
medium severity low confidence

Detects time-based sandbox evasion techniques including timing API calls (GetTickCount, QueryPerformanceCounter), extended sleep delays using timeout/ping/PowerShell, system uptime queries, and sleep-based anti-analysis loops. Covers techniques used by SUNBURST, Ursnif, Bumblebee, Okrum (GetTickCount comparison), BendyBear, and Egregor (3+ minute sleeps).

Data Sources

Process: Process CreationCommand: Command ExecutionProcess: OS API ExecutionMicrosoft Defender for Endpoint

Required Tables

DeviceProcessEvents

False Positives & Tuning

  • Batch scripts using timeout or ping for legitimate delays between operations
  • PowerShell scripts with Start-Sleep for pacing API calls to avoid rate limiting
  • System monitoring tools that check uptime as part of health reporting
  • Application installers that pause between installation phases
Download portable Sigma rule (.yml)

Other platforms for T1497.003


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 1Extended timeout delay for sandbox evasion

    Expected signal: Sysmon Event ID 1: Process Create for timeout.exe with '/t 180' argument. The process will be visible in task list for the duration of the delay. Security Event ID 4688 with command line.

  2. Test 2Ping-based sleep for sandbox evasion

    Expected signal: Sysmon Event ID 1: Process Create for ping.exe with '-n 300 127.0.0.1' arguments. Sysmon Event ID 3: Network Connection events to 127.0.0.1 (loopback).

  3. Test 3WMI uptime check for sandbox detection

    Expected signal: Sysmon Event ID 1: Process Create for wmic.exe with 'os get lastbootuptime' arguments. WMI Operational log entry for Win32_OperatingSystem query.

Unlock Pro Content

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

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections