Lab 13: Malware Types
🎯 Objective
Understand malware classifications, simulate ransomware behavior safely using base64 encoding, identify Indicators of Compromise (IOCs), and implement defense layers against malware.
📚 Background
Malware (malicious software) is any software intentionally designed to cause harm, gain unauthorized access, or disrupt computer operations. The malware ecosystem is vast and continuously evolving — what started as simple viruses spread by floppy disks has grown into a multi-billion dollar criminal industry with sophisticated ransomware groups, state-sponsored APTs, and malware-as-a-service platforms.
Understanding malware categories helps security professionals make appropriate detection and response decisions. A ransomware incident requires different immediate actions than a rootkit discovery or a cryptocurrency miner. Each type has distinct behaviors, persistence mechanisms, and indicators that enable detection.
Indicators of Compromise (IOCs) are forensic artifacts that indicate a system has likely been compromised. They include file hashes, IP addresses, domain names, registry keys, and behavioral patterns. IOC sharing through platforms like MISP and threat intelligence feeds enables the security community to rapidly deploy defenses against new threats.
⏱️ Estimated Time
45 minutes
📋 Prerequisites
Basic Python programming
Understanding of operating system concepts
🛠️ Tools Used
python3— malware simulationbase64— encoding (safe ransomware simulation)
🔬 Lab Instructions
Step 1: Malware Classification
📸 Verified Output:
💡 What this means: Each malware type has distinct characteristics that drive different defensive responses. Worms require network controls; trojans require endpoint and email controls; rootkits require memory forensics.
Step 2: Ransomware Behavior Simulation (Safe Demo)
📸 Verified Output:
💡 What this means: Real ransomware works identically — replacing original files with encrypted versions and dropping a ransom note. The ONLY reliable recovery without paying is having offline backups that ransomware can't reach.
Step 3: Indicators of Compromise (IOCs)
📸 Verified Output:
💡 What this means: The "Pyramid of Pain" (by David Bianco) ranks IOCs by how painful they are for attackers to change. Hashes are easy to change; TTPs (tactics, techniques, procedures) are hardest — focus on detecting behaviors, not just artifacts.
Step 4: Malware Analysis Techniques Overview
📸 Verified Output:
💡 What this means: Static analysis first (safe, fast), then dynamic analysis in isolated sandbox. Never run unknown malware on your production machine — even "detonating" in a VM requires network isolation.
Step 5: Defense Layers Against Malware
📸 Verified Output:
💡 What this means: The 3-2-1 backup rule is the single most effective ransomware defense. Without offline backups, organizations face paying the ransom or losing data. Modern ransomware specifically deletes shadow copies and network backups — only truly offline or air-gapped backups survive.
Step 6: Malware Persistence Mechanisms
📸 Verified Output:
💡 What this means: Malware maintains persistence to survive reboots. Incident responders check all these locations systematically. MITRE ATT&CK technique TA0003 (Persistence) catalogs over 50 sub-techniques.
Step 7: Real-World Ransomware Analysis
📸 Verified Output:
💡 What this means: WannaCry is one of history's most impactful cyberattacks. It succeeded almost entirely because organizations failed to apply a patch that had been available for 2 months. Regular patching remains the single most impactful security practice.
Step 8: Malware Defense Checklist
📸 Verified Output:
💡 What this means: The checklist is most valuable before an incident. Run through it quarterly. The items most commonly missing in post-incident reviews: backup testing, network segmentation, and an actual tested IR plan.
✅ Verification
🚨 Common Mistakes
Relying only on antivirus: Signature-based AV misses 30-40% of new malware. Use behavioral EDR
Backups on same network: Ransomware specifically deletes network-accessible backups. Use offline/air-gapped copies
Not testing backups: Discovering backup corruption during a ransomware incident is catastrophic
Paying the ransom: No guarantee of decryption key, marks you as willing to pay, no law enforcement coordination
Not practicing incident response: First exposure to IR procedures should not be during an active incident
📝 Summary
Malware types (virus, worm, trojan, ransomware, rootkit) have distinct behaviors requiring different detection and response approaches
Ransomware encrypts files and demands payment; offline backups following 3-2-1 rule are the only reliable protection
IOCs (file hashes, IPs, domains, registry keys) are forensic evidence of compromise; share them via threat intelligence platforms
Defense layers (EDR, email security, patching, MFA, backups, network segmentation) work together — no single control is sufficient
Never analyze malware on production systems; use isolated VMs with snapshot capability and network isolation
🔗 Further Reading
Last updated
