Cybersecurity Labs - Module 3

Master malware analysis, network forensics, and endpoint detection with hands-on threat hunting labs.

These Labs Cover All Cybersecurity Certifications

CompTIA Security+CompTIA CySA+CompTIA PenTest+CompTIA SecurityXISC2 CISSPISC2 SSCPISC2 CCSPISC2 CGRC
ISC2 CSSLPISC2 ISSAPISC2 ISSEPISC2 ISSMPISACA CISAISACA CISMISACA CRISCISACA CDPSE

Threat Hunting & Analysis Labs

Develop advanced skills in malware analysis, network forensics, and threat detection.

Lab 7: Malware Analysis & Sandboxing
Terminal
Security+
Scenario: Analyze Suspicious Executable
MediCare Inc received a suspicious email attachment. Use static and dynamic analysis techniques in an isolated sandbox to identify if this is malware and determine its capabilities.

Learning Objectives:

  • Perform static malware analysis (hashes, strings)
  • Execute dynamic analysis in isolated sandbox
  • Identify indicators of compromise (IOCs)

Step-by-Step Instructions

  1. Step 1: Calculate File Hash
    šŸŽÆ Goal: Generate SHA256 hash for malware identification

    šŸ“ Why This Matters:
    File hashes are unique fingerprints. Before analyzing malware, calculate its hash to check against threat intelligence databases (VirusTotal, MISP). This quickly identifies known malware without risking execution.

    šŸ’» Command:
    sha256sum /samples/suspicious.exe

    šŸ” What This Does:
    • Generates unique 256-bit hash of file
    • Hash changes if even 1 byte is modified
    • Used to search threat intel databases
    šŸŽ“ Exam Tip: Know hash types: MD5 (weak, deprecated), SHA1 (weak), SHA256 (standard), SHA512 (high security).
  2. Step 2: Extract Strings
    šŸŽÆ Goal: Find readable text in the binary

    šŸ“ Why This Matters:
    Strings reveal malware capabilities without execution: C2 server URLs, registry keys modified, files created, error messages, and attacker comments. This is safe static analysis that exposes intent.

    šŸ’» Command:
    strings /samples/suspicious.exe | grep -E "(http|\.exe|reg|cmd|password)"

    šŸ” What to Look For:
    • URLs - C2 communication
    • Registry paths - Persistence mechanisms
    • File paths - Payload drops
    • Commands - System manipulation
    • Encoded strings - Obfuscation attempts
    šŸ’” Analysis Tip: Base64 encoded strings often hide malicious URLs. Decode with: echo "string" | base64 -d
  3. Step 3: Check File Type
    šŸŽÆ Goal: Verify actual file format vs extension

    šŸ“ Why This Matters:
    Attackers disguise malware with fake extensions (invoice.pdf.exe, image.jpg.scr). The file command reads magic bytes to determine actual type, exposing extension spoofing attacks.

    šŸ’» Command:
    file /samples/suspicious.exe

    šŸ” Common Disguises:
    • .pdf.exe - Exploits hidden extensions
    • .jpg.scr - Screensaver masquerading as image
    • .doc.js - JavaScript in Office disguise
    • Double extensions trick users
  4. Step 4: Submit to Cuckoo Sandbox
    šŸŽÆ Goal: Submit sample to automated sandbox for dynamic analysis

    šŸ“ Why This Matters:
    Cuckoo Sandbox is a real open-source malware analysis system. It runs malware in isolated VMs, monitors all behavior, and generates detailed reports. Used by security teams worldwide.

    šŸ’» Command:
    cuckoo submit /samples/suspicious.exe

    šŸ” Cuckoo Features:
    • Automated VM execution
    • API hooking and syscall monitoring
    • Network traffic capture (InetSim)
    • Memory dumps for forensics
    • Behavioral signatures database
    āš ļø Real Tool: Cuckoo Sandbox - https://cuckoosandbox.org
  5. Step 5: Review Cuckoo Analysis
    šŸŽÆ Goal: Examine automated analysis results

    šŸ“ Why This Matters:
    Cuckoo's analysis reveals runtime behavior: process trees, file drops, registry changes, network connections. The severity score and triggered signatures help prioritize response.

    šŸ’» Command:
    cuckoo analyze 1547

    šŸ” Analysis Report Sections:
    • Severity score (0-10)
    • Behavioral signatures triggered
    • Network activity (DNS, HTTP, TCP)
    • File system changes
    • Registry modifications
    • Process tree
  6. Step 6: Analyze Network Capture
    šŸŽÆ Goal: Examine C2 communication from PCAP

    šŸ“ Why This Matters:
    Cuckoo captures all network traffic during execution. Using tcpdump to read this PCAP reveals exact C2 communications, data exfiltration, and payload downloads.

    šŸ’» Command:
    cat /opt/cuckoo/storage/analyses/1547/network.pcap | tcpdump -r - -nn

    šŸ” Network IOCs:
    • C2 server IPs and ports
    • Beacon intervals
    • Data exfiltration volume
    • Protocol patterns
    šŸŽ“ Real Tool: tcpdump - standard packet analyzer on all Linux systems
  7. Step 7: Memory Forensics with Volatility
    šŸŽÆ Goal: Analyze memory dump for injected code

    šŸ“ Why This Matters:
    Volatility Framework is the industry-standard memory forensics tool. It extracts process trees, detects code injection, finds hidden processes, and recovers encryption keys from RAM.

    šŸ’» Command:
    volatility -f /opt/cuckoo/storage/analyses/1547/memory.dmp --profile=Win10x64 pstree

    šŸ” Volatility Capabilities:
    • Process tree analysis (pstree)
    • Injected code detection (malfind)
    • Network connections (netscan)
    • Registry extraction (hivelist)
    • Password hashes (hashdump)
    šŸ’” Real Tool: Volatility Framework - https://volatilityfoundation.org
  8. Step 8: Extract IOCs with jq
    šŸŽÆ Goal: Parse Cuckoo JSON report to extract IOCs

    šŸ“ Why This Matters:
    Cuckoo generates JSON reports with all findings. Using jq (command-line JSON processor) extracts specific IOCs for import into SIEM, EDR, and threat intel platforms.

    šŸ’» Command:
    cat /opt/cuckoo/storage/analyses/1547/reports/report.json | jq '.signatures,.network.hosts' > /reports/iocs.json && echo "IOC report generated"

    šŸ” Extracted IOCs:
    • File hashes (MD5, SHA1, SHA256)
    • Network indicators (IPs, domains, URLs)
    • YARA rule matches
    • Behavioral signatures
    šŸŽ“ Real Tools: jq for JSON parsing, STIX/TAXII for sharing threat intel
