Digital Forensics - practical teams
The most commonly used Windows, Linux and macOS commands to collect evidence, view network data and logs. Above - simple diagrams of how the investigation is going. Only for training and authorised investigation.
Sequence of evidence
Order of Volatility (RFC 3227) - collect the most volatile first
Application
At the beginning of the incident helps to decide what to collect first. The higher the list, the faster the data disappears - the RAM disappears, turning off the computer. Connections change in seconds.
Reference
IETF RFC 3227 (2002) - Guidelines for Evidence Collection and Archiving · NIST SP 800-86 · ISO/IEC 27037.
Safety Note
The computer disables the RAM (processes, encryption keys, malware memory). If you can, read the memory first and then disconnect the current.
Lifecycle Response for Incidents
NIST SP 800-61 (4 phases) ↔ SAN PICERL (6 steps)
Application
Helps to arrange how to react to an incident. NIST 4 phases are consistent with 6 steps of SANS PICERL - evidence is collected and analysed in the second phase.
Reference
NIST SP 800-61 Rev. 2 · SANS PICERL · ISO/IEC 27035 (Incident management).
NIS2 deadlines
NIS2 p. 23: Early warning 24 hours, full message 72 hours. Forensics findings give content to these reports in CERT.LV.
Where evidence is found
Evidence Source Map - Windows / Linux / macOS
Application
Quickly find where concrete evidence is in each system and which team to get it. The full arguments are set out in the table below.
Reference
SANS DFIR artefact references · MITRE ATT&CK - Collection (TA0009) · Windows / Linux forensics references.
Safety Note
Always record the system time zone and clock shift - without it, it is not possible to correct events in order (UTC or local time).
Generation and integrity flow
Chain of Customs - the original never be modified
Application
It shall be ensured that the evidence can be used in court - proof of where it comes from and that it has not been changed.
Reference
ISO/IEC 27037 (Identification, collection, acquistion, conservation) · NIST SP 800-86 · ACPO Good Practice Guide.
Safety Note
The addition of Write-Blocker or read-only does not allow for random writing in the original. Only the verified copy, not the original, shall always be analysed.
Where to look for typical traces
Artefact roads - folders and files (Windows / Linux)
Windows
C:\Windows\Prefetch\*.pf
C:\Windows\AppCompat\Programs\Amcache.hve
C:\Windows\System32\sru\SRUDB.dat
C:\Windows\System32\config\ (SAM·SYSTEM·SOFTWARE·SECURITY)
%USERPROFILE%\NTUSER.DAT
%LOCALAPPDATA%\Microsoft\Windows\UsrClass.dat
C:\Windows\System32\winevt\Logs\*.evtx
C:\$MFT
C:\$Extend\$UsnJrnl:$J
C:\$LogFile
%APPDATA%\Microsoft\Windows\Recent\ (LNK · Jump Lists)
%LOCALAPPDATA%\Google\Chrome\User Data\Default\History
C:\Windows\System32\Tasks\
%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup\
C:\pagefile.sys · C:\hiberfil.sys
%LOCALAPPDATA%\Temp\ · C:\Windows\Temp\
√ Linux / Unix
/var/log/auth.log · /var/log/secure
/var/log/syslog · /var/log/messages
/var/log/audit/audit.log
/var/log/journal/
/var/log/wtmp · /var/log/btmp · /run/utmp
/var/log/lastlog
~/.bash_history · ~/.zsh_history
~/.ssh/authorized_keys · ~/.ssh/known_hosts
/etc/passwd · /etc/shadow · /etc/group
/etc/sudoers · /etc/sudoers.d/
/etc/crontab · /var/spool/cron/ · /etc/cron.d/
/etc/systemd/system/ · /usr/lib/systemd/system/
/etc/rc.local · /etc/init.d/
/tmp · /var/tmp · /dev/shm
/proc/PID/{cmdline,exe,maps,fd}
/var/log/dpkg.log · /var/log/apt/ · /var/log/yum.log
√ macOS
/var/db/diagnostics/*.tracev3
/var/log/system.log (legacy)
/var/log/install.log
~/Library/LaunchAgents/
/Library/LaunchAgents/ · /Library/LaunchDaemons/
/System/Library/LaunchDaemons/
~/Library/Preferences/*.plist
~/.zsh_history · ~/.bash_history
~/Library/Safari/History.db
/var/db/dslocal/nodes/Default/users/*.plist
/Library/Preferences/com.apple.loginwindow.plist
…/com.apple.LaunchServices.QuarantineEventsV2
xattr com.apple.quarantine
/.fseventsd/
/.Spotlight-V100/
/tmp · /var/tmp · /private/tmp
Application
Quick return in which folders and files to search for the most common evidence. Good start for triage and KAPE/CyLR goals.
Reference
SANS DFIR √Windows Forensic Analysis-poster · MITRE ATT&CK · Linux forensics reference.
Safety Note
Roads with % are variables which differ for each user. Test all user profiles, not just current.
| Command | Category | OS | Description | Main arguments |
|---|