| name | forensic-analysis |
| description | Digital forensic analysis skill for investigating disk images, memory dumps, PCAPs, malware, and system artifacts. Use this skill whenever the user needs to perform forensic analysis on any digital evidence including disk images, memory dumps, network captures, suspicious files, or when investigating security incidents. Trigger this skill for any forensic investigation, incident response, malware analysis, or digital evidence examination tasks. |
Digital Forensic Analysis
A comprehensive skill for performing digital forensic investigations across multiple evidence types and platforms.
When to Use This Skill
Use this skill when you need to:
- Analyze disk images or file system artifacts
- Investigate memory dumps for malicious activity
- Examine network captures (PCAP files)
- Perform malware analysis on suspicious files
- Conduct incident response investigations
- Recover deleted or hidden files
- Analyze browser artifacts and user activity
- Detect anti-forensic techniques
- Perform threat hunting and file integrity monitoring
Forensic Investigation Workflow
Follow this systematic approach for forensic investigations:
1. Evidence Acquisition and Preservation
Before analysis begins:
- Create forensic copies (never work on original evidence)
- Calculate and document hash values (MD5, SHA1, SHA256)
- Maintain chain of custody documentation
- Use write-blockers when acquiring disk images
Image acquisition commands:
dd if=/dev/sdX of=image.img bs=4M status=progress
md5sum image.img
sha256sum image.img
dd if=/dev/sdX of=image.sparse.img bs=4M conv=sparse
2. Initial Image Inspection
Identify file system and partitions:
fdisk -l image.img
file image.img
parted image.img print
mount -o ro,loop image.img /mnt/forensics
File system analysis:
ddrescue image.img recovered.img
extundelete image.img --restore-all
tools/ntfs-3g mount -o ro image.img /mnt/forensics
foremost -i image.img -o ./recovered/
scalpel -c /etc/scalpel/scalpel.conf image.img
3. Platform-Specific Artifact Analysis
Windows Forensics:
- Registry hives (SAM, SYSTEM, SOFTWARE, NTUSER.DAT)
- Event logs (Security, System, Application)
- Prefetch files (program execution history)
- Shellbags (folder access history)
- USN Journal (NTFS change tracking)
- Browser artifacts (history, cookies, cache)
- Windows Event Forwarding logs
Linux Forensics:
- /var/log/ (auth.log, syslog, kern.log)
- /var/lib/dpkg/status (installed packages)
- /var/log/apt/history.log (package changes)
- Bash history files (.bash_history)
- Cron jobs and scheduled tasks
- SSH keys and authorized_keys
- Docker container artifacts
iOS Forensics:
- iTunes backup analysis
- SQLite database extraction
- Keychain analysis
- App sandbox examination
4. Malware Analysis
Static Analysis:
file suspicious_file
strings suspicious_file | grep -i "http"
md5sum suspicious_file
sha256sum suspicious_file
pefile suspicious.exe
extract_strings.exe suspicious.exe
Dynamic Analysis (in isolated environment):
- Monitor process creation
- Track file system changes
- Log network connections
- Capture registry modifications
- Analyze memory behavior
5. Memory Dump Analysis
Extract and analyze memory:
volatility -f memory.dump imageinfo
volatility -f memory.dump --profile=Win7SP1x64 pslist
volatility -f memory.dump --profile=Win7SP1x64 netscan
volatility -f memory.dump --profile=Win7SP1x64 malfind
volatility -f memory.dump --profile=Win7SP1x64 dumpmap -p <PID>
volatility -f memory.dump --profile=Win7SP1x64 scansmem
Key memory artifacts:
- Process lists and parent-child relationships
- Network connections and sockets
- Loaded modules and DLLs
- Command line arguments
- Clipboard contents
- Encrypted keys and credentials
6. Network Capture (PCAP) Analysis
Examine network traffic:
tshark -r capture.pcap -q -z io,phs
tshark -r capture.pcap -Y "http"
tshark -r capture.pcap -Y "dns"
tshark -r capture.pcap -Y "http.file_data" -T fields -e http.file_data > extracted_files
tshark -r capture.pcap -Y "dns.qry.name" -T fields -e dns.qry.name | sort | uniq -c | sort -rn
tshark -r capture.pcap -Y "tcp.flags.syn==1" -T fields -e ip.dst -e tcp.dstport
Key network artifacts:
- DNS queries and responses
- HTTP requests and responses
- Malicious IP addresses and domains
- Data exfiltration patterns
- Command and control communications
7. Anti-Forensic Detection
Watch for these techniques:
- File carving to recover deleted data
- Slack space analysis for hidden content
- Timestamp manipulation detection
- Log file tampering indicators
- Encryption and steganography detection
- Rootkit and driver analysis
- Memory-only malware detection
Detection commands:
touch -r reference_file target_file
dd if=image.img bs=512 skip=100 count=1 | xxd
fdisk -l image.img | grep -i "hidden"
8. Threat Hunting and File Integrity
Monitor for suspicious activity:
aide --check
tripwire --check
find / -type f -mtime -7 -ls
find / -type f -perm -4000 -ls
auditctl -w /etc/passwd -p wa -k passwd_changes
Browser Artifact Analysis
Chrome/Chromium:
sqlite3 ~/.config/google-chrome/Default/History \
"SELECT url, title, last_visit_time FROM urls ORDER BY last_visit_time DESC LIMIT 100;"
sqlite3 ~/.config/google-chrome/Default/Cookies \
"SELECT host_key, name, encrypted_value FROM cookies;"
Firefox:
sqlite3 ~/.mozilla/firefox/*.default/places.sqlite \
"SELECT url, title, visit_count FROM moz_places ORDER BY last_visit_date DESC LIMIT 100;"
Reporting and Documentation
Always document:
- Evidence collection methods and timestamps
- Hash values for all evidence files
- Tools and versions used
- Commands executed and their output
- Findings and conclusions
- Chain of custody records
Report structure:
# Forensic Investigation Report
## Executive Summary
- Brief overview of investigation
- Key findings
- Recommendations
## Methodology
- Tools used
- Procedures followed
- Timeline of analysis
## Evidence Analysis
- Detailed findings by category
- Supporting artifacts
- Screenshots and logs
## Conclusions
- Summary of findings
- Confidence levels
- Next steps
## Appendices
- Hash values
- Raw data extracts
- Tool outputs
Best Practices
- Never modify original evidence - Always work on copies
- Document everything - Maintain detailed logs of all actions
- Verify tool integrity - Hash all forensic tools before use
- Use write-blockers - Prevent accidental evidence modification
- Validate findings - Cross-reference multiple data sources
- Maintain chain of custody - Track evidence handling
- Follow legal requirements - Ensure proper authorization
- Preserve timestamps - Use UTC and document time zones
Common Tools Reference
| Category | Tools |
|---|
| Disk Imaging | dd, ddrescue, FTK Imager |
| File System | extundelete, photorec, foremost |
| Memory Analysis | Volatility, Rekall |
| Network Analysis | Wireshark, tshark, tcpdump |
| Malware Analysis | Ghidra, IDA Pro, PEStudio |
| Windows Forensics | Eric Zimmerman's tools, Plaso |
| Linux Forensics | Autopsy, Sleuth Kit |
| Hashing | md5sum, sha256sum, hashdeep |
Quick Reference Commands
md5sum -c hashes.txt
file -b suspicious_file
strings suspicious_file | grep -i "password"
xxd -l 512 image.img
grep -r "suspicious_pattern" /mnt/forensics/
grep -oE '[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}' file.txt
grep -oE '\b([0-9]{1,3}\.){3}[0-9]{1,3}\b' file.txt
Safety Warnings
⚠️ Critical Reminders:
- Always mount forensic images as read-only
- Never run unknown executables on your analysis system
- Use isolated environments for malware analysis
- Verify tool integrity before use
- Follow organizational policies and legal requirements
- Maintain proper authorization documentation