Malware Analysis Workflow & Cheatsheet for SOC Analysts

Malware Analysis Workflow & Cheatsheet

Primary Platforms: REMnux (Linux) | FLARE-VM (Windows)


Table of Contents


Analysis Workflow Overview


Lab Setup & Safety

Critical Safety Rules

  • NEVER run malware on production systems

  • Always use isolated VMs with snapshots

  • Disable network bridging (use Host-Only or NAT with INetSim)

  • Keep analysis VMs offline or use controlled internet simulation

  • Use separate dedicated hardware if possible

REMnux Setup

FLARE-VM Setup


Static Analysis

Phase 1: Initial Triage

Calculate File Hashes

File Type Identification

VirusTotal Lookup

Phase 2: Strings Analysis

Basic Strings Extraction

FLOSS - Advanced String Extraction

What to look for in strings:

  • URLs and IP addresses

  • File paths (C:, %TEMP%, %APPDATA%)

  • Registry keys

  • API function names

  • User-Agent strings

  • Email addresses

  • Crypto wallet addresses

  • Command-and-control indicators

Phase 3: PE Analysis (Windows Executables)

PEiD / Detect It Easy (DIE)

PE Header Analysis with pefile

Suspicious PE Characteristics Checklist

  • High entropy sections (>7.0) - likely packed/encrypted

  • Unusual section names (.data, .text are normal; .upx, .aspack are suspicious)

  • Suspicious imports:

    • VirtualAlloc, VirtualProtect - memory manipulation

    • CreateRemoteThread - process injection

    • WriteProcessMemory - code injection

    • WinExec, ShellExecute - command execution

    • InternetOpen, InternetReadFile - network activity

    • CryptEncrypt, CryptDecrypt - encryption

  • Compilation timestamp - Future dates or very old dates

  • Low import count - may indicate dynamic loading

CFF Explorer Analysis

Phase 4: Unpacking Detection and Handling

Detecting Packed Samples

Entropy Guide:

  • 0-4.5: Plain text, low compression

  • 4.5-6.5: Compressed data

  • 6.5-7.5: Encrypted/packed

  • 7.5-8.0: Highly encrypted

Unpacking Common Packers

UPX Unpacking:

Generic Unpacking with x64dbg:

Automated Unpacking with OllyDumpEx:


Dynamic Analysis

Phase 1: Behavioural Monitoring Setup

REMnux Dynamic Analysis

FLARE-VM Dynamic Analysis Setup

Phase 2: Process Monitoring

Procmon Configuration (FLARE-VM)

Essential Filters:

What to Monitor:

  1. Registry Operations:

    • HKLM\Software\Microsoft\Windows\CurrentVersion\Run - Persistence

    • HKCU\Software\Microsoft\Windows\CurrentVersion\Run - Persistence

    • HKLM\System\CurrentControlSet\Services - Service creation

  2. File System Operations:

    • Files created in %TEMP%, %APPDATA%

    • Executables dropped to disk

    • DLL loading patterns

  3. Network Operations:

    • TCP/UDP connections

    • DNS queries

Process Explorer (FLARE-VM)

Key Things to Check:

  • Unsigned processes

  • Processes with no description

  • Processes running from unusual locations

  • Unusual parent-child relationships

  • Injected DLLs

Phase 3: API Call Monitoring

API Monitor (FLARE-VM)

Suspicious API Call Patterns:

Code Injection:

Keylogging:

Persistence:

Anti-Analysis:

Phase 4: Network Analysis

Capturing Network Traffic

Analysing Network Traffic

Wireshark Filters:

INetSim Configuration (REMnux)

FakeNet-NG Usage

Phase 5: Execution in Sandbox

Cuckoo Sandbox Analysis (REMnux)

What Cuckoo Provides:

  • Screenshot timeline

  • API call trace

  • Network traffic

  • Dropped files

  • Registry modifications

  • Memory dumps

  • Behavioral signatures

Manual Sandbox Execution


Memory Analysis

Capturing Memory

Windows Memory Acquisition

Process Memory Dump

Memory Analysis with Volatility

