In a world obsessed with zero trust, layered defense, and autonomous response, the assumption that an endpoint security agent guarantees safety is dangerously naive. Recent real-world breaches demonstrate that even industry-leading endpoint detection and response (EDR) platforms, including SentinelOne, can be neutralized if foundational detection primitives like AMSI (Antimalware Scan Interface) are bypassed and visibility is suffocated.
What happens when threat actors bypass user-mode defenses entirely? How do they perform irreversible actions—such as purging shadow copies—without triggering alerts, requiring credentials, or leaving visible artifacts? This blog explores the anatomy of such an incident, delving deep into the likely methodology, theory, and system internals abused by a contemporary Locker strain.
Phase One: Entry Without Footsteps
The malware’s journey typically starts innocently. A benign-looking document, misleading executable, or poisoned browser tab acts as the ingress vector. No fancy zero-day required—just clever bait.
Often, this binary is compressed, obfuscated, or encrypted. Upon execution, it decompresses in memory, never touching disk in a recognizable form. It may leverage process injection to cloak itself within legitimate host binaries, commonly referred to as process hollowing or Doppelgänging. Windows utilities such as mshta.exe, rundll32.exe, or powershell.exe often provide the vehicle—each signed and trusted.
Upon successful loading, the malware prioritizes one task: shutting down defenses before making any noise.
Phase Two: AMSI—The Watchdog Muzzled
AMSI, a Microsoft interface meant to inspect scripting language execution, is the first line many AVs and EDRs rely upon to detect malicious PowerShell, JavaScript, and VBScript.
The attacker’s toolkit replaces AMSI’s function pointer table in memory, often using a simple byte-patch approach. Consider this:
mov eax, 0x80070057 ; E_INVALIDARG
ret
This minimal change causes AMSI to return failure every time it attempts to inspect script content. No exceptions are thrown, no logs generated—just silent failure. From this point forward, any PowerShell or script payload executed on the machine becomes invisible to user-mode scanning.
Some threat actors take it a step further and entirely unload amsi.dll from the process or disable it via registry entries during the boot cycle. The elegance lies in its subtlety—most AV tools won’t see the patch if it’s injected into memory dynamically.
Phase Three: Endpoint Agent Evasion and Sabotage
Even after AMSI is defeated, SentinelOne and similar platforms still operate at deeper levels. They monitor system calls, process behavior, and network telemetry. That said, they too can be blinded—especially when actors adopt a multi-layered obfuscation strategy.
Let’s consider several common evasion tactics:
- Direct System Calls: Instead of invoking API functions via
kernel32.dll, malicious code crafts raw system call stubs to communicate with the kernel. By avoiding user-mode DLLs, it evades detection routines that rely on API hooking. - Parent Process Spoofing: Instead of being spawned by an obvious initiator like
cmd.exe, malware masks its parent asexplorer.exeorwinlogon.exe—common processes that rarely raise red flags. - EDR Kill Switches: Many strains now ship with modules specifically targeting SentinelOne, CrowdStrike, and others. These modules attempt to disable services, kill processes, or remove EDR drivers. In environments where tamper protection is poorly enforced or misconfigured, this works flawlessly.
- Memory Unhooking: By restoring the original
.textsection of critical system DLLs, malware can undo hooks placed by EDR agents, thus removing all user-mode telemetry taps.
It’s important to understand that most EDR platforms rely on a blend of heuristics, machine learning, and behavioral triggers. But when malware is designed to produce no noise—no spikes in CPU, no strange outbound traffic, no strange DLL loading—the detection model becomes blind.
Phase Four: Elevation Without Prompts
With stealth achieved, the malware escalates privileges—typically without user intervention. Tactics include:
- COM UAC Bypass: Exploiting trusted auto-elevated COM objects like
fodhelper.exeorcomputerdefaults.exe. The attacker places a registry entry underHKCU:\Software\Classes\ms-settings\Shell\Open\command, launches the COM object, and gets elevated execution. - Token Impersonation: Stealing a high-privilege access token from another process using
OpenProcessTokenandImpersonateLoggedOnUser. - Service Injection: If a system process runs with elevated rights, malware can inject into its memory and inherit its authority.
From this point, system-level operations become possible without requiring any password entry, UAC prompt, or visible confirmation.
Phase Five: Breaking the Safety Net—Shadow Copy Erasure
Windows’ built-in backup mechanism, Volume Shadow Copy Service (VSS), offers a lifeline for recovery. But threat actors routinely ensure there’s no way back.
Traditionally, ransomware uses:
vssadmin delete shadows /all /quiet
Or:
wmic shadowcopy delete
But both commands leave logs and can be caught by audit policies or SIEMs.
Modern strains bypass these by:
- Direct API Access: Calling VSS deletion routines through COM or internal system libraries, leaving fewer traces.
- Service Control: Disabling VSS and related services (like
swprv,vss,VolSnap) before wiping shadow copies. - Registry Tampering: Modifying startup or configuration values to ensure VSS doesn’t automatically restore during reboot or rollback.
- PowerShell WMI: A favorite among stealthy operators. This avoids process creation detection and minimizes command-line visibility.
Regardless of method, the effect is the same: no prior recovery points remain. Once encryption completes, rollback becomes impossible without external backups.
Phase Six: The Lock
At this juncture, the encryption payload kicks in. Often multithreaded and highly optimized, it encrypts files using AES-256 or ChaCha20, while the key is itself encrypted with the attacker’s public RSA key.
Notably:
- Many strains avoid encrypting system files to prevent detection.
- Others leverage extension filters to prioritize sensitive data.
- Some variants scan network shares and removable drives, spreading damage laterally.
By the time a ransom note appears, it’s already over. The note might be dropped in every folder, replacing wallpaper, or even locking the screen itself.
Phase Seven: Covering Tracks
A skilled operator doesn’t just walk away. They sweep the digital crime scene:
- Clearing Logs: Using tools like
wevtutilto delete event logs. - Removing Prefetch Entries: Removing traces from
%SystemRoot%\Prefetch. - Purging Recent Documents: Cleaning
RecentItemsand MRU lists to obscure access patterns. - Credential Theft: Dumping LSASS and exfiltrating credentials before departing.
- Backdoor Persistence: In some cases, they leave behind scheduled tasks, services, or rootkits to re-enter later.
A New Breed of Threat
This isn’t just opportunistic ransomware. This is stealthy, modular malware engineered to defeat layered defenses. It’s often sold as part of Ransomware-as-a-Service (RaaS) platforms, with each affiliate adding their own refinements.
The ecosystem of cybercrime has matured—actors test payloads against EDR engines in sandboxed environments, constantly modifying their loaders to defeat signature-based and behavioral analytics. Many of these tools now come with graphical interfaces and support channels.
What Could Have Prevented It?
Let’s be clear: most of this attack chain unfolds due to misconfigurations, visibility gaps, and over-reliance on default settings.
Here’s what would have helped:
- EDR Hardening: Enforce tamper protection. Disable all methods of terminating or suspending agents without MFA or administrative escalation.
- AMSI Monitoring: Set up secondary telemetry to detect AMSI patching or unusual DLL memory modification patterns.
- Script Confinement: Restrict PowerShell and WMI to signed scripts only via AppLocker or WDAC.
- Privilege Control: Disable UAC bypass vectors. Deny users write access to vulnerable registry keys.
- VSS Auditing: Alert on shadow copy deletions or VSS service modifications.
- Least Privilege: Users should never have local admin rights unless absolutely necessary.
- Redundant Backups: Ensure backups are stored off-site or on immutable storage.
- Behavioral Detections: Train detection engines not just on process names, but on syscall patterns, memory behavior, and context switching anomalies.
Closing Thoughts
When AMSI dies silently, and EDR watches from the shadows unaware, recovery depends entirely on how prepared the environment was beforehand. Threat actors know that encryption alone isn’t the goal—it’s control. To gain it, they first neutralize your vision, disable your armor, and then swing the blade.
In this case, the attacker didn’t need an exotic zero-day. Just knowledge, patience, and a bit of silence. Every weakness exploited was a known vector. Every defensive gap was avoidable. And every erased shadow copy was a chance never taken to prepare for the worst.
The lesson is harsh, but clear: visibility must be layered, defense must be adaptive, and trust must be earned—not assumed.









Leave a comment