9.4 KiB
title, description, difficulty, duration, prerequisites, tags
| title | description | difficulty | duration | prerequisites | tags | |||||
|---|---|---|---|---|---|---|---|---|---|---|
| Lab 3: Digital Forensics and Incident Response | Learn digital forensics techniques to investigate security incidents and analyze evidence | Advanced | 120 minutes | Understanding of file systems, basic scripting, and incident response procedures |
|
Objectives
By the end of this lab, you will be able to:
- Create forensically sound disk images
- Analyze volatile memory dumps for indicators of compromise
- Extract and examine digital artifacts from compromised systems
- Document findings following proper chain of custody procedures
- Use industry-standard forensics tools and techniques
Prerequisites
- Understanding of file systems (NTFS, FAT, ext4)
- Basic knowledge of Windows and Linux operating systems
- Familiarity with command-line tools
- Understanding of incident response procedures
Lab Environment Setup
-
Forensics Workstation
- Kali Linux or SIFT (SANS Investigative Forensics Toolkit)
- Volatility Framework
- Autopsy or Sleuth Kit
- dc3dd or dd for imaging
-
Evidence Files
- Sample memory dump (provided)
- Disk image of compromised system
- Network packet captures (PCAP files)
-
Documentation Tools
- Case management system or documentation template
- Hash verification tools (md5sum, sha256sum)
Exercise 1: Memory Analysis
Step 1: Memory Dump Analysis Setup
-
Install Volatility
git clone https://github.com/volatilityfoundation/volatility.git cd volatility python setup.py install -
Verify Memory Dump
# Calculate hash for chain of custody sha256sum memory_dump.vmem # Identify the memory dump profile python vol.py -f memory_dump.vmem imageinfo
Step 2: Process Analysis
Analyze running processes in the memory dump:
# List all processes
python vol.py -f memory_dump.vmem --profile=Win7SP1x64 pslist
# Show process tree
python vol.py -f memory_dump.vmem --profile=Win7SP1x64 pstree
# Find hidden processes
python vol.py -f memory_dump.vmem --profile=Win7SP1x64 psxview
Questions:
- What suspicious processes are running?
- Are there any processes that seem out of place?
- Which processes are hidden from normal detection?
Step 3: Network Connections
Examine network activity:
# Show network connections
python vol.py -f memory_dump.vmem --profile=Win7SP1x64 netscan
# Display network statistics
python vol.py -f memory_dump.vmem --profile=Win7SP1x64 netstat
Questions:
- What external connections were established?
- Are there any suspicious IP addresses or ports?
- Which processes initiated network connections?
Step 4: Malware Detection
Look for indicators of malware:
# Scan for malware
python vol.py -f memory_dump.vmem --profile=Win7SP1x64 malfind
# Check for code injection
python vol.py -f memory_dump.vmem --profile=Win7SP1x64 hollowfind
# Examine suspicious processes
python vol.py -f memory_dump.vmem --profile=Win7SP1x64 procdump -p [PID] -D output/
Questions:
- What malware indicators were found?
- Which processes show signs of code injection?
- Can you extract malware samples for further analysis?
Exercise 2: Disk Forensics
Step 1: Creating Forensic Images
Create a forensically sound image of the evidence disk:
# Create disk image with verification
dc3dd if=/dev/sdb of=evidence_disk.img hash=sha256 log=imaging.log
# Alternative with dd
dd if=/dev/sdb of=evidence_disk.img bs=4096 conv=noerror,sync
sha256sum evidence_disk.img > evidence_disk.img.sha256
Step 2: File System Analysis
Mount and analyze the disk image:
# Mount as read-only
mkdir /mnt/evidence
mount -o ro,loop evidence_disk.img /mnt/evidence
# Analyze with Sleuth Kit
fls -r evidence_disk.img > file_listing.txt
mactime -b file_listing.txt > timeline.txt
Questions:
- What file systems are present on the disk?
- When was the system last accessed?
- Are there any deleted files of interest?
Step 3: Artifact Recovery
Search for specific artifacts:
# Search for specific files
grep -r "password" /mnt/evidence/
find /mnt/evidence -name "*.log" -type f
# Extract browser history
firefox_history_extractor.py /mnt/evidence/Users/*/AppData/
# Examine registry files (Windows)
regripper -r /mnt/evidence/Windows/System32/config/SOFTWARE -p software
Questions:
- What user activity artifacts were found?
- Are there any credentials or sensitive data?
- What applications were recently used?
Exercise 3: Timeline Analysis
Step 1: Create System Timeline
Generate a comprehensive timeline:
# Create super timeline with log2timeline
log2timeline.py --storage-file timeline.plaso evidence_disk.img
# Convert to readable format
psort.py -o dynamic timeline.plaso > system_timeline.csv
Step 2: Timeline Filtering
Filter timeline for relevant events:
# Filter by date range
psort.py -o dynamic --slice "2023-01-01,2023-01-31" timeline.plaso
# Filter by keywords
psort.py -o dynamic --strings malware timeline.plaso
Questions:
- What significant events occurred during the incident timeframe?
- Can you identify the initial compromise vector?
- What actions did the attacker take on the system?
Exercise 4: Network Forensics
Step 1: PCAP Analysis
Analyze network traffic captures:
# Basic statistics
capinfos capture.pcap
# Examine protocols
tshark -r capture.pcap -q -z io,phs
# Extract HTTP traffic
tshark -r capture.pcap -Y "http" -T fields -e http.host -e http.uri
Step 2: Suspicious Traffic Detection
Look for indicators of compromise in network traffic:
# Search for suspicious domains
tshark -r capture.pcap -Y "dns" -T fields -e dns.qry.name | sort | uniq
# Examine file transfers
tshark -r capture.pcap -Y "ftp-data" --export-objects ftp,extracted_files/
Questions:
- What suspicious network activity was detected?
- Were any files transferred during the incident?
- Can you identify command and control traffic?
Exercise 5: Report Generation
Step 1: Evidence Documentation
Create proper documentation:
-
Chain of Custody Form
- Date and time of acquisition
- Hash values for verification
- Personnel involved
- Storage location
-
Technical Analysis Report
- Executive summary
- Methodology used
- Key findings
- Supporting evidence
Step 2: Indicators of Compromise (IOCs)
Document IOCs for threat intelligence:
- File hashes (MD5, SHA-1, SHA-256)
- IP addresses and domains
- Registry keys
- File paths
- Network signatures
Case Study: Putting It All Together
Scenario
A company reports that their web server has been compromised. You have been provided with:
- Memory dump from the server
- Disk image of the web server
- Network traffic logs
- System event logs
Investigation Steps
-
Initial Triage
- Verify evidence integrity
- Identify the scope of compromise
- Preserve volatile data
-
Deep Analysis
- Memory analysis for running threats
- Disk forensics for persistence mechanisms
- Timeline reconstruction
- Network analysis for data exfiltration
-
Reporting
- Document all findings
- Provide remediation recommendations
- Create IOCs for monitoring
Advanced Challenges
- Encrypted Evidence: Analyze encrypted disk images
- Anti-Forensics: Investigate systems with anti-forensics tools
- Mobile Forensics: Extend techniques to mobile devices
- Cloud Forensics: Analyze cloud-based incidents
Tools Reference
Memory Analysis
- Volatility Framework
- Rekall
- WinDbg
Disk Forensics
- Autopsy
- Sleuth Kit
- EnCase
- FTK
Network Forensics
- Wireshark
- NetworkMiner
- Moloch
Reporting
- CaseFile
- Maltego
- Custom scripts
Best Practices
-
Evidence Handling
- Always work with copies
- Maintain chain of custody
- Document everything
- Use write-blockers for physical media
-
Analysis Methodology
- Follow established procedures
- Use multiple tools for verification
- Document all steps taken
- Preserve original evidence
-
Reporting
- Use clear, non-technical language for executives
- Include technical details for IT teams
- Provide actionable recommendations
- Support findings with evidence
Resources
- SANS Digital Forensics and Incident Response
- Volatility Documentation
- Sleuth Kit Documentation
- NIST Computer Forensics Guidelines
Conclusion
This lab provided comprehensive experience in digital forensics and incident response. You learned to analyze memory dumps, perform disk forensics, create timelines, and document findings properly. These skills are essential for investigating security incidents and providing evidence for legal proceedings.
Key takeaways:
- Proper evidence handling is crucial for legal admissibility
- Multiple analysis techniques provide comprehensive understanding
- Timeline analysis helps reconstruct incident sequences
- Documentation must be thorough and accurate
- Continuous learning is essential as attack techniques evolve
Always ensure you have proper authorization and follow legal requirements when conducting forensic investigations!