DFIR December 2024 11 min read

The SOC Analyst's Guide to Malware Analysis

A practical introduction to malware analysis for SOC analysts — covering the safe lab setup, static analysis, dynamic analysis, behavioural indicators, and how to translate findings into actionable detection rules.

Published
Author: Sid Faza Category: DFIR
// 01

Why SOC Analysts Need Malware Analysis Skills

Malware analysis is often seen as the exclusive domain of dedicated reverse engineers. But every L2+ SOC analyst should be able to perform basic behavioural analysis — enough to triage a suspicious file, extract network indicators, and determine whether a sample is benign, a known family, or something novel requiring escalation.

You do not need to read assembly to do useful malware analysis. Static properties and dynamic behaviour give you 80% of what you need for triage and IOC extraction.

The goal for most SOC analysts is not full reverse engineering — it's fast triage: is this malicious? What does it do? What network connections does it make? What persistence does it establish? Those questions can be answered with the right tools and methodology in under 30 minutes.

// 02

Safe Lab Setup

REMnux

A Linux VM pre-built for malware analysis — network simulators, static analysis tools, sandbox environments, and disassemblers all pre-installed. Start here.

Flare-VM

A Windows VM with analysis tools — needed for Windows malware that requires a real Windows environment to detonate. Always snapshot before detonation.

INetSim

Network simulation tool that responds to DNS, HTTP, SMTP and other protocols — lets malware think it has internet access without actual internet exposure.

Wireshark

Capture all network traffic during dynamic analysis — even if malware uses encrypted C2, the connection patterns, destination IPs, and timing are valuable.

CRITICAL

Never analyse malware on a production machine or a machine connected to your production network. Always use isolated VMs with no host-only network access to internal resources. Snapshot before detonation. Reset after every sample.

// 03

Static Analysis — Before You Run It

Static analysis examines the file without executing it. It is safe, fast, and often sufficient for triage.

bash — Static Triage Checklist
# 1. Hash the sample — check against VirusTotal
sha256sum suspicious.exe
# curl -s -H x-apikey:VT_KEY https://www.virustotal.com/api/v3/files/HASH

# 2. File type — is it really an EXE? PE32? DLL?
file suspicious.exe
exiftool suspicious.exe

# 3. Strings — printable strings reveal IOCs
strings -n 8 suspicious.exe | grep -E "http|\.exe|\.dll|registry|HKEY"

# 4. PE headers — imports reveal capabilities
pecheck suspicious.exe
# Look for: CreateRemoteThread, VirtualAllocEx, WriteProcessMemory (injection)
# Look for: WinInet, WS2_32 (networking), Crypt* (encryption/C2 comms)

# 5. Packing detection — packed samples need dynamic analysis
die suspicious.exe # Detect-It-Easy
// 04

Dynamic Analysis — Watch It Run

Dynamic analysis executes the sample in a controlled environment and observes behaviour. It reveals what static analysis misses — decrypted payloads, runtime-generated domains, and exact persistence mechanisms.

bash — Dynamic Analysis Setup
# Start INetSim on REMnux to simulate internet
sudo inetsim

# Start Wireshark to capture traffic
wireshark -i eth0 -w capture.pcap

# On Windows Flare-VM, monitor with Process Monitor + Autoruns
# Enable all categories in Procmon before detonation:
# Registry — what keys are created/modified?
# File System — what files are dropped?
# Network — what connections are made?
# Process — what child processes are spawned?

# Detonate the sample and observe for 3–5 minutes
suspicious.exe
BehaviourWhat It MeansDetection
Creates registry Run keyPersistence mechanismT1547.001 — Registry Run Keys
Spawns cmd.exe/powershell.exeCode execution, stagingT1059 — Command Scripting
Injects into svchost.exeProcess injection, evasionT1055 — Process Injection
DNS lookup then HTTP GETC2 beaconingT1071.001 — Web Protocols
Accesses LSASS memoryCredential theftT1003.001 — LSASS Dump
Mass file renameRansomware encryptionT1486 — Data Encrypted for Impact
// 05

Extracting Actionable IOCs

python — IOC Extractor from Pcap
from scapy.all import rdpcap, DNS, DNSQR
import re

packets = rdpcap(capture.pcap)
domains, ips = set(), set()

for pkt in packets:
    if pkt.haslayer(DNSQR):
        domains.add(pkt[DNSQR].qname.decode().rstrip(.))
    if pkt.haslayer(IP):
        ips.add(pkt[IP].dst)

print(Domains:, domains)
print(IPs:, ips)
// 06

Writing YARA Rules from Analysis Findings

yara — Rule from Dynamic Analysis
rule Trojan_Dropper_Generic_001 {
    meta:
        author = Sid Faza
        description = Dropper observed writing payload to Temp and establishing Run key persistence
        date = 2024-12-01
        mitre = T1547.001, T1059.001
    strings:
        $reg1  = CurrentVersion\\Run wide ascii nocase
        $drop1 = %TEMP%\\ wide ascii nocase
        $ps1   = powershell wide ascii nocase
        $c2    = maliciousdomain.com wide ascii
    condition:
        uint16(0) == 0x5A4D  // MZ header and
        2 of ($reg1, $drop1, $ps1) and $c2
}
// 07

The 30-Minute Triage Workflow

MinuteStepToolOutput
0–3Hash & VT lookupsha256sum + VT APIKnown family / detection rate
3–8Static propertiesfile, strings, pecheckPacked? Suspicious imports? Strings IOCs?
8–15Sandbox submissionAny.run or CuckooAuto-extracted IOCs, behaviour summary
15–22Dynamic analysisProcmon + WiresharkNetwork IOCs, persistence mechanism, child processes
22–28IOC extractionCustom scripts, MISPDomains, IPs, hashes, registry keys, file paths
28–30YARA rule & SIEMYARA, SigmaPermanent detection + ticket documentation
Done

After 30 minutes you should know: what the sample does, what IOCs to block, what MITRE techniques to reference, and whether you need to escalate to full reverse engineering.