This hypothesis posits that adversaries are leveraging the TSCookie mechanism to establish persistent footholds within Azure workloads by embedding tracking tokens directly into system memory. Proactive hunting for this specific artifact is essential to identify early-stage reconnaissance or lateral movement activities that may evade traditional network-based detection controls in the Sentinel environment.
rule TSCookie {
meta:
description = "detect TSCookie in memory"
author = "JPCERT/CC Incident Response Group"
rule_usage = "memory scan"
reference = "https://blogs.jpcert.or.jp/en/2018/03/malware-tscooki-7aa0.html"
hash1 = "6d2f5675630d0dae65a796ac624fb90f42f35fbe5dec2ec8f4adce5ebfaabf75"
strings:
$v1 = "Mozilla/4.0 (compatible; MSIE 8.0; Win32)" wide
$b1 = { 68 D4 08 00 00 }
condition: all of them
}
This YARA rule can be deployed in the following contexts:
This rule contains 2 string patterns in its detection logic.
Here are 4 specific false positive scenarios for the detect TSCookie in memory rule within an enterprise environment, along with suggested filters or exclusions:
Citrix Workspace App Background Processes
TSCookie strings into its memory space during the initialization of secure sessions and background policy checks. This often occurs on user workstations even when no active remote session is established, triggering the rule due to the presence of the cookie in the process heap.C:\Program Files\Citrix\ICA Client\* or specifically target the wfcrun32.exe and Citrix_WebHelper.exe binaries.Scheduled Enterprise Backup Jobs
TSCookie artifacts from the underlying hypervisor or management console.VeeamAgent.exe, cvpsservice.exe, and their child processes.ITSM Ticketing System Updates
TSCookie data into memory to validate session tokens for API calls. This is particularly common during end-of-month reporting cycles.