Detect System Time Discovery in Splunk
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/
SPL Detection Query
index=wineventlog (sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=1)
(Image="*\\net.exe" OR Image="*\\net1.exe" OR Image="*\\w32tm.exe")
| eval CommandLine=lower(CommandLine)
| eval IsNetTime=if(match(CommandLine, "net(1)?\.exe.*\btime\b"), 1, 0)
| eval IsRemoteTimeQuery=if(match(CommandLine, "net(1)?\.exe.*\btime\b.*\\\\"), 1, 0)
| eval IsW32tmQuery=if(match(Image, "w32tm"), 1, 0)
| eval IsTimezoneQuery=if(match(CommandLine, "(/tz|/query|timezone|gettimezone)"), 1, 0)
| eval IsUptimeQuery=if(match(CommandLine, "(stripchart|gettickcount|uptime)"), 1, 0)
| eval SuspiciousParent=if(match(lower(ParentImage), "(powershell|pwsh|wscript|cscript|mshta|regsvr32|rundll32)"), 1, 0)
| eval SuspicionScore=IsNetTime + IsRemoteTimeQuery + IsW32tmQuery + IsTimezoneQuery + IsUptimeQuery + SuspiciousParent
| where SuspicionScore > 0
| table _time, host, User, Image, CommandLine, ParentImage, ParentCommandLine,
IsNetTime, IsRemoteTimeQuery, IsW32tmQuery, IsTimezoneQuery, IsUptimeQuery, SuspiciousParent, SuspicionScore
| sort - _time Detects system time discovery activity using Sysmon Event ID 1 (Process Creation). Monitors net.exe, net1.exe, and w32tm.exe invocations for time-related subcommands. Assigns Boolean indicator fields and a cumulative suspicion score to allow threshold-based alerting. Remote time queries (net time \\hostname) and time commands launched by scripting interpreters receive higher scores and should be prioritized for analyst review.
Data Sources
Required Sourcetypes
False Positives & Tuning
- NTP monitoring tools and network management platforms (SolarWinds, PRTG, Nagios) that routinely query system time for drift detection
- IT automation scripts (Ansible, PowerShell DSC, SCCM) that check system time before applying scheduled changes or patches
- Software installations and license managers that validate the system clock before activating features or checking certificate expiry
- Backup and replication agents that synchronize timestamps across systems or verify time consistency before initiating jobs
- Security tools and SIEMs that query w32tm for time-sync audit compliance checks
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.