Volatility 3 (REMnux)

Memory Analysis Workflow Example

Suspicious Memory Indicators:

  • Processes running from temp directories

  • Processes with no parent (PPID = 0)

  • Hidden processes (in psscan but not pslist)

  • Unusual network connections

  • Code injection indicators (PAGE_EXECUTE_READWRITE)

  • Orphan threads


Network Analysis

Protocol Analysis

HTTP/HTTPS Traffic

DNS Analysis

IRC/P2P/Custom Protocols

NetworkMiner Analysis (FLARE-VM)


Malware Type-Specific Workflows

1. Ransomware Analysis

Static Analysis Focus

Dynamic Analysis - Safe Execution

Ransomware IOC Extraction

Look for:

  • Ransom note file names (README.txt, HOW_TO_DECRYPT.txt)

  • File extension changes

  • Bitcoin wallet addresses in strings

  • Tor .onion addresses

  • Email addresses for contact

  • Shadow copy deletion commands: vssadmin delete shadows /all /quiet

  • Boot record modification

Registry Keys:

  • HKLM\Software\Microsoft\Windows\CurrentVersion\Run

  • HKCU\Software\Microsoft\Windows\CurrentVersion\Run

2. Trojan/RAT Analysis

Static Analysis Focus

Dynamic Analysis Workflow

RAT Capabilities to Test:

  • Command execution (create test file via RAT)

  • Screen capture

  • Keylogging (type in notepad)

  • File upload/download

  • Remote shell

  • Webcam access

  • Persistence mechanism

Common RAT Network Patterns

3. Spyware/Infostealer Analysis

Target Data Collection Points

Common Stealer Targets

Browser Data:

  • Chrome: %LOCALAPPDATA%\Google\Chrome\User Data\Default\

    • Login Data (passwords)

    • Cookies

    • Web Data (autofill)

  • Firefox: %APPDATA%\Mozilla\Firefox\Profiles\

    • logins.json

    • cookies.sqlite

Crypto Wallets:

  • Bitcoin: %APPDATA%\Bitcoin\wallet.dat

  • Ethereum: %APPDATA%\Ethereum\keystore\

  • Exodus: %APPDATA%\Exodus\

Discord Tokens:

  • %APPDATA%\Discord\Local Storage\leveldb\

FTP Clients:

  • FileZilla: %APPDATA%\FileZilla\recentservers.xml

Dynamic Analysis

4. Dropper/Downloader Analysis

Static Analysis

Dynamic Analysis - Capture Dropped Files

Capture Downloaded Payloads

5. Document-Based Malware (Maldocs)

Microsoft Office Document Analysis

olevba (REMnux):

mraptor (REMnux):

oleid (REMnux):

PDF Malware Analysis

pdfid (REMnux):

Pdf-parser (REMnux):

peepdf (REMnux):

Maldoc Dynamic Analysis

6. Fileless Malware Analysis

PowerShell-Based Attacks

Static Analysis:

Dynamic Analysis:

WMI-Based Persistence

Registry-Based Fileless Malware


Tool Reference Guide

REMnux Essential Tools

Tool
Purpose
Basic Usage

strings

Extract ASCII/Unicode strings

strings -a sample.exe

file

Identify file type

file sample

exiftool

Extract metadata

exiftool sample.exe

xxd/hexdump

Hex viewer

xxd sample.exe | head

upx

UPX unpacker

upx -d sample.exe

die

Detect packer/compiler

die sample.exe

peframe

PE file analysis

peframe sample.exe

floss

Obfuscated string extraction

floss sample.exe

olevba

VBA macro extraction

olevba document.doc

pdfid

PDF structure analysis

pdfid sample.pdf

pdf-parser

PDF object extraction

pdf-parser sample.pdf

tcpdump

Packet capture

tcpdump -i eth0 -w capture.pcap

tshark

Packet analysis (CLI)

tshark -r capture.pcap

wireshark

Packet analysis (GUI)

wireshark capture.pcap

inetsim

Internet service simulation

sudo inetsim

fakenet

Network traffic simulation

