Detect System Time Discovery in Elastic Security
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/
Elastic Detection Query
sequence by host.id with maxspan=5m
[process where event.type == "start" and
(
(process.name in~ ("net.exe", "net1.exe") and process.args : "time") or
process.name == "w32tm.exe" or
(process.name == "timedatectl" and process.args in ("status", "show", "timesync-status")) or
(process.name == "systemsetup" and process.args in ("-gettimezone", "-getnetworktimeserver")) or
(process.args : ("esxcli") and process.command_line : "*system clock*")
) and
process.parent.name in~ ("powershell.exe", "pwsh.exe", "wscript.exe", "cscript.exe", "mshta.exe", "cmd.exe", "regsvr32.exe", "rundll32.exe", "svchost.exe")
]
any where
(
process.name in~ ("net.exe", "net1.exe") and process.command_line : ("*time*\\\\*") /* remote time query */
) or
(
process.name == "w32tm.exe" and process.args in ("/tz", "/query", "/stripchart")
) or
(
process.name in~ ("net.exe", "net1.exe") and process.args : "time"
) Detects system time discovery activity via common Windows and cross-platform binaries including net time, w32tm, timedatectl, and systemsetup. Sequences suspicious parent process launches of time-querying binaries, including remote time queries against UNC paths indicating lateral reconnaissance.
Data Sources
Required Tables
False Positives & Tuning
- Legitimate IT administrators running w32tm /query or w32tm /resync for NTP synchronization troubleshooting
- Automated deployment scripts using net time to synchronize clocks before performing time-sensitive operations such as Kerberos ticket requests
- Monitoring agents or SCOM/Nagios scripts that periodically query system time to detect clock drift across infrastructure
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.