Introduction

Security solutions use several techniques to detect, classify, block, and investigate suspicious software. Detection is not limited to checking whether a file contains a known malware signature. Modern security products combine static file inspection, reputation checks, cloud analysis, behavioral monitoring, memory scanning, event telemetry, machine learning, and manual analyst review.

This is important because malware is rarely detected through one indicator alone. A file may appear harmless when inspected on disk but become suspicious after it allocates executable memory, modifies another process, creates persistence, or communicates with external infrastructure.

The opposite is also true. A program may contain characteristics commonly associated with malware while still being legitimate. Debuggers, browsers, security tools, game engines, and Just-In-Time compilers may allocate executable memory, inspect other processes, load code dynamically, or communicate over the network.

Detection therefore depends heavily on correlation and context.

This module introduces the main detection mechanisms relevant to malware development and malware analysis. The goal is not to describe the internal design of one particular antivirus or Endpoint Detection and Response (EDR) product, since implementations differ between vendors. Instead, the module explains the common detection layers and the type of evidence each layer uses.

Layered Detection

Modern endpoint protection products usually rely on multiple detection layers. These layers can inspect a file before it runs, monitor the process while it is running, scan its memory after suspicious activity occurs, and submit telemetry or samples for further analysis.

A simplified detection flow can be divided into the following stages.

  1. Pre-execution inspection - The file is inspected before it executes. This may include hash lookups, static signatures, PE metadata inspection, reputation checks, machine learning classification, and cloud-based analysis.
  2. Execution-time monitoring - The process is monitored while it runs. This may include process creation, DLL loading, file activity, registry changes, network connections, API usage, memory allocation, and interactions with other processes.
  3. Memory inspection - The process's virtual address space may be inspected for unpacked payloads, suspicious byte patterns, executable private memory, modified module code, or other unusual memory characteristics.
  4. Telemetry correlation - Events collected from the endpoint are combined into process trees, activity timelines, and behavioral sequences.
  5. Post-execution investigation - Automated systems or human analysts may review the file, its memory, its process tree, sandbox results, and other collected artifacts.

This layered model is important because changing one indicator does not necessarily make a program trusted. For example, changing a file hash may bypass a simple hash-based blocklist, but it does not remove suspicious imports, suspicious runtime behavior, suspicious memory regions, or suspicious telemetry.

Static Detection

Static detection refers to inspecting a file without executing it. The security solution reads the file from disk and attempts to determine whether it is malicious, suspicious, or trusted based on the file's content and metadata.

This type of detection can inspect several parts of a file. It may check the file hash, search for known byte patterns, extract strings, parse PE headers, inspect section names and permissions, review the Import Address Table, inspect embedded resources, and verify whether the file has a trusted digital signature. This module will cover some of the most noteworthy static detection techniques in the upcoming sub-sections.

Static detection is fast because the file does not need to run. This makes it useful when files are downloaded, copied, opened, executed, or scanned during scheduled security checks.

However, static detection has limitations. A file may hide important strings, encrypt its payload, dynamically resolve its imports, or unpack itself only after execution. For this reason, static detection is only one layer of a larger detection strategy.