sudo fakenet

volatility

Memory forensics

vol -f mem.raw windows.pslist

yara

Pattern matching

yara rules.yar sample.exe

capa

Capability detection

capa sample.exe

FLARE-VM Essential Tools

Tool
Purpose
Basic Usage

Process Monitor

Real-time process monitoring

procmon.exe

Process Explorer

Advanced process viewer

procexp.exe

Autoruns

Startup programs analyzer

autoruns.exe

Wireshark

Packet analysis

wireshark.exe

FakeNet-NG

Network simulation

fakenet.exe

x64dbg/x32dbg

Debugger

x96dbg.exe

IDA Free

Disassembler

ida64.exe

Ghidra

Reverse engineering

ghidraRun.bat

CFF Explorer

PE editor

CFF Explorer.exe

PEiD

Packer detection

PEiD.exe

Detect It Easy

File analyzer

die.exe

API Monitor

API call monitoring

apimonitor-x64.exe

Regshot

Registry comparison

regshot.exe

NetworkMiner

Network forensics

NetworkMiner.exe

HxD

Hex editor

HxD.exe

Strings

String extraction

strings.exe

PEview

PE structure viewer

peview.exe

Capa

Capability detection

capa.exe

Quick Command Reference

Hash Calculation

String Extraction

Network Capture


IOC Extraction & Reporting

Indicator Types

Network Indicators:

  • IP addresses

  • Domain names

  • URLs

  • User-Agent strings

  • SSL certificate hashes

  • Email addresses

File Indicators:

  • MD5, SHA1, SHA256 hashes

  • File names

  • File paths

  • PDB paths

  • Mutexes

  • Registry keys

Behavioural Indicators:

  • API call sequences

  • Process injection techniques

  • Persistence mechanisms

  • C2 communication patterns

Automated IOC Extraction

Using FLOSS and Strings

Using IOC Extract Tools

YARA Rule Creation

Basic YARA Rule Template:

Testing YARA Rules:

Creating Snort/Suricata Rules

Basic Snort Rule:

HTTP-Based C2 Detection:

Report Template

Malware Analysis Report

Executive Summary

  • Malware Family: [Name]

  • Threat Level: [Critical/High/Medium/Low]

  • Analysis Date: [Date]

  • Analyst: [Name]

Sample Information

  • File Name: malware.exe

  • File Size: 1.2 MB

  • MD5: abc123...

  • SHA256: def456...

  • File Type: PE32 executable

Key Findings

  • [Primary malware behaviour]

  • [Communication method]

  • [Persistence mechanism]

Technical Analysis

Static Analysis

  • Packer: [None/UPX/Other]

  • Compiler: [Microsoft Visual C++/Other]

  • Imports: [Key DLLs and functions]

  • Suspicious Strings: [List key strings]

Dynamic Analysis

  • Execution: [Behaviour observed]

  • Network Activity: [C2 servers, protocols]

  • File Operations: [Files created/modified]

  • Registry Changes: [Keys modified]

  • Persistence: [Mechanism used]

Capabilities

Indicators of Compromise (IOCs)

Network Indicators

  • C2 Server: 192.168.1.100

  • Domains: malicious-domain.com

  • URLs: http://malicious-domain.com/gate.php

File Indicators

  • Dropped Files:

    • C:\Users\Public\malware.dll (SHA256: ...)

  • Registry Keys:

    • HKCU\Software\Microsoft\Windows\CurrentVersion\Run\Malware

Behavioural Indicators

  • Process injection into explorer.exe

  • Beacon interval: 60 seconds

MITRE ATT&CK Mapping

  • Initial Access: T1566 - Phishing

  • Execution: T1059 - Command and Scripting Interpreter

  • Persistence: T1547 - Registry Run Keys

  • Defense Evasion: T1027 - Obfuscated Files or Information

  • Command and Control: T1071 - Application Layer Protocol

Recommendations

  1. Block IOCs at network and endpoint

  2. Hunt for indicators in environment

  3. Update detection signatures

  4. User awareness training

Detection Rules

