Malware Triage¶
Quick static analysis to determine if a file is malicious without executing it.
Scenario¶
A suspicious file has been discovered on an endpoint. Before sending it to a sandbox, you need to perform quick static analysis to understand what you're dealing with.
Step 1: Initial Identification¶
First, identify the file type:
Sample Output
Key finding: The file is actually a Windows executable disguised with a PDF extension.
Step 2: Calculate Hashes¶
Get file hashes for lookup:
Sample Output
Step 3: Check Entropy¶
Analyze entropy to detect packing:
Sample Output
Key finding: High entropy suggests the file is packed or encrypted.
Step 4: PE Analysis¶
Analyze the PE structure:
Sample Output
══════════════════════════════════════════════════════════
PE Analysis: suspicious.pdf
══════════════════════════════════════════════════════════
┌─────────────────────────────────────────────────────────┐
│ File Type: PE32 executable │
│ Architecture: x86 (32-bit) │
│ Subsystem: Windows GUI │
│ Compiled: 2025-01-10 14:32:15 │
│ Packer: UPX 3.96 ⚠️ │
│ Imphash: a1b2c3d4e5f6... │
└─────────────────────────────────────────────────────────┘
── 📦 Sections (3) ───────────────────────────────────────
Name Entropy Flags
UPX0 0.00 RWX ⚠️ Suspicious flags
UPX1 7.89 RWX ⚠️ High entropy
UPX2 5.23 RW
── 📥 Suspicious Imports ─────────────────────────────────
VirtualAlloc
VirtualProtect
CreateRemoteThread
WriteProcessMemory
── ⚠️ Anomalies Detected ────────────────────────────────
• UPX packer detected
• Section UPX0 has RWX permissions
• Suspicious imports indicate code injection capability
Key findings: - UPX packer detected - RWX section permissions (suspicious) - Code injection APIs imported
Step 5: Extract Strings¶
Look for interesting strings:
Sample Output
Found 156 interesting strings
── 🌐 URLs (3) ───────────────────────────────────────────
http://evil.com/callback
https://c2server.xyz/beacon
http://pastebin.com/raw/abc123
── 🖥️ IP Addresses (2) ──────────────────────────────────
192.168.1.100
45.33.32.156
── 🔑 Registry Keys (1) ──────────────────────────────────
HKCU\Software\Microsoft\Windows\CurrentVersion\Run
Key findings: - C2 communication URLs - Persistence via registry Run key
Step 6: YARA Scan¶
Scan against YARA rules:
Sample Output
Step 7: Extract IOCs¶
Export all IOCs:
Step 8: Check VirusTotal¶
Submit hash for lookup:
Sample Output
Summary¶
| Check | Finding | Severity |
|---|---|---|
| Extension mismatch | EXE disguised as PDF | High |
| Entropy | 7.82 (packed/encrypted) | Medium |
| Packer | UPX detected | Medium |
| Imports | Code injection APIs | High |
| Strings | C2 URLs, persistence | High |
| YARA | Ransomware match | Critical |
| VirusTotal | 45/70 detections | Critical |
Verdict¶
MALICIOUS — Known ransomware (Cerber family)
Recommended Actions¶
- Quarantine the file immediately
- Block extracted IOCs (IPs, domains)
- Check for lateral spread
- Investigate how the file arrived
- Full sandbox analysis for detailed behavior