Reading width
Wide uses the full column for everything, text, diagrams, code, and exercises. Narrow keeps the standard reading width.
Text size
Scales the body text. Headings and code blocks keep their size.
In this section
Windows Anti-Forensics Investigation: Log Clearing, Shadow Copy Deletion and Defender Tampering
Introduction
Attackers who expect to be investigated act on the evidence. They disable the tools that would catch them, remove the copies that would let a victim recover, and erase or falsify the records an investigator would read. Each of those acts is aimed at a different record, and each is itself recorded somewhere the attacker did not reach.
Anti-forensics rarely leaves nothing; it usually leaves a record of itself in place of what it removed.
Thirty minutes on 18 March. Four steps before the encryption removed the ways to stop or undo it; the last, during the encryption, removed part of the record of how it happened.
This lesson reads the ransomware attacker's half hour of anti-forensics: Defender weakened, shadow copies and backups deleted, recovery disabled, security sites blocked, and the Security log cleared. Lesson 0.7 already showed the falsified timestamps on two tools. Module 8 teaches each technique in depth, and what survives it.
Three Goals
Only one of them is about the investigatorIt helps to sort anti-forensic actions by what they are for, because the goal decides where the evidence of them will be:
Anti-forensics has three goals, and only the third is aimed at the investigator. The bottom row is what makes all three investigable.
Stopping the defenses is about the next few minutes: an attacker about to run ransomware does not want antivirus to quarantine it. Removing the way back is about the victim: deleted shadow copies and backups make paying the ransom the only route to the data. Hiding the trail is about the investigation that follows: cleared logs and falsified times make the attack harder to reconstruct.
The goals also predict which records an attacker attacks. Someone stopping defenses changes settings and services, and the evidence is in configuration logs and the registry. Someone removing the way back runs a handful of well-known system tools, and the evidence is in process records and Prefetch.
Someone hiding the trail targets logs and timestamps, and the evidence is in the records they did not think of. Knowing the goal tells an investigator where to look before they have found anything.
On this host the attacker did all three, in that order. The first two came before the encryption started at 02:30, because they had to; the clearing came during it, at 02:45, near the end.
Putting the clearing near the end makes sense from the attacker's side: it removes the record of everything before it in one action, and anything after it is a short tail. The order is itself evidence of planning: someone who works through a sequence of preparatory steps in fifteen minutes before launching the payload is following a procedure, not improvising.
Applied to this host, step by step:
This host's steps, by goal
Goal, step, recordEvery one of these actions also has a legitimate twin. Backup software deletes old shadow copies as part of its rotation, administrators clear logs when troubleshooting, and management tools change Defender settings across a fleet.
What separates the attacker's version is context: the account, the time, the tool, and what else happened in the same minutes. A shadow deletion by a backup service at its scheduled hour is maintenance; one by a stolen administrator account at 02:18, from a PowerShell session that just turned off Defender, is not.
The last row of the figure is the reason anti-forensics is investigable at all. Windows records most of its own configuration changes in more than one place, and an attacker who removes one record usually leaves several others untouched. The rest of this lesson reads each step by the records it left.
Stopping the Defenses
Defender, by its own settingsThe PowerShell operational log recorded two script blocks at 02:15 and 02:16, run as the domain administrator account the attacker had taken:
02:15:22 4104 nge-admin Warning
Set-MpPreference -DisableRealtimeMonitoring $true -DisableIOAVProtection $
true -DisableBehaviorMonitoring $true
02:16:11 4104 nge-admin Warning
Set-MpPreference -DisableScriptScanning $true; Set-MpPreference -SubmitSam
plesConsent 2
Set-MpPreference changes Microsoft Defender's settings. These two calls turned off real-time monitoring, scanning of downloaded files and attachments, behavior monitoring and script scanning, and set sample submission consent to 2, which the cmdlet's documentation lists as never send. Together they leave Defender installed and running, but no longer looking. The ransomware ran fourteen minutes later with nothing watching for it.
Defender keeps its own operational log, which records configuration changes like these independently of PowerShell, and Microsoft's tamper protection feature exists to block exactly these changes when it is turned on. Whether it was turned on here is a question for the device's management configuration, and the answer belongs in the report's recommendations either way: changes like these succeeding is a control gap as well as an attacker action.
Both blocks ran as nge-admin, the account lesson 0.4 showed the attacker taking at 02:08, which ties the defense changes to the same intrusion rather than to an administrator doing routine work in the middle of the night.
The record of this exists because PowerShell's script block logging captured the commands. Microsoft's documentation describes it as recording the content of all script blocks PowerShell processes, written as event 4104 to the operational log. It is the reason the exact commands are known rather than inferred.
An attacker who ran the same changes through a compiled tool instead of PowerShell would have left a Defender configuration event and a changed registry value, but not their command line.
Removing the Way Back
Shadow copies, backups and recoveryThe next four script blocks, between 02:17 and 02:20, went after every route the victim had to restore files without the attacker:
02:17:44 4104 Get-WmiObject Win32_ShadowCopy | ForEach-Object { $_.Delete() }
02:18:22 4104 vssadmin delete shadows /all /quiet
02:19:05 4104 wbadmin delete catalog -quiet
02:20:11 4104 bcdedit /set {default} recoveryenabled No; bcdedit /set {default} bo
otstatuspolicy IgnoreAllFailures
Volume shadow copies are point-in-time snapshots of a volume, kept by Windows and used by its previous versions feature and by many backup tools. The attacker deleted them twice: once through WMI, enumerating Win32_ShadowCopy objects and deleting each, and once with vssadmin.
Microsoft's documentation for vssadmin delete shadows says /all deletes all of the volume's shadow copies and /quiet suppresses messages, and that the deletion is permanent. Then wbadmin deleted the backup catalog, which tells Windows Backup what backups exist, and bcdedit turned off the Windows Recovery Environment and told the boot loader to ignore failures.
Deleting the shadow copies twice, by two different methods, is worth noticing. A common reading is that ransomware operators run both because one may be blocked or monitored where the other is not; whatever the reason, it shows the attacker was working from a prepared list rather than typing commands as they thought of them.
Each of those commands was also recorded by two other parts of Windows:
Three witnesses to the recovery being removed. The command text, the program runs and the service changes are written by three different parts of Windows.
For the victim, these steps decide what recovery costs. With local snapshots and the backup catalog gone, restoration depends on copies held somewhere the attacker could not reach: offline backups, a separate backup system, or cloud versioning. The forensic finding that the local copies were deliberately destroyed is often the first question the incident lead asks, because it decides whether to start a restore or a negotiation.
Prefetch shows vssadmin, wbadmin and bcdedit each last running in the same second the PowerShell log recorded the command, and the System log records the Volume Shadow Copy service stopping and then being set to disabled.
That last change, which lesson 0.5 read as a service changed rather than created, stops Windows from making new snapshots too. Three independent records agree on each step, which is what makes the finding hard to dispute.
Blocking the Way Out
The hosts fileAt 02:20:33, the hosts file gained three lines:
# C:\Windows\System32\drivers\etc\hosts
# modified 2026-03-18T02:20:33Z
0.0.0.0 crowdstrike.com
0.0.0.0 update.microsoft.com
0.0.0.0 go.microsoft.com
The hosts file maps names to addresses before Windows asks a DNS server. Mapping a name to 0.0.0.0 makes it unreachable from this machine. The three names are a security vendor's domain and two Microsoft update domains: after this change, the machine could not fetch new antivirus definitions or Windows updates, and a security agent that relied on reaching its vendor would have lost contact.
The hosts file lives in the Windows folder and needs administrator rights to change, which places the change after the attacker gained them and gives one more check on the privilege timeline lesson 0.4 built. Its modification time in the MFT and an entry in the change journal would normally confirm when it changed, and its contents are read directly from the image.
It is worth reading the whole file, not only the new lines. Legitimate software sometimes adds entries, and older entries left by a previous incident or a developer's testing can confuse the picture. The parsed record here lists the three entries the change added; on an image, the whole file is read and every line accounted for.
It is one of the simplest anti-forensic and anti-defense steps there is, and one of the most often missed, because nobody looks at a file that has been stable for years.
Confirming the effect is a matter of reading the machine's name resolution after the change. A DNS cache collected from a live host, or the security agent's own logs showing lost contact, would show the block working. On an image, the file's contents are the evidence of the change, and its timestamps in the filesystem are the evidence of when.
Read alongside the Defender changes, the purpose is clear: the attacker made sure the machine could neither detect the ransomware locally nor receive help from outside while it ran.
Clearing the Security Log
What 1102 records, and what it cannot touchThe last record in the Security log is this:
Event 1102, the audit log was cleared
Time 2026-03-18T02:45:11Z
Computer YORK-WS-033
Subject NT AUTHORITY\SYSTEM
Channel Security
Microsoft's documentation describes event 1102 as generated every time the Security audit log is cleared, notes that typically it should not be seen at all, and gives the Subject fields as the account that cleared it. Here that is SYSTEM, at 02:45:11, with the encryption almost finished.
Clearing a log removes every record in it and starts the file again, and the 1102 is written as the first record of the new file, dating the clearing precisely.
On a live disk after a clearing, the Security events read in lessons 0.3 and 0.4 for this host would be gone. They survive only in copies held elsewhere: a log collector the host forwarded to, a domain controller's own records of the same authentications, or a shadow copy taken before the attack, which this attacker had already deleted.
This course's evidence set includes the earlier Security events so the lessons can read them; a real investigation has to find them.
The account matters too. SYSTEM is the local machine's own most privileged account, and a clearing recorded as SYSTEM means the process that did it was running with that privilege.
That fits the rest of the case: the credential tool and the ransomware both ran as SYSTEM in lesson 0.2. An investigator who saw an administrator's name here instead would look for that administrator's session; SYSTEM points back at the attacker's own tooling.
A cleared log is not always entirely gone from the disk either. The records were in a file, and the space that file used may still hold fragments of the old contents until something overwrites them. Module 8's log clearing lesson reads where cleared records can still be found and how much is usually recoverable, which on a recently cleared log is sometimes a great deal.
What a clearing cannot touch is everything that is not that file:
Log Earliest Latest After the clearing?
----------- ------------------- ------------------- -------------------
Security 2026-03-14T03:15:55 2026-03-18T02:45:11 the 1102 itself
System 2026-03-14T00:32:02 2026-03-18T02:18:33 not cleared
PowerShell 2026-03-14T05:47:23 2026-03-18T02:20:11 not cleared
Sysmon 2026-03-17T08:03:01 2026-03-18T02:30:00 not cleared
The System, PowerShell and Sysmon logs were not cleared, and between them they hold the anti-forensics itself, the persistence-like service and every process the attacker ran. The filesystem, Prefetch and the registry are untouched by any log operation. The attacker removed the record of logons and explicit credentials on this host and left almost everything else.
Writing the Finding
Bounded loss, stated preciselyAnti-forensics invites two opposite mistakes in a report. One is to treat a cleared log as if the investigation were defeated, when most of the evidence survived elsewhere. The other is to ignore the loss, when some records genuinely are gone. The finding names both:
Anti-forensics: what was lost, what survived
Bounded lossThe survived rows are as important as the lost ones, and they are stated just as specifically. A reader who sees only that the Security log was cleared will assume the worst about everything else; a reader who sees the four records that were not touched knows which findings in the rest of the report rest on intact evidence.
Two rows are marked lost and they are different kinds of loss. The shadow copies and backup catalog are a loss to the victim: the data cannot be restored without them. The Security log is a loss to the investigation, and a bounded one, because the authentications it held were also recorded by the domain controller and the process records survive in Sysmon.
The intent row is the one a reader acts on. It moves the finding from a list of technical events to a statement that someone tried to prevent recovery and frustrate investigation, which is often relevant to insurance, to regulators and to any later legal action. It is supported by the sequence and the repetition, not by any single record.
The unknown row is deliberate. Nothing on this host records how the log was cleared: there is no Prefetch file for the usual command-line tool, and the Sysmon log ends before 02:45. The account is recorded as SYSTEM, and the method is left open rather than guessed.
What It Says About the Attacker
Intent, sequence and knowledgeEach anti-forensic step was a choice, which makes this part of the evidence different in kind from the rest. A file arriving or a program running can sometimes be accidental. Deleting shadow copies twice by two methods, deleting a backup catalog and disabling recovery, all inside three minutes, is not.
Set out as a profile:
What the attacker reached, and what they missed
Attacker profileThe sequence also says what the attacker knew and did not. They knew shadow copies would allow recovery and removed them thoroughly. They knew Defender would interfere and turned it off rather than trying to evade it. They knew the Security log records logons and cleared it.
They did not clear the PowerShell log that recorded all of it, did not touch the change journal or Prefetch, and timestomped only the times most tools display. That profile, competent against the obvious records and blind to the less obvious ones, is common, and it is why investigators read the less obvious ones first.
That profile also predicts where to look on the next host. An attacker who missed the PowerShell log here will probably miss it on the file server, if they reached it, and an investigator who knows the pattern starts there. Anti-forensics on one machine is intelligence about the attacker's habits across the rest of the estate.
For the report, the anti-forensics section is where intent is established. A defense that argues an action was accidental has to explain why the same account, in the same half hour, also deleted the means of undoing it.
What Module 8 Builds On It
Every technique, and what survivesModule 8 takes each technique and asks the same two questions this lesson did: what record does it remove, and what record does it leave?
Module 8, in order
Module 8The shadow copy lesson reads what snapshots contain and what deletion leaves behind. The log clearing lesson covers detecting a clearing on every log, not only Security, and recovering cleared records from the places they persist.
The wiping and data hiding lessons cover the techniques this attacker did not use but others do, and the memory files lesson reads the pagefile and hibernation file, which hold fragments an attacker rarely thinks to remove. The module ends on evidence integrity, because a finding about anti-forensics is often the part of a report that is challenged hardest.
The See It Done lesson reads forty-five minutes of cleanup on another host, eight acts in one afternoon, and shows the sequence of an attacker's cleanup becoming the finding in its own right.
Each lesson in the module ends with the same output as this one: what the technique removed, what it left, and a finding sized to both. That output is often the most scrutinized part of a report, because it is where an examiner says what they could not see, and a precise account of it is what makes the rest of the report trustworthy.
The habit to carry into it is to read every anti-forensic action as a record in its own right, find the two or three other places it was written, and state precisely what it removed and what it left.
Practice
What did they try to hide, and what survived? prepared evidenceThe prepared evidence below is the attacker's half hour in three views: the PowerShell script blocks, the Prefetch runs on the day, and the span each event log covers. Find the steps that removed the way back, the independent record that confirms them, and the log that was cleared.
If you have a Windows machine of your own, run vssadmin list shadows from an elevated prompt to see what snapshots your system keeps, and open your hosts file in a text editor. Knowing what yours look like makes the attacker's changes on someone else's easy to see.
Anti-forensics is three goals, stopping defenses, removing the way back and hiding the trail, and each step leaves a record of itself. On this host the PowerShell log, Prefetch and the System log each recorded the recovery being removed, and a cleared Security log left its own clearing record while every other log survived. The finding states the loss and its bounds, and the intent the sequence shows.
The next lesson puts everything from the earlier lessons onto one timeline, and grades how sure each line of it is.
Resources
Microsoft revises these pages; where a page and this lesson disagree, the page is newer.