[Include YARA, Snort/Suricata rules]

Appendix

  • Full strings output

  • Process Monitor logs

  • Network traffic captures

  • Memory analysis results

Advanced Techniques Bypassing Anti-Analysis

Anti-VM Detection Bypass

Anti-Debugging Bypass

Code Analysis with Ghidra

Ghidra Workflow:

  1. Import binary (File → Import File)

  2. Auto-analyse (Yes to prompts)

  3. Navigate to entry point (Symbol Tree → Entry)

  4. Rename functions for clarity

  5. Use decompiler (Window → Decompile)

  6. Look for interesting functions:

    • String references (Search → For Strings)

    • Cross-references (Right-click → References)

    • API calls

Automated Analysis with Capa

Capa detects:

  • Capabilities (what the malware can do)

  • MITRE ATT&CK techniques

  • Code patterns

  • Behavioral indicators


Quick Reference Checklists

Initial Triage Checklist

  • [ ] Calculate hashes (MD5, SHA256)

  • [ ] Identify file type

  • [ ] Check VirusTotal / MalwareBazaar

  • [ ] Assess threat level

  • [ ] Document source and context

Static Analysis Checklist

  • [ ] Extract strings (ASCII/Unicode)

  • [ ] Run FLOSS for obfuscated strings

  • [ ] Analyse PE headers (if Windows)

  • [ ] Check for packers

  • [ ] Review imports/exports

  • [ ] Examine file entropy

  • [ ] Extract embedded resources

  • [ ] Check digital signatures

Dynamic Analysis Checklist

  • [ ] Take VM snapshot

  • [ ] Start monitoring tools (Procmon, Wireshark)

  • [ ] Configure network simulation

  • [ ] Execute sample

  • [ ] Observe for 5-10 minutes

  • [ ] Interact with system

  • [ ] Check persistence mechanisms

  • [ ] Capture memory dump

  • [ ] Document all behaviours

  • [ ] Revert to snapshot

Report Checklist

  • [ ] Executive summary

  • [ ] Sample metadata

  • [ ] Static analysis findings

  • [ ] Dynamic analysis findings

  • [ ] Network analysis findings

  • [ ] Extracted IOCs

  • [ ] MITRE ATT&CK mapping

  • [ ] Detection rules (YARA/Snort)

  • [ ] Remediation recommendations


Common Pitfalls and Best Practices

Safety Best Practices

DO:

  • Always work in isolated VMs

  • Take snapshots before analysis

  • Use network simulation tools

  • Document everything

  • Maintain chain of custody

  • Use write-protected evidence

DON'T:

  • Analyse on production systems

  • Allow real internet connectivity

  • Trust any input from malware

  • Double-click unknown executables outside VM

  • Forget to revert snapshots

  • Mix personal and analysis activities

Analysis Best Practices

DO:

  • Start with static analysis

  • Use multiple tools for confirmation

  • Search for similar samples

  • Look for known signatures

  • Document your methodology

  • Take screenshots of key findings

  • Automate repetitive tasks

  • Collaborate with team

DON'T:

  • Skip basic triage

  • Rely only on one tool

  • Ignore context

  • Make assumptions

  • Forget to check for updates

  • Share samples insecurely


Resources and Further Learning

Essential Resources

  • FLARE Team Blog: https://www.mandiant.com/resources/blog

  • Malware Traffic Analysis: https://malware-traffic-analysis.net/

  • Hybrid Analysis: https://www.hybrid-analysis.com/

  • ANY.RUN: https://any.run/

  • MalwareBazaar: https://bazaar.abuse.ch/

  • VirusTotal: https://www.virustotal.com/

Training Resources

  • Practical Malware Analysis (book)

  • The Art of Memory Forensics (book)

  • SANS FOR610: Reverse-Engineering Malware

  • Malware Unicorn Workshops

  • Open Security Training

Community

  • r/Malware (Reddit)

  • r/ReverseEngineering (Reddit)

  • Malware Analysis Discord servers

  • Twitter: #MalwareAnalysis #DFIR


This document is for educational purposes only.

Last updated