Incident Response & Malware Analysis

πŸ“ Concept Note β€” DFIR Unit V | Source: MCA Sem III Syllabus


Incident Response Lifecycle β€” NIST SP 800-61

Phase 1: Preparation

  • Build IR team, define roles and responsibilities
  • Deploy detection tools (SIEM, EDR, IDS)
  • Create IR playbooks for common scenarios
  • Conduct tabletop exercises and drills
  • Maintain contact lists (legal, management, law enforcement)
  • Prepare forensic workstations and jump bags

Phase 2: Detection & Analysis

  • Monitor alerts from SIEM, IDS, EDR, user reports
  • Triage alerts: true positive vs false positive
  • Determine scope: which systems, which data
  • Classify severity (Critical/High/Medium/Low)
  • Preserve volatile evidence immediately

Phase 3: Containment

  • Short-term: Isolate affected system (disconnect from network)
  • Long-term: Apply temporary fixes while preparing eradication
  • Decisions: shut down vs keep running for evidence collection
  • Block attacker IPs at firewall, disable compromised accounts

Phase 4: Eradication

  • Remove malware, backdoors, unauthorised accounts
  • Patch the exploited vulnerability
  • Reset all potentially compromised credentials
  • Verify removal with forensic analysis

Phase 5: Recovery

  • Restore systems from clean backups or rebuild
  • Monitor closely for signs of re-infection
  • Gradual return to production (phased approach)
  • Validate all systems are functioning correctly

Phase 6: Post-Incident Activity (Lessons Learned)

  • Conduct lessons-learned meeting
  • Update IR playbooks and detection rules
  • Document entire incident timeline
  • Improve defences based on findings
  • Share IoCs with relevant communities

How Forensics Integrates with IR

Incident Detected β†’ Preserve Evidence β†’ Forensic Analysis β†’ Understand Attack
        ↓                                        ↓
   Containment ←──── Intelligence from forensics
        ↓
   Eradication (informed by forensic findings)
        ↓
   Recovery β†’ Monitoring β†’ Post-Incident Report

First Responder Responsibilities

  1. Don’t panic β€” Follow the playbook
  2. Document everything β€” Time, actions taken, observations
  3. Preserve volatile data β€” RAM capture before shutdown
  4. Don’t modify evidence β€” Use write blockers, forensic images
  5. Isolate, don’t power off β€” Network disconnect vs shutdown (depends on scenario)
  6. Escalate β€” Notify IR team lead, management, legal (as required)
  7. Maintain chain of custody β€” Every evidence item documented

Malware Analysis (Introduction)

Static vs Dynamic Analysis

AspectStatic AnalysisDynamic Analysis
MethodExamine without executingExecute in controlled environment
Toolsstrings, file, PE viewers, disassemblersSandboxes, debuggers, API monitors
RiskNone (malware not executed)Must be sandboxed
FindsStrings, imports, structure, signaturesBehaviour, network connections, file changes

Static Analysis Steps

# 1. Check file type
file suspicious.exe
 
# 2. Calculate hash (check VirusTotal)
sha256sum suspicious.exe
 
# 3. Extract readable strings
strings suspicious.exe | grep -i "http\|password\|cmd\|shell"
 
# 4. Check PE headers (Windows)
# Use PEview, pestudio, or readpe

Dynamic Analysis Tools

ToolTypeUse
Cuckoo SandboxAutomated sandboxExecute malware, generate report
Any.RunCloud sandboxInteractive analysis
Flare VMWindows analysis VMFull RE toolkit
Process MonitorReal-time monitoringFile/registry/process activity
WiresharkNetwork captureMalware’s network communication

Ransomware Case Study Approach

  1. Identify ransomware family β€” ransom note, file extension, hash lookup
  2. Determine encryption β€” reversible or not?
  3. Check for decryptor β€” nomoreransom.org
  4. Preserve encrypted files β€” may be decryptable later
  5. Find initial access vector β€” phishing email, RDP brute force, vulnerability
  6. Timeline reconstruction β€” when did infection start, what spread where

Forensic Report Writing

Report Structure

SectionContent
Case DetailsCase number, date, examiner, requesting authority
Chain of CustodyEvidence items, who handled them, hashes
Scope & MethodologyWhat was examined, which tools were used
Tools UsedTool name + version (important for validation)
Findings TimelineChronological events with timestamps and evidence sources
Detailed FindingsEach artefact: location, timestamp, significance
ConclusionWhat happened based on evidence
RecommendationsPrevent recurrence
AppendixHash values, chain of custody forms, raw data

Writing for Different Audiences

AudienceStyle
Technical teamDetailed, include commands, registry paths, log entries
ManagementHigh-level summary, business impact, recommendations
Legal/CourtPrecise language, no assumptions, evidence-backed statements

Key Principles

  • State facts, not opinions β€” β€œThe log shows…” not β€œI think…”
  • Cite evidence β€” Every finding must reference specific artefact
  • Be objective β€” Present what evidence shows, not what you want it to show
  • Document limitations β€” What couldn’t be determined and why

Expert Witness Basics

  • Forensic examiners may be called as expert witnesses in court
  • Must explain technical findings in plain language
  • Affidavit β€” Written sworn statement of findings
  • Must be prepared to defend methodology under cross-examination

TrendImpact on Forensics
AI in forensicsAutomated timeline analysis, anomaly detection in large datasets
Anti-forensic techniquesLog wiping, timestamp manipulation, encryption, steganography
IoT forensicsSmart home devices, wearables β€” new evidence sources
Cloud-native forensicsServerless, containers β€” ephemeral evidence
DeepfakesDigital evidence authenticity challenges

Notable Cybercrime Cases

Indian Cases

  • Bazee.com case (2004) β€” CEO arrested for obscene content listed on platform
  • Pune Cosmos Bank heist (2018) β€” β‚Ή94 crore stolen via malware on ATM switch server
  • Domino’s India data breach (2021) β€” 180 million order details leaked

International Cases

  • Sony Pictures hack (2014) β€” North Korean attackers (attribution via forensic evidence)
  • WannaCry (2017) β€” Global ransomware, attributed to Lazarus Group
  • SolarWinds (2020) β€” Supply chain compromise discovered via forensic analysis