Skip to content
Pwnversity
MAL-EVASIONexpert · 6 min · upd. 2026-10

Defense Evasion

T1685T1055T1620

Malware —and the red team that emulates it in authorized exercises— aims to go unnoticed by antivirus, EDR, and analysts. This page catalogs the evasion families with Red Team / Blue Team parity: which techniques exist and how they work conceptually (to emulate them in an authorized exercise and to recognize them when analyzing a sample), and how they’re detected and mitigated. Evasion in interactive Windows post-exploitation is detailed in win-evasion; here it’s seen from the malware lifecycle view.

Each defensive layer has a blind spot. AV relies on static signatures → break it by changing the signature (obfuscation/packing). The sandbox runs for a limited time in an artificial environment → evade it by detecting that environment or waiting. The EDR observes behavior in user-land → the aim is to reduce its visibility. The adversary’s goal is for the payload to arrive and act without any layer recognizing it; the defender’s, to catch it by what it can’t hide: its effect.

flowchart LR
  AV[AV / signatures] -->|obfuscation · packing| G1[blind spot]
  SB[Sandbox] -->|anti-VM · sleep · geofencing| G2[blind spot]
  EDR[EDR user-land] -->|unhooking · syscalls · LOLBins| G3[blind spot]
  G1 --> E[Real effect<br/>network · encryption · persistence]
  G2 --> E
  G3 --> E
  E -->|what is NOT hidden| D[Behavioral detection]

Red Team — evasion families (conceptual)

Section titled “Red Team — evasion families (conceptual)”

Obfuscation and packing of the artifact so it doesn’t match known signatures (see Obfuscation and packing). Red teams generate unique implants per campaign (payloads called “FUD” in the jargon) precisely so that the hash and patterns aren’t in AV databases.

The code checks whether it runs in an analysis environment and, if so, doesn’t deploy the real logic. Signs it typically looks for:

  • Virtualization artifacts (drivers, device names, VM MACs).
  • Scarce resources (few cores/RAM), low uptime, no human interaction.
  • “Sleeping” at startup to exhaust the sandbox’s analysis time.
  • Conditional execution: geofencing by IP/language, or detonating only in the target domain.

For the analyst, this is countered with hardened environments and by forcing conditions (see Dynamic analysis).

The EDR observes calls by hooking user-land APIs and receiving events (ETW). The conceptual techniques the red team emulates to reduce that visibility —the same ones in win-evasion— include:

  • AMSI patching — neutralize in memory the script scanning of the process itself.
  • ETW patching — blind .NET/PowerShell telemetry.
  • Unhooking — restore the original bytes of ntdll to remove the EDR’s hooks.
  • Direct/indirect syscalls — invoke syscalls bypassing the hooked APIs.
  • Process injection — run inside a legitimate process (hollowing, module stomping).
  • BYOVD — load a signed vulnerable driver to operate from kernel.

These are detailed in Defense evasion (AMSI / AV / EDR). The common principle: they all reduce what the EDR sees, not what the code does — and that’s the defender’s lever.

Living off the Land (LOLBins) and fileless

Section titled “Living off the Land (LOLBins) and fileless”

Instead of a custom executable (detectable), abuse legitimate signed OS binaries and operate in memory without touching disk:

  • LOLBins — mshta, rundll32, regsvr32, certutil, bitsadmin, wmic, msbuild, powershell. Reference catalog: the LOLBAS project.
  • Fileless — in-memory injection, scripts in registry/WMI → few disk artifacts.

For the blue team, the signal isn’t the binary (it’s legitimate) but the anomalous command line and context.

In authorized exercises, red teams use C2 frameworks with built-in evasion (malleable profiles, in-memory execution, BOFs): Cobalt Strike (commercial, the standard), Sliver, Mythic, Havoc, Metasploit/Meterpreter. Recognizing their artifacts is also blue-team work (see Command & Control for detecting their traffic).

Detection by behavior, not static signature (which evasion breaks):

  • EDR — remote threads, injection, LSASS access, RWX allocations, patching of code regions.
  • AMSI + 4104 — scripts captured after deobfuscation (key against fileless/PowerShell).
  • Sysmon — process create (1) with its command line, image load (7), CreateRemoteThread (8).
  • Sigma — rules on anomalous command lines (LOLBins), -enc, downloads.
  • ETW-TI — kernel telemetry that resists part of user-land tampering.

The golden rule: catch what evasion can’t hide — the effect (network/C2, encryption, persistence).

Sysmon (1/7/8/10/25), PowerShell auditing (Script Block Logging 4104), the ETW Threat Intelligence provider, and SIEM correlation. In-memory detection (YARA over processes, see YARA) catches what evades the disk.

  • Behavioral EDR with anti-tamper (resisting the visibility reduction).
  • Application allowlisting (WDAC/AppLocker): cuts LOLBins and unauthorized executables.
  • Constrained Language Mode + Script Block Logging + AMSI; forwarded, protected logging.
  • Driver Blocklist (against BYOVD), HVCI/Credential Guard; reduce unnecessary interpreters/binaries.
  • Assume evasion: robust detection is multi-layer (endpoint + network + memory), not a single signature.
  • AMSI/ETW patching, unhooking, and BYOVD are standard TTPs of red teams and of APT/ransomware (MITRE T1685 Disable or Modify Tools, T1055 Process Injection, T1620 Reflective Loading).
  • BYOVD: campaigns by BlackByte, LockBit, Scattered Spider with signed vulnerable drivers (e.g. CVE-2021-21551 Dell dbutil, RTCore64).
  • Cobalt Strike leaks and the maturity of open-source frameworks (Sliver/Havoc) have spread these capabilities.
  • Does the sample/implant evade static signatures? (unique hash, packing)
  • Does it detect VM/sandbox or use geofencing? (“does nothing”)
  • EDR-evasion techniques present (AMSI/ETW/unhooking/syscalls)
  • LOLBins and fileless activity (memory, WMI, registry)
  • Identify the C2 framework if applicable (artifacts, see Command & Control)
  • Blue: does behavioral detection (EDR/Sigma) catch it?
  • Blue: AMSI/Script Block Logging and in-memory YARA
  • Map to MITRE ATT&CK: TA0005 Stealth (hiding) and TA0112 Defense Impairment (disabling or degrading defenses), a single Defense Evasion tactic until v19