Skip to main content

Basic Static Malware Analysis Guide

  

Static Malware Analysis: Techniques, Process, and Triage Workflow

Introduction

Static malware analysis is one of the first and most important stages in understanding a suspicious file. It allows security researchers and malware analysts to examine a file without executing it, identify potentially malicious characteristics, and collect useful indicators for further investigation.

When an unknown executable is discovered, immediately running it is rarely the best first step. A structured static analysis process can reveal valuable information about the file, including its format, compiler characteristics, embedded strings, imported functions, sections, metadata, and possible obfuscation techniques.

Static analysis is particularly useful during initial malware triage. It helps analysts determine whether a sample requires deeper investigation, what tools may be appropriate, and which behaviors should be examined during subsequent dynamic analysis.

This article explores the fundamentals of static malware analysis, commonly used techniques, practical tools, and a repeatable workflow for examining suspicious Windows executables.

1. What Is Static Malware Analysis?

Static malware analysis is the examination of a suspicious file without executing its code.

The analyst studies the file's structure and contents to identify characteristics that may indicate malicious intent. This can include examining file metadata, cryptographic hashes, strings, executable headers, imported libraries, resources, and embedded data.

Unlike dynamic analysis, static analysis does not require the sample to run. This makes it a useful first step when handling unknown files.

Static analysis can help answer questions such as:

  • What type of file are we investigating?

  • Is the file packed, encrypted, or obfuscated?

  • Which Windows APIs does it import?

  • Does it contain suspicious URLs, IP addresses, commands, or file paths?

  • Does its structure resemble a known malware family?

  • What should be investigated during dynamic analysis?

However, static analysis has limitations. Malware authors frequently use packing, encryption, string obfuscation, anti-analysis techniques, and runtime API resolution to conceal functionality. Therefore, the absence of suspicious strings or obvious indicators does not establish that a file is safe.

2. Begin with Safe Sample Handling

Before examining a suspicious file, establish a controlled analysis environment.

Do not execute unknown samples on an everyday workstation. Store samples in a dedicated analysis workspace and use an isolated virtual machine for any later execution.

A basic handling process should include:

  1. Preserve the original sample.

  2. Record its source and acquisition details.

  3. Calculate cryptographic hashes.

  4. Work on a copy where appropriate.

  5. Keep potentially malicious files in a controlled location.

  6. Avoid opening or executing samples accidentally.

  7. Use an isolated environment for dynamic analysis.

A malware analysis laboratory should also have appropriate snapshot, network isolation, and recovery arrangements.

3. File Identification and Initial Triage

The first step is to establish what kind of file is being investigated.

Do not rely exclusively on the file extension. A file named document.pdf.exe, for example, may be an executable despite its misleading appearance.

Inspect:

  • File name and extension

  • File size

  • File type and format

  • Magic bytes

  • File creation and modification timestamps, where available

  • Digital signature information

  • Cryptographic hashes

Tools such as Detect It Easy (DiE), TrID, ExifTool, and PE inspection utilities can help identify file characteristics.

Cryptographic Hashing

Calculate hashes to establish a unique reference for the sample.

Common algorithms include:

  • MD5

  • SHA-1

  • SHA-256

SHA-256 is generally preferable for recording and sharing sample identifiers.

Example PowerShell command:

Get-FileHash -Path ".\sample.exe" -Algorithm SHA256

A hash can be used to search threat intelligence repositories and compare samples across investigations. However, a hash match is only an identification clue; it does not independently establish whether a file is malicious.

4. PE File Structure Analysis

Windows executable files commonly use the Portable Executable (PE) format.

Understanding the PE structure is essential when analysing Windows malware.

Important PE components include:

  • DOS Header

  • PE Signature

  • COFF File Header

  • Optional Header

  • Data Directories

  • Section Table

  • Import Table

  • Export Table

  • Resource Directory

  • Relocation Information

The PE header contains information about the executable, including its target architecture, entry point, image characteristics, and section layout.

Important PE Sections

Common section names include:

SectionTypical purpose
.textExecutable code
.dataInitialized data
.rdataRead-only data
.bssUninitialized data
.rsrcResources
.relocRelocation information

Malware analysts should not assume that section names always reflect their actual contents. Attackers can rename sections, create unusual sections, or modify section characteristics.

Pay attention to:

  • Unusual section names

  • Executable and writable sections

  • Unexpectedly high entropy

  • Abnormal virtual-to-raw size relationships

  • Suspicious entry-point locations

  • Unusual section permissions

High entropy can indicate compressed or encrypted content, but it is not proof of packing or maliciousness by itself.

5. String Analysis

Strings can provide valuable clues about a program's functionality.

A binary may contain readable text such as:

  • File paths

  • Registry keys

  • URLs and IP addresses

  • Command-line arguments

  • PowerShell commands

  • Mutex names

  • Error messages

  • Debugging messages

  • User-agent strings

  • Configuration values

For example, strings referring to scheduled tasks, registry Run keys, or system directories may provide leads for investigating persistence mechanisms.

However, strings must be interpreted in context. Legitimate applications can contain the same types of strings.

Extracting Strings

A basic strings utility can extract readable ASCII and Unicode strings from a binary.

Example:

strings.exe -n 6 sample.exe

For more advanced investigations, FLOSS can help recover strings that are obfuscated or decoded during program execution.

String extraction is a starting point, not a complete analysis technique.

6. Import Table and Windows API Analysis

The Import Address Table and related PE import information can reveal which external functions an executable may use.

Some Windows APIs are particularly interesting during malware analysis.

Examples include:

