T1564

Hide Artifacts

Defense Evasion Last updated:

Adversaries may attempt to hide artifacts associated with their behaviors to evade detection. Operating systems may have features to hide various artifacts, such as important system files and administrative task execution, to avoid disrupting user work environments and prevent users from changing files or features on the system. Adversaries may abuse these features to hide artifacts such as files, directories, user accounts, or other system activity to evade detection. Sub-techniques cover hidden files and directories, hidden users, hidden windows, NTFS alternate data streams, hidden file systems, virtual instance abuse, VBA stomping, email hiding rules, resource forking, process argument spoofing, and scheduled task SD registry deletion.

What is T1564 Hide Artifacts?

Hide Artifacts (T1564) maps to the Defense Evasion tactic — the adversary is trying to avoid being detected in MITRE ATT&CK.

This page provides production-ready detection logic for Hide Artifacts, covering the data sources and telemetry it touches: Process: Process Creation, Command: Command Execution, Windows Registry: Windows Registry Key Deletion, Microsoft Defender for Endpoint. The queries below are rated high severity at high confidence, and ship for 7 SIEM platforms — KQL, SPL, Elastic, QRadar, Sumo, YARA-L, LogScale.

MITRE ATT&CK

Tactic
Defense Evasion
Technique
T1564 Hide Artifacts
Canonical reference
https://attack.mitre.org/techniques/T1564/
Microsoft Sentinel / Defender
kusto
// T1564 — Hide Artifacts: multi-signal detection across sub-techniques
// Signal 1: attrib command used to hide files or directories (T1564.001)
let HiddenFileAttrib = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName =~ "attrib.exe"
| where ProcessCommandLine has_any ("+h ", "+s ", "+h+s", "+s+h")
| extend Signal = "HiddenFileAttribute"
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
          InitiatingProcessFileName, InitiatingProcessCommandLine, Signal;
// Signal 2: NTFS Alternate Data Streams written via cmd/powershell (T1564.004)
let ADSCreation = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName in~ ("cmd.exe", "powershell.exe", "pwsh.exe")
| where ProcessCommandLine matches regex @">\s*[^\s:]+:[^\\/:*?""<>|\s]+"
       or ProcessCommandLine has "Set-Content" and ProcessCommandLine matches regex @"-Path\s+[^:]+:[^\s]+"
       or ProcessCommandLine has "Out-File" and ProcessCommandLine matches regex @"-FilePath\s+[^:]+:[^\s]+"
| extend Signal = "NTFSAlternateDataStream"
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
          InitiatingProcessFileName, InitiatingProcessCommandLine, Signal;
// Signal 3: Scheduled task Security Descriptor (SD) registry value deletion (Tarrask — T1564)
let HiddenScheduledTask = DeviceRegistryEvents
| where Timestamp > ago(24h)
| where ActionType == "RegistryValueDeleted"
| where RegistryKey has @"\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree"
| where RegistryValueName =~ "SD"
| extend Signal = "HiddenScheduledTaskSD"
| project Timestamp, DeviceName, AccountName=InitiatingProcessAccountName,
          FileName=InitiatingProcessFileName, ProcessCommandLine=InitiatingProcessCommandLine,
          RegistryKey, RegistryValueName,
          InitiatingProcessFileName, InitiatingProcessCommandLine, Signal;
// Signal 4: Hidden window flag used in scripting (T1564.003)
let HiddenWindow = DeviceProcessEvents
| where Timestamp > ago(24h)
| where ProcessCommandLine has_any ("-WindowStyle Hidden", "-w hidden", "-WindowStyle h",
                                    "/windowstyle hidden", "SW_HIDE", "ShowWindow", "0x0 start")
| where FileName !in~ ("explorer.exe", "msiexec.exe", "svchost.exe")
| extend Signal = "HiddenWindowExecution"
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
          InitiatingProcessFileName, InitiatingProcessCommandLine, Signal;