REMnux - Malware Analysis Workstation
REMnux Malware Analysis Distribution v7.0 *** Isolated Sandbox Environment *** Sample: /samples/suspicious.exe WARNING: Execute samples in sandbox ONLY! Type commands EXACTLY as shown.
analyst@remnux:~$
Progress: 0/8
Score: 0/100
Lab 8: Network Traffic Analysis & Packet Capture
Terminal
CySA+
Scenario: Investigate Data Exfiltration
DataTech's DLP system flagged unusual outbound traffic. Analyze packet captures to identify data exfiltration, determine what data was stolen, and trace the destination.

Learning Objectives:

  • Capture and filter network traffic with tcpdump
  • Analyze packets with Wireshark/tshark
  • Extract files and identify exfiltrated data

Step-by-Step Instructions

  1. Step 1: Start Packet Capture
    šŸŽÆ Goal: Capture live network traffic

    šŸ“ Why This Matters:
    Packet capture is the foundation of network forensics. Every network communication leaves traces - even encrypted traffic reveals metadata like timing, volume, and destinations useful for investigation.

    šŸ’» Command:
    sudo tcpdump -i eth0 -w /captures/traffic.pcap -c 1000

    šŸ” Parameters:
    • -i eth0 - Interface to capture
    • -w - Write to file
    • -c 1000 - Capture 1000 packets
    šŸ’” Performance: Use BPF filters to reduce capture volume. Capturing everything fills disk fast!
  2. Step 2: Filter for Suspicious Traffic
    šŸŽÆ Goal: Isolate outbound data transfers

    šŸ“ Why This Matters:
    Raw captures contain millions of packets. Filtering isolates relevant traffic - large outbound transfers to unknown IPs are classic exfiltration indicators.

    šŸ’» Command:
    tcpdump -r /captures/traffic.pcap 'src net 192.168.0.0/16 and dst port 443 and greater 1000'

    šŸ” Filter Logic:
    • src net 192.168.0.0/16 - From internal network
    • dst port 443 - HTTPS (common exfil channel)
    • greater 1000 - Large packets only
  3. Step 3: Analyze with tshark
    šŸŽÆ Goal: Extract detailed protocol information

    šŸ“ Why This Matters:
    tshark (command-line Wireshark) parses protocols deeply. It extracts HTTP headers, DNS queries, TLS certificates - revealing what applications transmitted and to whom.

    šŸ’» Command:
    tshark -r /captures/traffic.pcap -Y "http.request" -T fields -e ip.src -e ip.dst -e http.host -e http.request.uri

    šŸ” Output Fields:
    • Source/destination IPs
    • HTTP host header (domain)
    • Request URI (path accessed)
    • Reveals web traffic patterns
    šŸŽ“ CySA+ Exam: Know protocol analysis! HTTP headers reveal user-agent, referrer, and transferred content types.
  4. Step 4: Extract DNS Queries
    šŸŽÆ Goal: Identify domains contacted

    šŸ“ Why This Matters:
    DNS reveals intent - malware queries C2 domains, exfiltration contacts file sharing sites. DNS tunneling hides data in queries. Every domain lookup leaves a trace even with encrypted traffic.

    šŸ’» Command:
    tshark -r /captures/traffic.pcap -Y "dns.qry.name" -T fields -e dns.qry.name | sort | uniq -c | sort -rn

    šŸ” DNS Analysis:
    • High query count = suspicious
    • Long random subdomains = DGA/tunneling
    • Newly registered domains = risky
    • Country TLDs (.ru, .cn) = depends on business
  5. Step 5: Identify Large Transfers
    šŸŽÆ Goal: Find high-volume data flows

    šŸ“ Why This Matters:
    Data exfiltration requires moving data out - large outbound transfers to unusual destinations are red flags. Statistical analysis of flow data quickly identifies anomalies.

    šŸ’» Command:
    tshark -r /captures/traffic.pcap -q -z conv,tcp | sort -k 10 -rn | head -20

    šŸ” Conversation Stats:
    • Bytes transferred per flow
    • Duration of connections
    • Top talkers by volume
    • Unusual destinations
    āš ļø Exfil Indicators: Large outbound to cloud storage, file sharing sites, or foreign IPs warrants investigation.
  6. Step 6: Extract Transferred Files
    šŸŽÆ Goal: Recover exfiltrated data

    šŸ“ Why This Matters:
    Knowing that data left isn't enough - you need to know WHAT data. File carving from packet captures recovers transmitted files for impact assessment and breach notification requirements.

    šŸ’» Command:
    tshark -r /captures/traffic.pcap --export-objects http,/extracted/

    šŸ” What Gets Extracted:
    • Documents (PDF, DOC, XLS)
    • Images
    • Archives (ZIP, RAR)
    • Any HTTP-transferred file
  7. Step 7: Check TLS Certificates
    šŸŽÆ Goal: Analyze encrypted connection destinations

    šŸ“ Why This Matters:
    HTTPS encrypts content but TLS certificates reveal the server identity. Self-signed certs, suspicious issuers, or mismatched names indicate malicious infrastructure or MitM attacks.

    šŸ’» Command:
    tshark -r /captures/traffic.pcap -Y "tls.handshake.certificate" -T fields -e x509sat.uTF8String -e x509ce.dNSName

    šŸ” Certificate Red Flags:
    • Self-signed certificates
    • Recently issued (< 30 days)
    • Free CA (Let's Encrypt abuse)
    • Name mismatches
    šŸŽ“ Detection: C2 servers often use self-signed certs or free CAs. Legitimate businesses use proper certificates.
  8. Step 8: Generate Analysis Report
    šŸŽÆ Goal: Document findings for incident response

    šŸ“ Why This Matters:
    Network analysis findings feed incident response: IPs to block, domains to sinkhole, compromised systems to isolate. Documentation supports legal action and compliance reporting.

    šŸ’» Command:
    tshark -r /captures/traffic.pcap -q -z endpoints,ip > /reports/network-analysis.txt

    šŸ” Report Contents:
    • Timeline of suspicious connections
    • Source systems involved
    • Destination IPs/domains
    • Volume of data transferred
    • Extracted file inventory
Security Onion - Network Analysis
Security Onion Network Monitoring Platform *** Network Forensics Workstation *** PCAP files in: /captures/ Alert: DLP flagged unusual outbound traffic Type commands EXACTLY as shown.
analyst@seconion:~$
Progress: 0/8
Score: 0/100
Lab 9: Endpoint Detection & Response (EDR)
GUI-Based
CySA+
Scenario: Threat Hunt Across Endpoints
BankCorp's EDR detected suspicious PowerShell activity on multiple workstations. Investigate the alerts, perform threat hunting, and contain compromised endpoints before lateral movement succeeds.

Learning Objectives:

  • Investigate EDR alerts and telemetry
  • Hunt for IOCs across endpoint fleet
  • Isolate and remediate compromised systems

GUI Step-by-Step Instructions

  1. Step 1: Review Alert Dashboard
    šŸŽÆ Goal: Triage incoming security alerts

    šŸ“ Why This Matters:
    EDR generates hundreds of alerts daily. Effective triage separates critical threats from noise. Dashboard review identifies patterns - multiple similar alerts suggest coordinated attack.

    šŸ’» Actions:
    1. Click "View Alerts" button
    2. Filter by Severity: Critical & High
    3. Note the PowerShell alerts across workstations
    4. Identify affected endpoints

    šŸ” Alert Triage:
    • Critical - Active exploitation, immediate action
    • High - Confirmed malicious, investigate quickly
    • Medium - Suspicious, needs analysis
    • Low - Anomaly, review when time permits
    šŸŽ“ CySA+ Tip: Look for alert correlation - same technique on multiple endpoints indicates active threat.
  2. Step 2: Investigate Endpoint
    šŸŽÆ Goal: Deep dive into compromised system

    šŸ“ Why This Matters:
    Alert context determines response. Full endpoint investigation reveals: Was the attack successful? What processes spawned? What files were accessed? This guides containment decisions.

    šŸ’» Actions:
    1. Click "Investigate Endpoint" button
    2. Select: WKS-FIN-042
    3. Review process tree and timeline
    4. Note suspicious parent-child relationships

    šŸ” Investigation Focus:
    • Process tree - What spawned what?
    • Network connections - Where did it connect?
    • File modifications - What was changed?
    • Registry changes - Persistence mechanisms?
  3. Step 3: Hunt for IOCs
    šŸŽÆ Goal: Search all endpoints for indicators

    šŸ“ Why This Matters:
    One compromised endpoint often means more are affected. IOC hunting searches your entire fleet for matching artifacts - file hashes, registry keys, network connections - revealing full scope of compromise.

    šŸ’» Actions:
    1. Click "Threat Hunt" button
    2. IOC Type: File Hash
    3. Enter hash: a1b2c3d4e5f6... (from investigation)
    4. Scope: All Endpoints
    5. Click "Search"

    šŸ” Hunt Queries:
    • File hash - Find same malware elsewhere
    • Process name - Suspicious executables
    • Network destination - C2 connections
    • Registry key - Persistence locations
    šŸ’” Proactive Hunting: Don't wait for alerts. Regular hunts for new TTPs catch threats that evade detection.
  4. Step 4: Isolate Compromised Endpoints
    šŸŽÆ Goal: Contain threat by network isolation

    šŸ“ Why This Matters:
    Isolation prevents lateral movement and data exfiltration. EDR can quarantine endpoints while maintaining management access - the system can't attack others but analysts can still investigate and remediate.

    šŸ’» Actions:
    1. Click "Isolate Endpoint" button
    2. Select endpoints: WKS-FIN-042, WKS-FIN-017
    3. Isolation Type: Network Quarantine
    4. Click "Confirm Isolation"

    šŸ” Isolation Options:
    • Full isolation - No network except EDR
    • Partial - Allow specific IPs/services
    • Warning mode - Alert but don't block
    āš ļø Business Impact: Isolation disrupts user work. Coordinate with management for critical systems.
  5. Step 5: Collect Forensic Data
    šŸŽÆ Goal: Preserve evidence for analysis

    šŸ“ Why This Matters:
    Remote forensic collection captures volatile data before it's lost: running processes, network connections, memory artifacts. This evidence supports incident investigation and potential legal action.

    šŸ’» Actions:
    1. Click "Collect Forensics" button
    2. Select: WKS-FIN-042
    3. Collection Type: Full Triage Package
    4. Include: Memory dump, event logs, browser history
    5. Click "Start Collection"

    šŸ” Triage Package Includes:
    • Memory dump - Running processes, encryption keys
    • Event logs - User activity, process execution
    • File timeline - Recent changes
    • Network connections - Active sessions
  6. Step 6: Remediate Threats
    šŸŽÆ Goal: Remove malware and attacker access

    šŸ“ Why This Matters:
    Remediation eliminates the threat from affected systems: kill malicious processes, delete dropped files, remove persistence mechanisms. Incomplete remediation allows attackers to return.

    šŸ’» Actions:
    1. Click "Remediate" button
    2. Actions:
    • Kill Process - Terminate malware
    • Delete File - Remove malicious files
    • Remove Registry Key - Clear persistence
    3. Apply to affected endpoints
    4. Click "Execute Remediation"

    šŸ” Remediation Checklist:
    • Terminate malicious processes
    • Delete malware files
    • Remove scheduled tasks
    • Clean registry persistence
    • Reset compromised credentials
    šŸŽ“ Verify: After remediation, re-scan to confirm threats are fully removed.
  7. Step 7: Create Detection Rule
    šŸŽÆ Goal: Prevent recurrence with custom detection

    šŸ“ Why This Matters:
    Every incident teaches what to detect. Creating custom rules based on observed TTPs catches the same attack if it recurs. This turns reactive response into proactive defense.

    šŸ’» Actions:
    1. Click "Create Rule" button
    2. Rule Name: Suspicious PowerShell Download
    3. Detection Logic:
    • Process: powershell.exe
    • Command contains: DownloadString
    4. Action: Alert + Block
    5. Click "Save Rule"

    šŸ” Rule Types:
    • Behavioral - Suspicious activity patterns
    • Signature - Known malware indicators
    • Anomaly - Deviation from baseline
CrowdDefense EDR ConsoleBankCorp - Threat Response

Active Alerts

Critical: 3

High: 7

Medium: 12

Endpoints

Total: 247

Online: 231

Isolated: 0

Hunt Results

Matches: -

Last Hunt: Never

Response Status

Isolated: 0

Remediated: 0

Rules Created: 0

Activity Log
TimestampActionDetailsStatus
No activity yet
Progress: 0/7
Score: 0/100