APIWhy an analyst may investigate it
CreateProcessWProcess creation
VirtualAllocMemory allocation
VirtualProtectMemory protection changes
WriteProcessMemoryWriting into another process
CreateRemoteThreadRemote thread creation
RegSetValueExWRegistry modification
InternetOpenWInternet communication
WinHttpSendRequestHTTP request activity
CryptEncryptCryptographic operations

These APIs are not inherently malicious. They are also used by legitimate software.

The analyst should consider the combination of imported functions, their usage, program structure, and other indicators.

Some malware dynamically resolves APIs at runtime, so a limited import table does not necessarily mean that the program has limited capabilities.

7. Digital Signature and Metadata Inspection

Digital signatures can provide information about the publisher and whether the signed content has been modified since signing.

Inspect:

  • Signature presence

  • Certificate subject

  • Issuer

  • Validity period

  • Timestamp information

  • Signature verification result

A valid signature does not guarantee that a file is safe. Signed malware exists, and certificates can be stolen or abused.

Metadata can also reveal compilation information, product names, version details, and other clues. Such information may be forged, so it should not be treated as conclusive evidence.

8. Entropy and Packing Detection

Packing is commonly used to compress or transform executable content.

Malware authors use packers to make reverse engineering more difficult and to conceal code from basic inspection.

Indicators that may warrant further investigation include:

  • High-entropy sections

  • Unusual section layouts

  • Small import tables

  • Unusual entry-point locations

  • Known packer signatures

  • Large differences between raw and virtual section sizes

Tools such as Detect It Easy can help identify known packers and compiler signatures.

Packing is not automatically malicious. Legitimate software also uses executable compression and protection technologies.

9. YARA-Based Detection

YARA is widely used to identify and classify files based on patterns and characteristics.

Rules can match:

  • Specific byte sequences

  • Strings

  • File properties

  • PE characteristics

  • Combinations of multiple indicators

A simple illustrative YARA rule:

rule Suspicious_Executable_Example
{
    meta:
        description = "Illustrative rule for a suspicious executable"
        author = "Malware Planet"

    strings:
        $s1 = "CreateRemoteThread" ascii
        $s2 = "VirtualAlloc" ascii
        $s3 = "WriteProcessMemory" ascii

    condition:
        uint16(0) == 0x5A4D and 2 of them
}

This example is intended for learning. It is not a production malware signature. API names may not appear as strings in a compiled binary, and these APIs are also used by legitimate applications.

Effective YARA rules should use well-researched indicators and be tested against both malicious and benign files to reduce false positives.

10. Common Static Malware Analysis Tools

The following tools can support different stages of static analysis.

ToolPrimary use
Detect It EasyFile identification, compiler and packer detection
PE-bearPE structure inspection
CFF ExplorerPE header and resource inspection
PEStudioStatic malware triage
FLOSSExtraction of obfuscated strings
StringsASCII and Unicode string extraction
YARAPattern-based identification
ExifToolMetadata inspection
GhidraDisassembly and reverse engineering
IDA FreeDisassembly and code analysis
capaIdentification of executable capabilities

Tool selection should depend on the file format, investigation objectives, and available evidence.

11. A Practical Static Analysis Workflow

A repeatable workflow helps analysts avoid missing important information.

Stage 1 — Sample identification

  • Record the sample name and source.

  • Identify the file type.

  • Calculate SHA-256.

  • Record file size and timestamps.

Stage 2 — Initial inspection

  • Examine file headers.

  • Inspect digital signatures.

  • Identify compiler and packer information.

  • Review metadata.

Stage 3 — Content inspection

  • Extract ASCII and Unicode strings.

  • Search for URLs, IP addresses, commands, and paths.

  • Examine resources and embedded data.

  • Review suspicious strings in context.

Stage 4 — PE analysis

  • Inspect sections and their characteristics.

  • Review the entry point.

  • Examine imports and exports.

  • Identify unusual section permissions and entropy.

Stage 5 — Detection and classification

  • Run relevant YARA rules.

  • Compare hashes with available threat intelligence.

  • Review known packer and compiler indicators.

  • Record findings and confidence levels.

Stage 6 — Decide the next investigation step

Based on the evidence, decide whether the sample requires:

  • Additional static analysis

  • Disassembly and reverse engineering

  • Controlled dynamic analysis

  • Memory analysis

  • Network behavior investigation

12. Limitations of Static Analysis

Static analysis is powerful, but it cannot reveal every behavior of a program.

Some challenges include:

  • Packed and encrypted executables

  • Runtime string decryption

  • Dynamic API resolution

  • Code injection

  • Anti-disassembly techniques

  • Anti-debugging checks

  • Environment-dependent execution

  • Fileless or memory-resident functionality

An analyst may identify suspicious characteristics without being able to establish the full execution behavior.

For this reason, static analysis should be considered part of a broader malware investigation process.

Conclusion

Static malware analysis provides a structured starting point for understanding suspicious files. By examining file identification data, hashes, PE structures, strings, imports, metadata, entropy, and detection rules, analysts can build an initial picture of a sample without executing it.

A disciplined triage workflow also helps determine which samples require deeper reverse engineering or controlled dynamic analysis.

The most effective investigations combine multiple techniques. No single indicator, tool, or detection result should be treated as definitive proof of maliciousness.

At Malware Planet, the objective is to understand malware through practical analysis, reverse engineering, and research-driven investigation. Static analysis is one of the foundational skills that helps turn an unknown executable into an evidence-based investigation.

Comments

Popular posts from this blog

Step-by-Step Guide To Install Flare-VM

Malware attacks are increasing daily and we need more people to tackle it, alongside we need to spread awareness among the non-technical customers, so that they can protect themselves from ransomware. Malware Analysis is one of the most demanding skill these days which needs knowledge of multiple tools and techniques.