# Capture volatile data first (order matters!)
date -u > $FORENSIC_DIR/timestamp.txt
uptime > $FORENSIC_DIR/uptime.txt
who -a > $FORENSIC_DIR/logged_users.txt
w > $FORENSIC_DIR/user_activity.txt
ps auxwww > $FORENSIC_DIR/processes.txt
pstree -p > $FORENSIC_DIR/process_tree.txt
netstat -antup > $FORENSIC_DIR/network_connections.txt
ss -tunap > $FORENSIC_DIR/socket_stats.txt
lsof -i -n -P > $FORENSIC_DIR/open_files_network.txt
cat /proc/meminfo > $FORENSIC_DIR/memory_info.txt
free -m > $FORENSIC_DIR/memory_usage.txt
df -h > $FORENSIC_DIR/disk_usage.txt
mount > $FORENSIC_DIR/mounted_filesystems.txt
lsmod > $FORENSIC_DIR/loaded_modules.txt
env > $FORENSIC_DIR/environment_vars.txt
3. Timeline Reference
timezone-sync.sh
# Document timezone and NTP status
timedatectl > $FORENSIC_DIR/time_config.txt
cat /etc/timezone >> $FORENSIC_DIR/time_config.txt
ntpq -p 2>/dev/null >> $FORENSIC_DIR/time_config.txt
chronyc tracking 2>/dev/null >> $FORENSIC_DIR/time_config.txt
# Get hardware clock
hwclock --show >> $FORENSIC_DIR/time_config.txt
# All timestamps should be in UTC for consistency
export TZ=UTC