Detect System Time Discovery in IBM QRadar
Adversaries may gather the system time and/or time zone settings from a local or remote system. System time is commonly queried to support time-bomb payloads (activating only after a preset date), sandbox evasion (detecting analysis environments via uptime or timestamp checks), encryption key generation seeded with timestamps, and victim targeting based on locale inference from timezone. Common methods include net time, w32tm /tz, GetSystemTime(), GetTickCount(), timedatectl, systemsetup -gettimezone, and ESXi-specific commands like esxcli system clock get. Malware families including Shamoon, ShrinkLocker, EvilBunny, Zebrocy, and Taidoor have all used system time queries for these purposes.
MITRE ATT&CK
- Tactic
- Discovery
- Technique
- T1124 System Time Discovery
- Canonical reference
- https://attack.mitre.org/techniques/T1124/
QRadar Detection Query
SELECT
DATEFORMAT(starttime, 'YYYY-MM-dd HH:mm:ss') AS event_time,
logsourcename(logsourceid) AS log_source,
"sourceip",
username,
"Process Name" AS process_name,
"Process CommandLine" AS command_line,
"Parent Process Path" AS parent_process,
CASE
WHEN LOWER("Process CommandLine") MATCHES '.*net1?\.exe.*\\btime\\b.*\\\\\\\\.*' THEN 1
ELSE 0
END AS is_remote_time_query,
CASE
WHEN LOWER("Process CommandLine") MATCHES '.*((/tz)|(/query)|timezone|gettimezone).*' THEN 1
ELSE 0
END AS is_timezone_query,
CASE
WHEN LOWER("Process CommandLine") MATCHES '.*(stripchart|gettickcount|uptime).*' THEN 1
ELSE 0
END AS is_uptime_query,
CASE
WHEN LOWER("Parent Process Path") MATCHES '.*(powershell|pwsh|wscript|cscript|mshta|regsvr32|rundll32).*' THEN 1
ELSE 0
END AS suspicious_parent
FROM events
WHERE
LOGSOURCETYPENAME(devicetype) IN ('Microsoft Windows Security Event Log', 'Sysmon')
AND eventid IN (4688, 1)
AND (
(LOWER("Process Name") MATCHES '.*(\\\\|/)net1?\.exe' AND LOWER("Process CommandLine") LIKE '%time%')
OR LOWER("Process Name") MATCHES '.*(\\\\|/)w32tm\.exe'
OR (LOWER("Process Name") MATCHES '.*(\\\\|/)timedatectl' AND LOWER("Process CommandLine") MATCHES '.*(status|show|timesync).*')
OR (LOWER("Process Name") MATCHES '.*(\\\\|/)systemsetup' AND LOWER("Process CommandLine") MATCHES '.*(-gettimezone|-getnetworktimeserver).*')
OR (LOWER("Process CommandLine") MATCHES '.*esxcli.*system.*clock.*')
)
AND LAST 24 HOURS
ORDER BY starttime DESC QRadar AQL query detecting system time discovery activity from Windows Security Event Log (EventID 4688) and Sysmon (EventID 1) process creation events. Flags net time, w32tm, timedatectl, systemsetup, and ESXi clock queries with enrichment fields for remote queries, timezone queries, and suspicious parent processes.
Data Sources
Required Tables
False Positives & Tuning
- Domain-joined workstations running net time against a domain controller as part of normal Kerberos pre-authentication clock sync procedures
- Windows Time Service (W32Time) itself logging w32tm.exe process activity during scheduled NTP synchronization cycles
- Linux infrastructure automation tools (Ansible, Chef, Puppet) invoking timedatectl to verify or set system time during provisioning runbooks
Other platforms for T1124
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.
- Test 1Local System Time Query via net time
Expected signal: Sysmon Event ID 1: Process Create with Image=C:\Windows\System32\net.exe, CommandLine='net time'. Security Event ID 4688 (if command line auditing enabled). Parent process will be cmd.exe or the test runner.
- Test 2Timezone and Time Source Discovery via w32tm
Expected signal: Sysmon Event ID 1: Two Process Create events — w32tm.exe with CommandLine 'w32tm /tz' and 'w32tm /query /status'. Security Event ID 4688 for each invocation if audit process creation is enabled.
- Test 3Remote System Time Discovery via net time with hostname
Expected signal: Sysmon Event ID 1: Process Create with Image=net.exe, CommandLine containing 'net time \\<hostname>'. Sysmon Event ID 3: Network connection to the target host on port 445 (SMB). Security Event ID 4688 if audit policy is configured.
- Test 4System Time Discovery via PowerShell (Scripted Discovery Simulation)
Expected signal: Sysmon Event ID 1: Process Create with Image=powershell.exe and CommandLine containing '[DateTime]::UtcNow', '[Environment]::TickCount', and '[System.TimeZoneInfo]'. PowerShell ScriptBlock Logging Event ID 4104 captures the full script. Sysmon Event ID 11: File Create for df00tech-time.txt in %TEMP%.
References (10)
- https://attack.mitre.org/techniques/T1124/
- https://technet.microsoft.com/windows-server-docs/identity/ad-ds/get-started/windows-time-service/windows-time-service-tools-and-settings
- https://msdn.microsoft.com/ms724961.aspx
- https://any.run/cybersecurity-blog/time-bombs-malware-with-delayed-execution/
- https://learn.microsoft.com/en-us/defender-endpoint/advanced-hunting-deviceprocessevents-table
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1124/T1124.md
- https://github.com/SigmaHQ/sigma/blob/master/rules/windows/process_creation/proc_creation_win_net_time.yml
- https://www.picussecurity.com/resource/virtualization/sandbox-evasion-how-attackers-avoid-malware-analysis
- https://unit42.paloaltonetworks.com/shamoon-3-targets-oil-gas-organization/
- https://www.welivesecurity.com/2022/01/25/watering-hole-deploys-new-macos-malware-dazzlespy-asia/
Unlock Pro Content
Get the full detection package for T1124 including response playbook, investigation guide, and atomic red team tests.