// Signal 5: Windows API calls to hide window via wscript/cscript/mshta
let HiddenScriptWindow = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName in~ ("wscript.exe", "cscript.exe", "mshta.exe")
| where ProcessCommandLine has_any ("//b ", "//B ", "CreateObject", "WScript.CreateObject")
| extend Signal = "HiddenScriptBatchMode"
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
          InitiatingProcessFileName, InitiatingProcessCommandLine, Signal;
// Signal 6: icacls or cacls used to deny Everyone/Users access to hide files (T1564.001)
let AccessDenialToHide = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName in~ ("icacls.exe", "cacls.exe", "takeown.exe")
| where ProcessCommandLine has_any ("/deny Everyone", "/deny *S-1-1-0", "/deny Users", "/deny *S-1-5-32-545")
| extend Signal = "FileAccessDeniedToHide"
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
          InitiatingProcessFileName, InitiatingProcessCommandLine, Signal;
// Union all signals
union HiddenFileAttrib, ADSCreation, HiddenScheduledTask, HiddenWindow, HiddenScriptWindow, AccessDenialToHide
| sort by Timestamp desc

Multi-signal detection for T1564 Hide Artifacts across the most commonly observed sub-techniques. Detects: (1) attrib.exe setting hidden/system file attributes; (2) NTFS Alternate Data Stream creation via cmd or PowerShell redirection syntax; (3) Scheduled task Security Descriptor registry value deletion — the Tarrask technique that makes tasks invisible to schtasks and Task Scheduler UI; (4) hidden window execution flags in process command lines; (5) wscript/cscript batch mode (//b) used to suppress windows; (6) icacls used to deny access to files, obscuring them from normal users. Uses DeviceProcessEvents and DeviceRegistryEvents from Microsoft Defender for Endpoint.

high severity high confidence

Data Sources

Process: Process Creation Command: Command Execution Windows Registry: Windows Registry Key Deletion Microsoft Defender for Endpoint

Required Tables

DeviceProcessEvents DeviceRegistryEvents

False Positives

  • System administrators using attrib.exe to mark backup or configuration files as hidden/system to prevent accidental deletion
  • Software installers and package managers that legitimately set hidden attributes on their program files during installation
  • Legitimate security or monitoring tools that use hidden windows (wscript //b, mshta) for background polling and scheduled checks
  • Enterprise backup solutions (Veeam, Commvault) that manipulate NTFS attributes and ACLs as part of their backup and restore operations
  • Development tools (Visual Studio, Node.js) that create NTFS Alternate Data Streams as part of zone identifier or metadata tracking

Sigma rule & cross-platform mapping

The detection logic for Hide Artifacts (T1564) above is provided in a vendor-neutral form so you can deploy it on any SIEM. The same logic is shipped here as native KQL (Microsoft Sentinel / Defender), SPL (Splunk), Elastic (Elastic Security (EQL)), QRadar (IBM QRadar (AQL)), Sumo (Sumo Logic CSE), YARA-L (Google Chronicle / SecOps), LogScale (CrowdStrike LogScale (CQL)) queries. In Sigma terms, this detection targets the following logsource:

logsource:
  category: process_creation
  product: windows

Browse the community-maintained Sigma rules for this technique:


Testing Methodology

Validate this detection against 5 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 1Hide File Using Attrib Command

    Expected signal: Sysmon Event ID 1: Process Create for attrib.exe with CommandLine '+h +s %TEMP%\t1564-test.txt'. Security Event ID 4688 (if command line auditing enabled). DeviceProcessEvents in MDE: FileName=attrib.exe, ProcessCommandLine contains '+h' and '+s'. The 'dir' command at the end will show no file — confirming hiding worked.

  2. Test 2Write Payload to NTFS Alternate Data Stream

    Expected signal: Sysmon Event ID 15 (FileCreateStreamHash): TargetFilename='%TEMP%\t1564-ads-test.txt:hidden_payload.ps1', Hash of stream content. Sysmon Event ID 1: cmd.exe process create with redirect operator and colon-delimited stream path in CommandLine. DeviceFileEvents in MDE: ActionType=FileCreated with stream notation in FileName. The 'dir /r' output will show both the main file and ':hidden_payload.ps1:$DATA' confirming ADS creation.

  3. Test 3Delete Scheduled Task Security Descriptor to Hide Task (Tarrask Technique)

    Expected signal: Sysmon Event ID 13 (RegistryEvent - Value Delete): TargetObject='HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree\Microsoft\Windows\T1564-HiddenTask\SD', EventType='DeleteValue', Image='reg.exe'. Security Event ID 4698 (scheduled task created) for the initial schtasks /create. Security Event ID 4699 will NOT fire for the SD deletion — only the Sysmon registry event captures this. DeviceRegistryEvents in MDE: ActionType=RegistryValueDeleted, RegistryKey contains 'TaskCache\Tree', RegistryValueName='SD'.

  4. Test 4Hide Script Execution Using Wscript Batch Mode (Hidden Window)

    Expected signal: Sysmon Event ID 1: Process Create for wscript.exe with CommandLine '//b //nologo %TEMP%\t1564-hidden.vbs'. ParentImage will be cmd.exe (from the atomic test) but in real attacks is often outlook.exe, explorer.exe, or mshta.exe. Security Event ID 4688 (if command line auditing enabled). DeviceProcessEvents in MDE: FileName=wscript.exe, ProcessCommandLine contains '//b'. No console window or UI appears on the desktop.

  5. Test 5Linux Hidden File and Directory Creation

    Expected signal: Auditd syscall events: execve for mkdir, echo/tee, chmod with dotfile paths. Syslog/auditd: SYSCALL records with comm='mkdir' and a0 pointing to path starting with dot. Linux process creation events in Sysmon for Linux (if deployed): Image=/bin/mkdir, CommandLine contains '.t1564-hidden-dir'. The first ls command returns no output (directory is hidden), the second ls -la shows it — confirming the hiding behavior.


Response Playbook

Triage

  1. Identify the specific sub-technique signal that fired: hidden file attribute (attrib), NTFS ADS, scheduled task SD deletion, hidden window, or access denial — each has a different investigation path and urgency.
  2. For attrib.exe signals: examine the full command line to determine which file or directory was targeted. Run 'dir /ah' in the target directory to enumerate all hidden files. Cross-reference with DeviceFileEvents to see if the hidden file was recently created or modified.
  3. For NTFS ADS signals: extract the target file and stream name from the command line. Use 'dir /r <filename>' or 'Get-Item <filename> -Stream *' in PowerShell to enumerate all streams. Read the stream content: 'Get-Content <file>:<stream>' — look for executable content (MZ header, base64 blobs, scripts).
  4. For scheduled task SD deletion (Tarrask pattern): identify the task name from the registry key path (everything after TaskCache\Tree\). Run 'schtasks /query /fo LIST /v' — the hidden task will NOT appear. Check C:\Windows\System32\Tasks\ directly for the XML file. Examine the task action (what executable it runs, what arguments it passes).
  5. For hidden window signals: determine if this is wscript/cscript running a VBS/JS payload or PowerShell with WindowStyle Hidden. Examine the script file being executed, check DeviceFileEvents for recently dropped scripts in temp directories (%TEMP%, %APPDATA%, C:\ProgramData).
  6. Pivot to DeviceNetworkEvents: did any of the processes generating these signals make outbound network connections? Connections to public IPs from attrib.exe parent processes or from scripts run with hidden windows are strong escalation indicators.
  7. Check the account context: is this a service account, local admin, domain user, or SYSTEM? Hiding artifacts under a privileged account with no corresponding change ticket warrants immediate escalation.
  8. Review process ancestry for all signals: trace the process tree back at least 3 levels using InitiatingProcessFileName and InitiatingProcessParentFileName. Malicious chains often include: browser/email → script interpreter → attrib/icacls → payload.

Containment

  1. If a hidden scheduled task (SD deletion) is confirmed: restore the SD registry value to make the task visible, then disable and delete it. Use reg.exe or regedit to navigate to HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree\<TaskName> and recreate the SD value, then run 'schtasks /delete /tn <TaskName> /f'.
  2. If a malicious ADS payload is confirmed: isolate the endpoint via EDR network isolation or VLAN change immediately. The ADS may contain a dropper or stager that has not yet been executed — isolate before the next execution trigger fires.
  3. If attrib.exe or icacls hiding is tied to active malware: isolate the endpoint. Use 'attrib -h -s <path>' or 'icacls <path> /reset' to restore file visibility for forensic collection before remediation.
  4. Revoke and rotate credentials for any accounts observed performing hiding operations, especially if under a privileged identity. Check for concurrent authentication activity (Event ID 4624, 4648) from the same account on other systems.
  5. Block the parent process or script file hash in EDR (Defender for Endpoint custom indicators or equivalent) to prevent re-execution on the same host or lateral spread to other hosts.
  6. If a virtual instance (T1564.006) is suspected as the containment boundary: do not simply stop the VM — capture a snapshot first for forensic analysis, then isolate the hypervisor host from the network.

Evidence Collection

  1. DeviceProcessEvents: full command line for attrib.exe, icacls.exe, cmd.exe, powershell.exe, wscript.exe involved in hiding operations — use Timestamp, DeviceName, AccountName, ProcessCommandLine, InitiatingProcessCommandLine.
  2. DeviceRegistryEvents: the deleted SD value from HKLM\...\Schedule\TaskCache\Tree\<TaskName> — capture ActionType=RegistryValueDeleted events with RegistryKey, RegistryValueName, InitiatingProcessCommandLine.
  3. DeviceFileEvents: file creation/modification events in the same directory as hidden files, especially in %TEMP%, %APPDATA%, C:\ProgramData, C:\Users\<user>\AppData. ADS creation may appear as ActionType=FileCreated with a colon in the FileName.
  4. Scheduled Task XML files: C:\Windows\System32\Tasks\ — copy the XML for any suspicious task. XML contains the full task definition including triggers, actions, and principal (the account used to run the task).
  5. Registry hive export: export HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree\ to capture the current state of all scheduled tasks including any with missing SD values.
  6. File system artifacts: use 'dir /r' or 'Get-ChildItem -Force -Recurse' with '-Stream *' to enumerate all ADS on suspicious files. Export stream contents: 'Get-Content <file>:<stream> | Out-File <evidence_path>'.
  7. Memory forensics if active exploitation suspected: capture a memory dump (ProcDump, Task Manager, or EDR live response) of any suspicious process associated with the hiding behavior for offline analysis.
  8. Windows Event Log — Microsoft-Windows-TaskScheduler/Operational: Event ID 106 (task registered), 140 (task updated), 141 (task deleted), 200/201 (task run start/finish) — cross-reference with the task name identified from the registry path.
  9. Prefetch for attrib.exe, icacls.exe: C:\Windows\Prefetch\ATTRIB.EXE-*.pf and ICACLS.EXE-*.pf contain timestamps of recent executions and DLLs loaded.

Escalation Criteria

  • ! Scheduled task SD deletion (Tarrask pattern) confirmed — this is an advanced persistence technique requiring elevated privileges and indicates a sophisticated threat actor with ongoing access.
  • ! NTFS Alternate Data Stream contains executable content (MZ header, base64-encoded PE, script payload) — the payload has been staged and is awaiting execution.
  • ! Hidden artifacts discovered in privileged system directories (C:\Windows\System32, C:\Windows\SysWOW64, C:\ProgramData\Microsoft) under a SYSTEM or domain admin account.
  • ! Multiple hiding sub-techniques observed on the same host within a short time window — combined use of attrib hiding + ADS + hidden scheduled task indicates a methodical post-exploitation workflow.
  • ! Hiding activity followed immediately by lateral movement indicators: new logon sessions (Event ID 4624 type 3), WMI activity, or SMB connections from the affected host.
  • ! The hidden file or ADS content contains known malware signatures, C2 framework artifacts (Cobalt Strike shellcode patterns, Metasploit stager headers), or credential harvesting tools.
  • ! Hiding operations performed by a non-interactive service account that has no business justification for manipulating file attributes or scheduled task registry keys.

Investigation Guide

Forensic Artifacts

  • > Registry: HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree\<TaskName> — absence of the SD value indicates a hidden task (Tarrask technique). The Tree key contains the task display name; the Tasks subkey contains the actual task definition by GUID.
  • > Registry: HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks\<GUID> — contains the Path, Hash, and Actions for each task. Cross-reference GUID with Tree to find tasks that have SD deleted.
  • > File System: C:\Windows\System32\Tasks\ — task XML files exist here even when the task is hidden via SD deletion. Hidden tasks will have a file here but no corresponding visible entry in schtasks output.
  • > File System: NTFS Alternate Data Streams — enumerate with 'Get-ChildItem -Path <dir> -Recurse | Get-Item -Stream *' in PowerShell, or 'dir /r' from cmd. ADS on executable files (.exe, .dll) is highly suspicious; ADS on documents may contain Zone.Identifier (legitimate) or payload data (malicious).
  • > File System: Files and directories with Hidden or System attributes — 'dir /ah /as C:\ /s /b' recursively lists all hidden/system files. Compare against a known-good baseline.
  • > Event Log: Microsoft-Windows-TaskScheduler/Operational — Event ID 106 (task registered), 141 (task deleted), 200 (task started), 201 (task completed). Correlate with the task name from the registry path.
  • > Event Log: Security — Event ID 4698 (scheduled task created), 4699 (task deleted), 4700/4701 (task enabled/disabled), 4702 (task updated) — these fire for user-created tasks but may be absent for tasks hidden via SD deletion before auditing was configured.
  • > File System: $MFT (Master File Table) — ADS entries appear in the MFT as separate $DATA attributes with a name. Tools like MFTExplorer or Velociraptor can enumerate all named data streams from the raw MFT without relying on the OS.
  • > Prefetch: C:\Windows\Prefetch\ATTRIB.EXE-*.pf, SCHTASKS.EXE-*.pf, REG.EXE-*.pf — execution timestamps and referenced files, useful for timeline reconstruction.
  • > USN Journal ($UsnJrnl:$J): records file attribute changes including when +h or +s was set, providing a timeline that may predate available event log data.

Tuning Guidance

The highest-fidelity signal in this detection is the scheduled task SD deletion (Tarrask pattern) — this has almost no legitimate use case and should be escalated immediately without tuning. For attrib.exe signals, build an allowlist of known-good parent processes: MSI installers (msiexec.exe), Windows Update (TrustedInstaller, wuauclt.exe), backup agents (beremote.exe, veeam*, cbengine.exe), and software package managers. Exclude attrib commands targeting well-known system-hidden paths like C:\System Volume Information, C:\$Recycle.Bin, and C:\Recovery. For NTFS ADS detection, the single highest-volume false positive is Zone.Identifier streams written by browsers on every downloaded file — the KQL regex and Sysmon Event ID 15 filter already exclude these, but validate your Sysmon config has Event ID 15 enabled with HashAlgorithms. For hidden window signals, exclude known-good software: printer drivers (splwow64.exe, PrintIsolationHost.exe), Windows services (svchost.exe, lsass.exe), and specifically-allow scripted IT tools by their parent process (psexec, SCCMexec) after verifying their hash. For ADS hunts, start with Sysmon Event ID 15 which fires only on ADS creation and is significantly lower volume than trying to detect ADS via command line regex. If Event ID 15 is not available, focus the cmd/PowerShell ADS regex on paths outside of C:\Windows and C:\Program Files to reduce volume substantially. Establish a scheduled task inventory baseline by exporting the TaskCache\Tree registry path weekly and comparing — any task that appears in the file system (C:\Windows\System32\Tasks) but not in a schtasks /query output is a candidate for investigation regardless of whether an SD deletion event was logged.


Hunting Queries

Hunt specifically for the Tarrask-style technique where the SD (Security Descriptor) registry value is deleted from scheduled task entries in the TaskCache\Tree registry path. Tasks with a deleted SD become invisible to schtasks.exe and the Task Scheduler UI while continuing to execute. This is a low-noise, high-fidelity indicator of sophisticated persistence.

Hunting — KQL
kql
// Hunt for scheduled tasks with missing SD values (Tarrask technique)
// Compares tasks visible via registry vs. tasks with SD intact
DeviceRegistryEvents
| where Timestamp > ago(30d)
| where ActionType == "RegistryValueDeleted"
| where RegistryKey has @"\Schedule\TaskCache\Tree\"
| where RegistryValueName =~ "SD"
| extend TaskName = extract(@"Tree\\(.+)$", 1, RegistryKey)
| summarize FirstSeen=min(Timestamp), LastSeen=max(Timestamp), DeleteCount=count()
         by TaskName, DeviceName, InitiatingProcessFileName, InitiatingProcessCommandLine
| sort by LastSeen desc
Hunting — SPL
spl
index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=13
  TargetObject="*\\Schedule\\TaskCache\\Tree\\*"
| where match(TargetObject, "\\SD$") AND EventType="DeleteValue"
| rex field=TargetObject "Tree\\\\(?<TaskName>.+)\\\\SD$"
| stats count as DeleteCount, earliest(_time) as FirstSeen, latest(_time) as LastSeen
        by TaskName, host, Image, CommandLine
| sort - LastSeen

Hunt for suspicious NTFS Alternate Data Stream creation using Sysmon Event ID 15 (FileCreateStreamHash) which fires specifically when an ADS is created. Filters out legitimate Zone.Identifier streams (created by browsers on downloaded files) and focuses on ADS in temp/appdata directories or on executable files. An ADS on an executable in a temp directory is a strong malware staging indicator.

Hunting — KQL
kql
// Hunt for NTFS Alternate Data Streams written with suspicious content
// Focuses on ADS written to executable-adjacent locations and system paths
DeviceFileEvents
| where Timestamp > ago(14d)
| where FileName matches regex @".*:[^\\/:*?""<>|\s]+$"
| where not (FileName endswith ":Zone.Identifier" or FileName endswith ":AFP_AfpInfo"
           or FileName endswith ":com.apple.quarantine")
| extend StreamName = extract(@":([^:]+)$", 1, FileName)
| extend BaseFile = extract(@"^(.+):", 1, FileName)
| where FolderPath has_any ("\\Windows\\Temp", "\\AppData", "\\ProgramData",
                             "\\Users\\Public", "\\Temp")
       or FileName endswith ".exe:" or FileName endswith ".dll:"
| project Timestamp, DeviceName, AccountName, FileName, StreamName, BaseFile,
          FolderPath, InitiatingProcessFileName, InitiatingProcessCommandLine
| sort by Timestamp desc
Hunting — SPL
spl
index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=15
| where NOT match(TargetFilename, "Zone\.Identifier|AFP_AfpInfo|com\.apple")
| rex field=TargetFilename "(?<BaseFile>[^:]+):(?<StreamName>.+)$"
| where isnotnull(StreamName) AND len(StreamName) > 0
| where match(TargetFilename, "\\\\(Temp|AppData|ProgramData|Users\\\\Public)\\\\")
       OR match(TargetFilename, "\.(exe|dll|bat|ps1|vbs|js):[^\\\\]+$")
| table _time, host, User, TargetFilename, BaseFile, StreamName, Image, CommandLine, Hash
| sort - _time

Hunt for bulk file-hiding operations where attrib or icacls is called many times in a short window. A single administrative task rarely requires hiding dozens of files; high-rate hiding activity suggests automated malware staging, ransomware pre-encryption preparation, or a threat actor systematically concealing tooling across a host.

Hunting — KQL
kql
// Hunt for mass file hiding or ACL denial operations suggesting cleanup/staging
DeviceProcessEvents
| where Timestamp > ago(14d)
| where FileName in~ ("attrib.exe", "icacls.exe", "cacls.exe")
| summarize Count=count(), TargetPaths=make_set(ProcessCommandLine, 20),
            Earliest=min(Timestamp), Latest=max(Timestamp)
         by DeviceName, AccountName, FileName, InitiatingProcessFileName
| where Count > 5
| extend DurationSeconds = datetime_diff("second", Latest, Earliest)
| extend RatePerMin = Count * 60.0 / max_of(DurationSeconds, 1)
| where RatePerMin > 2 or Count > 20
| project Earliest, Latest, DeviceName, AccountName, FileName,
          InitiatingProcessFileName, Count, RatePerMin, TargetPaths
| sort by Count desc
Hunting — SPL
spl
index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=1
  (Image="*\\attrib.exe" OR Image="*\\icacls.exe" OR Image="*\\cacls.exe")
| eval CommandLine=lower(CommandLine)
| where match(CommandLine, "\+h|\+s|/deny")
| bin _time span=5m
| stats count as Executions, values(CommandLine) as Commands, dc(host) as Hosts
        by _time, User, Image
| where Executions > 5
| sort - Executions

Atomic Red Team Tests

Test 1 Hide File Using Attrib Command
windows

Uses the built-in attrib.exe Windows utility to set the Hidden (+h) and System (+s) attributes on a test file, making it invisible to standard 'dir' commands and Windows Explorer (without 'Show hidden files' enabled). This is the most basic form of T1564.001 and is observed in commodity malware as a simple persistence aid.

Command

powershell
echo T1564 artifact hiding test > %TEMP%\t1564-test.txt && attrib +h +s %TEMP%\t1564-test.txt && dir %TEMP%\t1564-test.txt

Cleanup

powershell
attrib -h -s %TEMP%\t1564-test.txt && del %TEMP%\t1564-test.txt

Expected Telemetry

Sysmon Event ID 1: Process Create for attrib.exe with CommandLine '+h +s %TEMP%\t1564-test.txt'. Security Event ID 4688 (if command line auditing enabled). DeviceProcessEvents in MDE: FileName=attrib.exe, ProcessCommandLine contains '+h' and '+s'. The 'dir' command at the end will show no file — confirming hiding worked.

Expected Detection

Alert fires on attrib.exe with +h/+s in command line. KQL: Signal='HiddenFileAttribute'. SPL: Signal='HiddenFileAttribute', SuspicionScore >= 1.

Test 2 Write Payload to NTFS Alternate Data Stream
windows

Creates a benign text file and writes a secondary payload (a simple script) into a named Alternate Data Stream on that file. The ADS is invisible to standard dir commands and most file browsers. This technique is used by malware to hide additional stages or tools inside legitimate-looking files. Uses Sysmon Event ID 15 if available.

Command

powershell
echo legitimate content > %TEMP%\t1564-ads-test.txt && echo powershell.exe -NoProfile -Command whoami > %TEMP%\t1564-ads-test.txt:hidden_payload.ps1 && dir /r %TEMP%\t1564-ads-test.txt

Cleanup

powershell
del %TEMP%\t1564-ads-test.txt

Expected Telemetry

Sysmon Event ID 15 (FileCreateStreamHash): TargetFilename='%TEMP%\t1564-ads-test.txt:hidden_payload.ps1', Hash of stream content. Sysmon Event ID 1: cmd.exe process create with redirect operator and colon-delimited stream path in CommandLine. DeviceFileEvents in MDE: ActionType=FileCreated with stream notation in FileName. The 'dir /r' output will show both the main file and ':hidden_payload.ps1:$DATA' confirming ADS creation.

Expected Detection

Alert fires on ADS creation pattern in command line redirection (colon syntax). KQL: Signal='NTFSAlternateDataStream'. Sysmon Event ID 15 provides direct ADS creation telemetry independent of command-line matching.

Test 3 Delete Scheduled Task Security Descriptor to Hide Task (Tarrask Technique)
windows

Creates a scheduled task and then deletes its Security Descriptor (SD) registry value, making it invisible to schtasks.exe and the Task Scheduler GUI while leaving it fully functional. This is the exact technique used by the Tarrask malware attributed to HAFNIUM. The task remains in the file system (C:\Windows\System32\Tasks) and in registry subkeys, but disappears from enumeration tools. Requires elevated privileges.

Command

powershell
schtasks /create /tn "\Microsoft\Windows\T1564-HiddenTask" /tr "cmd.exe /c whoami > %TEMP%\task-ran.txt" /sc DAILY /st 23:59 /f && reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree\Microsoft\Windows\T1564-HiddenTask" /v SD /f && echo Task hidden. Verify: && schtasks /query /tn "\Microsoft\Windows\T1564-HiddenTask"

Cleanup

powershell
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree\Microsoft\Windows\T1564-HiddenTask" /v SD /t REG_BINARY /d 01000000 /f && schtasks /delete /tn "\Microsoft\Windows\T1564-HiddenTask" /f

Expected Telemetry

Sysmon Event ID 13 (RegistryEvent - Value Delete): TargetObject='HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree\Microsoft\Windows\T1564-HiddenTask\SD', EventType='DeleteValue', Image='reg.exe'. Security Event ID 4698 (scheduled task created) for the initial schtasks /create. Security Event ID 4699 will NOT fire for the SD deletion — only the Sysmon registry event captures this. DeviceRegistryEvents in MDE: ActionType=RegistryValueDeleted, RegistryKey contains 'TaskCache\Tree', RegistryValueName='SD'.

Expected Detection

Alert fires on SD value deletion from TaskCache\Tree. KQL: Signal='HiddenScheduledTaskSD'. SPL: EventCode=13, TargetObject matches TaskCache\Tree and SD suffix. This is the highest-fidelity signal in the detection set — near-zero false positive rate.

Test 4 Hide Script Execution Using Wscript Batch Mode (Hidden Window)
windows

Executes a VBScript file using wscript.exe with the //b (batch mode) flag, which suppresses all script errors and UI including dialog boxes. Combined with the //nologo flag, this creates a completely silent, windowless script execution that generates no visible UI artifacts for the user. Widely used by malware droppers and phishing payloads.

Command

powershell
echo WScript.Echo "T1564 hidden execution test" > %TEMP%\t1564-hidden.vbs && wscript.exe //b //nologo %TEMP%\t1564-hidden.vbs

Cleanup

powershell
del %TEMP%\t1564-hidden.vbs

Expected Telemetry

Sysmon Event ID 1: Process Create for wscript.exe with CommandLine '//b //nologo %TEMP%\t1564-hidden.vbs'. ParentImage will be cmd.exe (from the atomic test) but in real attacks is often outlook.exe, explorer.exe, or mshta.exe. Security Event ID 4688 (if command line auditing enabled). DeviceProcessEvents in MDE: FileName=wscript.exe, ProcessCommandLine contains '//b'. No console window or UI appears on the desktop.

Expected Detection

Alert fires on wscript.exe with //b batch mode flag. KQL: Signal='HiddenScriptBatchMode'. SPL: Signal='HiddenScriptBatchMode', Image matches wscript.exe, CommandLine contains //b.

Test 5 Linux Hidden File and Directory Creation
linux

Creates hidden files and directories on Linux by prefixing names with a dot (.), which causes them to be excluded from standard 'ls' output. This is the Unix/Linux equivalent of T1564.001. Observed in Linux malware (OSX/Shlayer, Bundlore) and post-exploitation toolkits that stage payloads in hidden directories under /tmp or user home directories.

Command

bash
mkdir -p /tmp/.t1564-hidden-dir && echo 'hidden payload test' > /tmp/.t1564-hidden-dir/.hidden-payload.sh && chmod +x /tmp/.t1564-hidden-dir/.hidden-payload.sh && ls /tmp | grep t1564 && ls -la /tmp/ | grep t1564

Cleanup

bash
rm -rf /tmp/.t1564-hidden-dir

Expected Telemetry

Auditd syscall events: execve for mkdir, echo/tee, chmod with dotfile paths. Syslog/auditd: SYSCALL records with comm='mkdir' and a0 pointing to path starting with dot. Linux process creation events in Sysmon for Linux (if deployed): Image=/bin/mkdir, CommandLine contains '.t1564-hidden-dir'. The first ls command returns no output (directory is hidden), the second ls -la shows it — confirming the hiding behavior.

Expected Detection

Linux auditd rule for mkdir/touch/cp creating dot-prefixed paths in /tmp or /dev/shm. Sysmon for Linux Event ID 11 (FileCreate) with TargetFilename starting with a dot in a temp or writable directory. SPL: sourcetype=linux_secure or sourcetype=auditd, path matches ^\..

Related Detections