Intruders who clear logs, rewrite file timestamps or wipe their tools rarely erase everything, but investigators who do not know where the residue sits will read an empty period as "nothing happened". Anti-forensics is the set of actions an attacker takes to remove, alter or hide evidence. The act itself usually leaves its own trace: an event saying the log was cleared, a mismatch between two timestamp sets, a gap in a record sequence, a journal entry for a renamed file. This guide covers how to detect the common techniques on Windows, Linux and cloud platforms during an investigation, and how to set up logging so that the next attempt fails. It assumes familiarity with the artefacts in the Windows Forensic Artefacts Guide and is written for DFIR analysts, incident responders and detection engineers.
Key takeaways
- Anti-forensics is itself evidence. A cleared Security log produces event 1102 with the account and logon ID that cleared it; treat it as a high-severity finding, not as a dead end.
- Two clocks beat one. Timestomping tools usually change the NTFS
$STANDARD_INFORMATIONtimes but not$FILE_NAME, and the USN journal records the change; compare them. - Gaps are findings. Missing EventRecordID ranges, silent periods in a busy log and a sensor that stopped reporting are as important as the events you have.
- Off-host copies defeat local clearing. Forwarded events, EDR telemetry and cloud provider logs that the attacker cannot reach are the only reliable defence; design for them before the incident.
- Destruction tools leave execution traces.
wevtutil,vssadmin,fsutil usn deletejournaland secure-delete utilities appear in process creation logs, prefetch and Amcache even after the files they touched are gone.
The techniques and where ATT&CK places them
MITRE ATT&CK v20 split the old defence evasion tactic. Hiding traces such as file deletion and timestomping sits under Indicator Removal (T1070) in the Stealth tactic, while clearing or disabling logs and security tools sits under Disable or Modify Tools (T1685) in Defense Impairment (TA0112). Log clearing now maps to T1685.005 (Windows) and T1685.006 (Linux and macOS), so update older detection mappings.
| Technique | ATT&CK ID | Primary residue | Where to look |
|---|---|---|---|
| Clear Windows event logs | T1685.005 | Security 1102, System 104, process creation of wevtutil cl or Clear-EventLog | Forwarded events, EDR, prefetch |
| Disable or modify event logging | T1685.001 | Audit policy change 4719, EventLog service stop, registry changes to channel settings | Security log, Sysmon 13, EDR |
| Clear Linux or Mac system logs | T1685.006 | Truncated /var/log files, journal verification failures, missing wtmp entries | Remote syslog, journal files, auditd |
| Disable Linux audit | T1685.004 | auditd stop, rule changes, auditctl -e 0 | Remote audit stream, configuration management drift |
| Disable or modify cloud logs | T1685.002 | API calls that stop, delete or narrow trails and sinks | The cloud audit log itself, organisation-level trails |
| Timestomp | T1070.006 | $SI and $FN mismatch, USN basic-info change, Sysmon 2 | $MFT, $UsnJrnl, Sysmon |
| File deletion and wiping | T1070.004 | USN delete and rename records, Sysmon 23 or 26, secure-delete rename patterns | $UsnJrnl, $LogFile, Sysmon, prefetch |
| Clear command history | T1070.003 | Empty or truncated .bash_history, PSReadLine history removed, HISTFILE unset | Process creation, auditd execve, EDR |
| Clear persistence | T1070.009 | Service or task deleted after use | System 7045 then deletion, task XML in VSS |
| Delete shadow copies | T1490 | vssadmin delete shadows, wmic shadowcopy delete, VSS service events | Process creation, EDR |
| Hide in NTFS attributes | T1564.004 | Alternate data streams on unexpected files | $MFT, Sysmon 15 |
Detecting log clearing and logging tampering
Windows
- Security log cleared: event 1102 (provider Microsoft-Windows-Eventlog, channel Security) records the SID, account name, domain and logon ID of the account that cleared the log. Correlate the logon ID with 4624 to find the session and source.
- Other logs cleared: System event 104 records clearing of other channels such as System and Application. Its presence alongside 1102 within seconds suggests a scripted clear of every channel.
- Sequence gaps: each record has an EventRecordID that increments. A jump between two consecutive records, or a log whose first record is minutes before the incident on a host that has run for months, means data was removed or the log was rolled over. Check the log size setting before concluding tampering: a small maximum size causes legitimate overwrites.
- Audit policy changes: 4719 (system audit policy changed) and changes to subcategory settings can silence logging without clearing anything.
- Service and channel tampering: stopping the EventLog service, disabling a channel or changing its registry configuration (Sysmon 13 or EDR registry telemetry) degrades logging quietly. Sysmon 4 records the Sysmon service state and Sysmon 16 records changes to its configuration, so an attacker blinding Sysmon leaves those behind.
- Execution evidence:
wevtutil.exe,powershell.exewithClear-EventLogorRemove-EventLog, andauditpol.exein process creation (4688 with command line, or Sysmon 1), prefetch and Amcache.
Forward events off-host so that clearing the local copy does not destroy the record. See the Windows Event Forwarding Guide and the Sysmon Guide.
Linux
- Truncation and gaps: files under
/var/logwith a size of zero or modification times during the incident, and holes inwtmpandlastlog. - Journal integrity:
journalctl --verifychecks journal files for internal consistency; if Forward Secure Sealing was set up with--setup-keys(sealing key on the host, verification key stored elsewhere, key change every 15 minutes by default),--verify-key=also checks authenticity, so later tampering is detectable. - Audit subsystem: auditd service stops, rule deletions and changes to
/etc/audit/are high-value events; send the audit stream to a remote collector. See the Linux Forensics Guide.
Cloud
Control-plane logs are harder for an attacker to erase, but they can be stopped, narrowed or redirected. Alert on actions such as stopping or deleting an AWS CloudTrail trail or changing its event selectors, deleting or modifying Google Cloud log sinks and exclusions, and changing Azure diagnostic settings. Organisation-level trails and sinks owned by a separate security account survive a compromised workload account. See the Cloud Forensics Guide and the Google Cloud Audit Logs and Log Sinks Guide.
Detecting timestomping
NTFS records four timestamps (modified, accessed, MFT entry changed, created) in two places in each MFT record: the $STANDARD_INFORMATION attribute, which user-mode APIs can set, and the $FILE_NAME attribute, which the file system maintains. ATT&CK's Timestomp entry describes attackers changing these times to blend malicious files with legitimate ones in the same folder.
| Indicator | Why it is suspicious | Confidence |
|---|---|---|
$SI created time earlier than $FN created time | The file system set $FN at creation; an earlier $SI value was written afterwards | High, but check for copy and archive extraction behaviour |
$SI times with zero sub-second precision (for example .0000000) | Many tools set whole-second values; genuine NTFS times carry 100-nanosecond precision | Medium; some legitimate software also does this |
| File times older than the operating system install or the folder | A "system" binary predating the build it belongs to | Medium |
| USN journal record with a basic information change reason for the file | Timestamp attribute was changed after creation, and the journal records when | High when it falls in the incident window |
| Sysmon event 2 (a process changed a file creation time) | Records the process that made the change and the old and new times | High when the process is unusual; Microsoft notes many processes change creation times legitimately |
| Prefetch, Amcache or ShimCache first-execution time after the file's claimed creation by years | Execution evidence contradicts the file system story | Medium to high |
Parse the MFT with a tool that outputs both attribute sets and a "timestomped" flag where available, then confirm against the USN journal and execution artefacts. The EZ Tools Guide covers MFTECmd for this, and the Forensic Timeline Analysis Guide covers placing the result in a timeline.
Detecting deletion, wiping and recovery inhibition
- Ordinary deletion: deleted files often remain in unallocated MFT records and clusters, the Recycle Bin (
$Iand$Rfiles) and Volume Shadow Copies. The USN journal records the delete and the preceding renames. - Secure deletion: Microsoft's SDelete renames a file 26 times, replacing each character of the name with successive letters (the first rename of
foo.txtisAAA.AAA), before overwriting. A run of renames toAAA.AAA,BBB.BBBand so on in the USN journal is a strong indicator. SDelete also does not securely remove file names held in free directory space. - Free space wiping: large temporary files created and deleted in rapid succession, and many new small files filling free MFT records, are the signature of free-space cleaning tools (SDelete
-cor-z,cipher /w). - Journal deletion:
fsutil usn deletejournal /dor/ndisables the change journal. Microsoft notes this forces services such as FRS to rescan the volume, so an unexplained journal recreation or an empty journal on a long-running system is itself suspicious. - Shadow copy deletion:
vssadmin delete shadows /all /quietpermanently removes client-accessible shadow copies. It is a common ransomware precursor and should alert on every endpoint and server. - Sysmon file delete events: event 23 logs a delete and archives a copy of the file to the archive directory (
C:\Sysmonby default); event 26 logs the delete without archiving. Scope 23 tightly (scripts, executables in user-writable paths) so the archive does not grow unbounded. Event 28 (FileBlockShredding) can block shredding activity.
Wiper incidents push these techniques to their extreme. See the Wiper Malware Guide and the Wiper Attack Response Playbook.
Detecting hiding and evidence disruption
- Alternate data streams: content in named streams on ordinary files (T1564.004). Sysmon 15 (FileCreateStreamHash) logs stream creation; MFT parsers list streams per record.
- Encryption and packing: high-entropy files in staging directories, password-protected archives created shortly before exfiltration, and packed executables (T1027).
- Masquerading: tools renamed to system binary names or placed in system paths (T1036); compare paths, hashes and signatures with a known-good baseline.
- Security tool tampering: EDR or antivirus services stopped, exclusions added, drivers unloaded (T1685). Loss of sensor heartbeat is a detection in its own right. See the EDR Tampering and BYOVD Response Playbook.
- Memory-only operation: payloads that never touch disk defeat disk forensics; capture memory before shutdown when this is suspected. See the Memory Forensics Guide.
Where identity fits
Clearing a Security log needs administrative rights, and disabling a cloud trail needs a privileged role. Every anti-forensics event therefore names an identity worth investigating: the account in 1102, the principal that called the cloud logging API, the service account that ran the wipe script. Check whether it is a human administrator, a shared local administrator (see the Local Administrator Password Solution (LAPS) Guide) or a service or automation identity whose credentials were stolen (see the Service Account Security Guide). Restricting who can clear logs or change logging configuration to a small, monitored group makes the event far more meaningful.
Building resilience before the incident
- Forward first: send Security, System, Sysmon, PowerShell and EDR telemetry off-host in near real time, and Linux syslog and audit to a remote collector.
- Size local logs: increase Security log maximum size on servers and domain controllers so legitimate rollover does not mimic clearing.
- Protect cloud logs: use organisation-level trails and sinks in a separate security account with immutable or retention-locked storage.
- Seal where possible: enable journal Forward Secure Sealing on high-value Linux hosts and store verification keys off-host.
- Alert on the act: deploy detections for 1102, 104, 4719, Sysmon 4 and 16,
vssadmin delete shadows,fsutil usn deletejournal, CloudTrail stop or delete actions and auditd stops. See the Sigma Rules Guide. - Test in a lab: run each technique on a test host in a purple team exercise, confirm the alert fires and that the evidence survives off-host. See the Purple Teaming Guide.
- Roll back safely: if a new detection floods analysts (for example legitimate backup software deleting shadow copies), tune by signed parent process and host group rather than disabling the rule.
Small organisations without a SIEM can still forward Windows events to a single collector and set cloud trail and sink alerts in the provider console; large organisations should treat logging pipeline health as a monitored service with its own on-call.
Framework mapping
| Framework | Reference | Relevance |
|---|---|---|
| NIST SP 800-53 Rev. 5 | AU-4, AU-9, AU-11, AU-12, SI-4, SI-7 | Log storage capacity, protection of audit information, retention, generation, monitoring, integrity |
| NIST CSF 2.0 | DE.CM-01, DE.AE-02, RS.AN-03, RS.AN-06 | Monitoring, analysis, root cause, integrity and provenance of investigation records |
| CIS Controls v8.1 | Control 8 (audit log management), Control 17 (incident response management) | Central collection, retention and review; see the CIS Control 8 Audit Log Management Guide |
| ISO/IEC 27001:2022 Annex A | 8.15 Logging, 5.28 Collection of evidence | Protecting logs and preserving evidence |
| MITRE ATT&CK v20 | TA0112, T1685.001, T1685.004, T1685.005, T1685.006, T1070.003, T1070.004, T1070.006, T1490, T1564.004 | Technique coverage for detection engineering |
| MITRE D3FEND | D3-FAPA File Access Pattern Analysis | Detecting bulk rename, overwrite and delete behaviour |
Measuring the capability
- Off-host coverage: percentage of servers and endpoints whose Security and Sysmon events reach the central store within 5 minutes.
- Anti-forensics detection rate: percentage of purple team anti-forensics tests (log clear, timestomp, VSS delete, trail stop) that alert, target 100%.
- Silent sensor time: median minutes before a host that stops sending telemetry raises an alert.
- Cases with unexplained gaps: number of investigations per quarter where a logging gap could not be explained, trending down.
- Privileged clearing rights: number of accounts able to clear Security logs or modify cloud trails, reviewed quarterly.
Common failure patterns
- Reading absence as innocence: the report says "no malicious activity in the logs" when the logs start an hour before the analyst looked.
- Trusting one timestamp set: analysts take Explorer or
$SItimes at face value and place the dropper years before the intrusion. - Overcalling timestomping: archive extraction, installers and file copies legitimately produce odd timestamp combinations; corroborate with the USN journal or Sysmon 2 before writing it up.
- Local-only logging: the only copy of the Security log was on the host the attacker cleared.
- Logging the admins out of scope: the cloud trail was in the same account the attacker controlled, so stopping it was one API call.
- Rebuilding too fast: reimaging a host before acquisition destroys the journal, shadow copies and unallocated space that held the residue.
Practitioner checklist
- Search every in-scope host for 1102, 104 and 4719 and record the account and logon session behind each.
- Check EventRecordID continuity and log start times against host uptime and log size settings.
- Compare
$SIand$FNtimes for files of interest and confirm with USN journal records and Sysmon 2. - Look for SDelete-style rename runs, journal deletion and mass deletes in the USN journal.
- Search process creation, prefetch and Amcache for
wevtutil,vssadmin,fsutil,auditpol,cipherand secure-delete tools. - Review cloud audit logs for trail, sink and diagnostic setting changes in the incident window.
- Acquire memory and disk before rebuilding any host suspected of anti-forensics.
- Forward logs off-host and alert on clearing, audit policy and sensor state changes.
- Limit and review the identities that can clear logs or change logging configuration.
Standards and references
- NIST: SP 800-86 Guide to Integrating Forensic Techniques into Incident Response
- MITRE ATT&CK: Timestomp
- MITRE ATT&CK: Clear Windows Event Logs
- Microsoft Learn: Event 1102 The audit log was cleared
- Microsoft Sysinternals: Sysmon
- Microsoft Sysinternals: SDelete
- Microsoft Learn: fsutil usn
- systemd: journalctl manual
Related NHI Mgmt Group resources: Windows Forensic Artefacts Guide · Digital Forensics (DFIR) Guide · Forensic Timeline Analysis Guide · Windows Event Forwarding Guide · Forensic Readiness Guide