SlideShare a Scribd company logo
Forensic Artifacts in Modern Linux Systems
Prof. Dr. Bruce Nikkel
M
Division of Computer Science September 10, 2018
Purpose and Scope of Workshop
Describe things of forensic interest, show how to find and extract data from:M
hacked/compromised Linux servers
M
criminal operated Linux servers (Command and Control)
M
abused/misused Linux desktop systems (suspect users, victim users)
M
seized and imaged systems (dead disk forensics)
M
focus on modern Linux system artifacts (systemd, etc.)
M
focus on artifacts independent of Linux distribution
*Not* the focus of this workshop:
M
using Linux as an analysis platform (most of this analysis can also be done
with encase/ftk/xways)
M
how to use Linux based forensic tools
M
live Linux system analysis and memory forensics
M
Linux based mobile devices (Android)
M
Application artifacts (browser, email, office, etc)
This is not exhaustive, there are many OS artifacts not covered here
(obscure/rare artifacts, distro specific artifacts, etc.)
Bern University of Applied Sciences 2/24
Overview of Workshop
High level overview of workshop topics (from a forensic/investigative
perspective):
M
partitions and filesystems
M
mbr/uefi, grub, initrd/initramfs
M
linux file/directory layout
M
systemd: boot/shutdown, services, scheduled tasks
M
installed software and packages
M
log files and systemd journal
M
swap, cache, and persistent data
M
system and user configuration
M
desktop artifacts
M
encryption and steganography
M
conclusion
Workshop format: mix of theory/slides and demonstrations
Example disk images are shown as either "image.dd" or "/dev/sda"
Bern University of Applied Sciences 3/24
Partitions and Filesystems
Examples of typical storage devices:M
SATA drives: /dev/sda
M
NVME drives: /dev/nvme0n1
M
MMC/SD cards: /dev/mmcblk0
M
(Virtual Machine: /dev/vda)
Examples of typical partition devices:
M
/dev/sda1
M
/dev/nvme0n1p1
M
/dev/mmcblk0p1
M
(/dev/vda1)
Most common partition schemes are DOS and GPT
M
disktype /dev/sda
M
mmls image.dd
M
UEFI systems have GPT layout and use a system partition with a FAT
filesystem for EFI boot files
Bern University of Applied Sciences 4/24
Partitions and Filesystems
Some examples of filesystems used by modern Linux:M
typical for installation: ext4, btrfs, xfs
M
many others supported: fat, ntfs, ext2, ext3
M
network filesystems: nfs, samba/cifs, sshfs
M
pseudo filesystems: proc, sys, dev
Interesting artifacts about an EXT4 filesystem:
M
when the filesystem was created
M
last mounted, last written, last checked
M
number of times mounted
M
last repaired
M
tune2fs -l /dev/sda1
M
fsstat /dev/sda1
Network and Virtual filesystems are interesting in live system analysis, less for
dead disk analysis (but we can try to find out some things, like when/where
they were mounted)
Bern University of Applied Sciences 5/24
Partitions and Filesystems
The SleuthKit ("TSK") has filesystem analysis tools for:M
listing and extracting files, inodes, blocks
M
identifying and extracting deleted files
M
building timelines (MACB timestamps)
M
extracting slack and unallocated areas for analysis
M
other filesystem artifacts (journaling filesystems,etc.)
All the TSK commands grouped by function:
M
Partition/volume analysis: mmcat, mmls, mmstat, fsstat, img_cat,
img_stat
M
Analyzing by blocks/sectors: blkcalc, blkcat, blkls, blkstat
M
Analyzing by inodes: icat, ifind, ils, istat, tsk_recover
M
Analyzing by filename: fcat, ffind, fls, fiwalk
M
Journaling filesystems: jcat, jls, usnjls
M
Timelines: mactime, tsk_gettimes
M
Search and sort: jpeg_extract, sigfind, sorter, srch
strings, tsk_comparedir, hfind, tsk_loaddb
These commands work on: attached devices, raw images (dd), and forensic
images (EnCase/FTK).
Bern University of Applied Sciences 6/24
MBR/UEFI, Grub, initrd/initramfs
MBR - 512 byte boot sector, jumps to next stage loaderM
can analyze boot sector for possible malware (boot sector viruses are rare
today)
M
dd if=image.dd of=bootsector.dd bs=512 count=1
UEFI - FAT system partition with files, more intelligent boot loading
M
look for unusual efi binaries
M
if you have access to mainboard, get UEFI variables stored in NVRAM
Grub artifacts (GRand Unified Bootloader)
M
/boot/grub/grub.cfg or /boot/grub2/grub.cfg
M
/etc/grub.d/* or /etc/default/grub
M
can show list of previous OS installations, kernel parameters used, etc.
Kernel ramdisk (initrd or initramfs)
M
debian: lsinitramfs -l /initrd.img
M
fedora: lsinitrd -v /boot/initramfs-4.16.11-100.fc26.x86_64.img
M
arch: lsinitcpio -v /boot/initramfs-linux.img
M
suse: lsinitrd /boot/initrd
M
if root filesystem is encrypted, may have interesting cleartext info
Bern University of Applied Sciences 7/24
Linux File System Layout
Directories of interest to forensic investigators:
M
bootstrap configuration /boot (efi partition mounted on /boot/efi)
M
system configs: /etc
M
logs, cache, state: /var (especially /var/lib and /var/log)
M
user data: /home and /root
Some directories are mountpoints for pseudo filesystems:
M
/proc, /sys, /dev, /run
M
not very useful for dead disk forensics
Other tips:
M
be aware of hidden files/dirs (filenames starting with ".")
M
the "FILES" section of manpages can indicate items of potential interest
M
use forensic timelines to identify ’busy’ directories
Bern University of Applied Sciences 8/24
Systemd Boot/Shutdown, Services, Scheduled Tasks
SystemdM
modern Linux system and service manager
M
very consistent across distributions
M
manages starting, stopping, restarting of daemons
Systemd configuration common locations:
M
defaults: /usr/lib/systemd/ or /lib/systemd/
M
custom: /etc/systemd/
M
user: ~/.config/systemd
These directories contain systemd unit files, that configure or control:
M
services and daemons
M
sockets and devices
M
mount points, automount points
M
swap files and swap partitions
M
start-up targets
M
timers (scheduled jobs), watched file system paths
Provides forensic trace information about the system and user configuration
Bern University of Applied Sciences 9/24
Systemd Boot/Shutdown, Services, Scheduled tasks
Examples of things to look for as a forensic investigator:
M
overview of services started on boot
M
proxy and relay daemons
M
strange services that could be backdoors or malcious code
M
vpn tunnels (new: wireguard vpn, this is growing in popularity, look for
/etc/wireguard/, the wg0 interface, or systemd wireguard files)
M
service units for: bitcoin, torrent, tor, tunneled protocols, etc.
Scheduled jobs:
M
traditional cron jobs: /var/spool/cron, /var/spool/anacron,
/etc/cron.*/*, and /etc/crontab
M
traditional at jobs (one time execution): /var/spool/at
M
systemd timers (*.timer files)
M
user and system jobs are separate (for cron and systemd)
Note: there are over 150 manpages describing systemd and various relevant files
Bern University of Applied Sciences 10/24
Installed Software and Packaging
Most popular packaging formats (not consistent across distributions):M
rpm (redhat and suse)
M
apt/deb (debian/ubuntu, etc.)
M
pacman/tar (arch, manjaro)
The interesting forensic artifacts in packaging systems are:
M
list of installed software packages (package databases)
M
removed software packages (install logs, previously downloaded packages)
M
install and removal timestamps
Other packaging systems growing in popularity:
M
snap/snappy
M
flatpacks
Backups and archive files (ok, not packages, but...):
M
tar snar files have a list of deleted, changed, created files from backups
M
tar --show-snapshot-field-ranges
Bern University of Applied Sciences 11/24
Installed Software and Packaging
Debian based systems
M
logs: /var/log/apt/*
M
database: /var/lib/dpkg/* (especially the ’status’ file)
Redhat and SuSe based systems
M
logs: /var/log/dnf.rpm.log*
M
database: /var/lib/rpm/*
Arch pacman based systems
M
arch also has "AUR" or Arch User Repository user
M
database: /var/lib/pacman/local/*/*
M
logs: paclog command, /var/log/pacman.log
Note: users can bypass the packaging system and copies any files anywhere
(’make install’ for example).
Bern University of Applied Sciences 12/24
Log Files and Systemd Journal
Programs and daemons typically log to one of three places:M
traditional syslog (/var/log/messages or /var/log/syslog)
M
systemd journal
M
self written log files (usually in /var/log/*)
Traditional Linux logging:
M
logs can be different levels of verbosity (debug, informational, etc.)
M
a running linux kernel has a ring buffer log (dmesg)
M
applications may separate error logs from transaction logs
M
syslog messages are sent to a syslog daemon and saved to files
Systemd journal has features that are interesting for investigators:
M
better recording of logs during early system initialization
M
stderr output of a daemon is captured
M
logs are stored in a structured binary format that can be filtered, searched,
or exported
M
Forward Secure Sealing (FSS) preserves integrity of the logs (like a
forensic chain of custody)
Bern University of Applied Sciences 13/24
Log Files and Systemd Journal
Journalctl data and commands:
M
location: /var/log/journal/$RANDOMSTRING/*
M
system logs: system@*
M
user logs (with UID): user-1000@*
M
journalctl --root=/location/of/forensic/image/mount/
M
journalctl --file=user-1000@
M
journalctl --directory=/some/directory/with/journal/
Journalctl tips:
M
logged boots: journalctl --list-boots
M
kernel messages: journalctl --dmesg
M
time periods: journalctl --since=2018-09-05 --until=2018-09-06
M
more verbose: journalctl -ax
M
search with "/", n-next, N-previous
Bern University of Applied Sciences 14/24
Log Files and Systemd Journal
What you might find in the logs and systemd journal:
M
attached and mounted USB drives
M
network interfaces and MAC addresses (NetworkManager)
M
dhcp results with IPs addresses (NetworkManager)
M
evidence of malicious activity and attacks (failed logins)
M
successful logins (local and remote) and user sessions
M
reboots, boots, daemon start/stop/restart
M
virtual network interface creation (vpns/tunnels)
M
application/daemon errors and messages
M
user activity (pgp/gpg agent activity)
M
notebook Lid close/open, power cable plugin
Files in /var/log/* are disappearing from use, so learn journalctl
Some systems may not keep a persistent copy of the journal across boots
Most systems still have utmp/wtmp files: last -f /var/log/wtmp
Bern University of Applied Sciences 15/24
Cache, Swap and Persistent data
Desktop systems using NetworkManager cache interesting things:
M
/var/lib/NetworkManager/*
M
dhcp leases and timestamps
M
observed wifi bss ids
Desktop systems with Bluetooth cache interesting things:
M
/var/lib/bluetooth/*
M
paired bluetooth devices
M
file timestamps reveal previous pairing activty
Lots of really great info in /var/lib, often with timestamps:
M
depending on the software installed, all kinds of interesting system
persistence and cached data
M
example: switching from charging to discharging (/var/lib/upower/*)
M
(hint, convert epoch timestamps to human time: date -d @1535347485)
Bern University of Applied Sciences 16/24
Cache, Swap and Persistent data
Temporary files and directoriesM
/tmp and /var/tmp may contain files
M
(but may be deleted after boot or logout)
M
swapfile or swap partition (see /etc/fstab)
If swap is the size of ram or larger, it can be used for hibernation:
M
a hibernating system has a complete memory dump saved to disk
M
check the end of journal to see if the system went into hibernation
M
can be extracted with forensic tools (icat, dd, etc.)
M
memory analysis can be done to find many artifacts:
running processes, established network connections, possibly keys and
passwords
Printers and printed pages
M
attached and configured printers: /etc/cups/*
M
print jobs from cupsd: /var/cache/cups/*
M
/var/spool/cups/* and /var/log/cups/*
Large amounts of cached user data in /home/user/.cache, this contains
application data (photo thumbnails for example)
Bern University of Applied Sciences 17/24
System and User Configuration
System and kernel:M
LSB (Linux Standards Base): /etc/lsb-release or o/etc/os-release
M
kernel version: file vmlinuz
M
kernel config/parameters grub.cfg and /etc/sysctl.*
M
kernel modules: /etc/modprobe*, /etc/modules, /etc/modules-load*
M
startup services/daemons (systemd units)
Systemd network config:
M
default: /usr/lib/systemd/network/ or /lib/systemd/network
M
custom: /etc/systemd/network/
M
also distro specific (debian /etc/network/interfaces)
Crashed programs
M
system may need to be configured to save core files
M
/var/lib/systemd/coredump
M
this is a memory dump of a process: established network connections,
possibly keys and passwords
M
manpage core(5)
Bern University of Applied Sciences 18/24
System and User Configuration
Users and groupsM
traditionally in /etc/passwd and /etc/group
M
some systems may use ldap
M
UID and GID analyzed as filesystem meta data
M
(Sleuthkit: mactime -p /etc/passwd -g /etc/group)
M
users and groups may refer to people or processes
M
difference between system and application activity is not always clear
M
difference between system and user activity is not always clear
OS and user configuration files
M
traditional Unix/Linux files in /etc
M
gconf/dconf, systemd units
M
dot files ~/.*
M
dot files ~/.config/*
M
user customized shells (.bashrc) and shell history
M
each distro may have additional configuration artifacts that are interesting
Bern University of Applied Sciences 19/24
Desktop Artifacts
Freedesktop.org (formerly known as: X Desktop Group or XDG)
M
XDG documentation and specifications at freedesktop.org
M
Provides compatibility across distros and desktop environments
M
KDE and Gnome most popular DEs
Key directories interesting to forensic investigators:
M
systemd unit files for XDG: /etc/xdg/systemd
M
$XDG_DATA_HOME, default ~/.local/share
M
$XDG_CONFIG_HOME, default ~/.config
M
$XDG_CACHE_HOME, default ~/.cache
M
contains user’s GUI data and configuration
M
(there are also system-wide equivalent defaults)
Bern University of Applied Sciences 20/24
Desktop Artifacts
Interesting things we find here:M
autostarting GUI apps ~/.config/autostart/*
M
contents of user’s desktop: ~/Desktop (contains Desktop entry files)
M
recently opened docs: ~/.recently-used or ~/local/share/recently-used.xbel
M
thumbnails ~/.cache/thumbnails
M
"Trash" ~/.local/share/Trash or ~/.Trash
M
User override default apps: ~/.config/mimeapps.list
M
application downloads: ~/Downloads
Other notes
M
often 2 sets of timestamps: filesystem (MACB) and timestamps inside the
files
M
These directories and filenames may vary depending on the desktop and
XDG variables
M
X11 vs Wayland? These both operate below the XDG/freedesktop.org
Environment, so it should (mostly) not matter
Bern University of Applied Sciences 21/24
Encryption and Steganography
Forensic examiners will find different types of encryption:
M
application file encryption - protected PDF, office docs, etc
M
individual file containers - GPG, Encrypted Zip
M
directories - ecryptfs, ext4 encrypted sub-directories
M
volumes - TrueCrypt/Veracrypt
M
block devices - Linux LUKS
M
drive hardware - OPAL/SED
Decrypting requires:
M
password or passphrase
M
cryptographic key string or key file
M
smartcard or hard token
The forensic challenge is to find the decryption key
(some tools: John the Ripper, HashCat, bulk_extractor, $5 wrench)
Bern University of Applied Sciences 22/24
Encryption and Steganography
Steganography is considered a part of anti-forensics
M
It hides data in non-obvious places
M
least significant bits of color, sound, etc.
M
tries to hide data in different slack areas
M
Veracrypt allows hiding volumes inside volumes
Some tools:
M
stegdetect
M
stegsnow
M
openstego
M
busysteg
M
gsteg
M
photocrypt
Bern University of Applied Sciences 23/24
Conclusion
M
Thanks for listening!
M
If you know some additional Linux forensic artifacts not mentioned, please
send them to me, I’ll add them to my slides.
M
Law Enforcement: You are welcome to contact me at BFH for Linux
analysis support.
M
Contact details: bruce.nikkel@bfh.ch
M
These slides are available at: digitalforensics.ch
Bern University of Applied Sciences 24/24

More Related Content

What's hot

Windows Registry Analysis
Windows Registry AnalysisWindows Registry Analysis
Windows Registry Analysis
Himanshu0734
 
Digital Forensic: Brief Intro & Research Challenge
Digital Forensic: Brief Intro & Research ChallengeDigital Forensic: Brief Intro & Research Challenge
Digital Forensic: Brief Intro & Research Challenge
Aung Thu Rha Hein
 
Accessing Forensic Images
Accessing Forensic ImagesAccessing Forensic Images
Accessing Forensic ImagesCTIN
 
Mobile Forensics
Mobile ForensicsMobile Forensics
Mobile Forensics
primeteacher32
 
Computer Forensics & Windows Registry
Computer Forensics & Windows RegistryComputer Forensics & Windows Registry
Computer Forensics & Windows Registrysomutripathi
 
Disk forensics
Disk forensicsDisk forensics
Disk forensics
Chiawei Wang
 
IBM QRadar WinCollector - Managed Vs Stand Alone
IBM QRadar  WinCollector - Managed Vs Stand AloneIBM QRadar  WinCollector - Managed Vs Stand Alone
IBM QRadar WinCollector - Managed Vs Stand Alone
Muhammad Abdel Aal
 
Operating System Forensics
Operating System ForensicsOperating System Forensics
Operating System Forensics
ArunJS5
 
Anti-Forensics: Real world identification, analysis and prevention
Anti-Forensics: Real world identification, analysis and preventionAnti-Forensics: Real world identification, analysis and prevention
Anti-Forensics: Real world identification, analysis and prevention
Seccuris Inc.
 
Mobile Forensics
Mobile Forensics Mobile Forensics
Mobile Forensics
abdullah roomi
 
Windows registry forensics
Windows registry forensicsWindows registry forensics
Windows registry forensics
Taha İslam YILMAZ
 
Cloud-forensics
Cloud-forensicsCloud-forensics
Cloud-forensics
anupriti
 
Windows Registry Forensics with Volatility Framework
Windows Registry Forensics with Volatility FrameworkWindows Registry Forensics with Volatility Framework
Windows Registry Forensics with Volatility Framework
Kapil Soni
 
Registry Forensics
Registry ForensicsRegistry Forensics
Registry Forensics
Somesh Sawhney
 
Windows Forensic 101
Windows Forensic 101Windows Forensic 101
Windows Forensic 101
Digit Oktavianto
 
04 Evidence Collection and Data Seizure - Notes
04 Evidence Collection and Data Seizure - Notes04 Evidence Collection and Data Seizure - Notes
04 Evidence Collection and Data Seizure - NotesKranthi
 
Live memory forensics
Live memory forensicsLive memory forensics
Live memory forensics
Mehedi Hasan
 
CS6004 Cyber Forensics
CS6004 Cyber ForensicsCS6004 Cyber Forensics
CS6004 Cyber Forensics
Kathirvel Ayyaswamy
 
Anti forensic
Anti forensicAnti forensic
Anti forensicMilap Oza
 

What's hot (20)

Windows Registry Analysis
Windows Registry AnalysisWindows Registry Analysis
Windows Registry Analysis
 
Digital Forensic: Brief Intro & Research Challenge
Digital Forensic: Brief Intro & Research ChallengeDigital Forensic: Brief Intro & Research Challenge
Digital Forensic: Brief Intro & Research Challenge
 
Accessing Forensic Images
Accessing Forensic ImagesAccessing Forensic Images
Accessing Forensic Images
 
Mobile Forensics
Mobile ForensicsMobile Forensics
Mobile Forensics
 
Computer Forensics & Windows Registry
Computer Forensics & Windows RegistryComputer Forensics & Windows Registry
Computer Forensics & Windows Registry
 
Disk forensics
Disk forensicsDisk forensics
Disk forensics
 
IBM QRadar WinCollector - Managed Vs Stand Alone
IBM QRadar  WinCollector - Managed Vs Stand AloneIBM QRadar  WinCollector - Managed Vs Stand Alone
IBM QRadar WinCollector - Managed Vs Stand Alone
 
Operating System Forensics
Operating System ForensicsOperating System Forensics
Operating System Forensics
 
Anti-Forensics: Real world identification, analysis and prevention
Anti-Forensics: Real world identification, analysis and preventionAnti-Forensics: Real world identification, analysis and prevention
Anti-Forensics: Real world identification, analysis and prevention
 
Mobile Forensics
Mobile Forensics Mobile Forensics
Mobile Forensics
 
Windows registry forensics
Windows registry forensicsWindows registry forensics
Windows registry forensics
 
Cloud-forensics
Cloud-forensicsCloud-forensics
Cloud-forensics
 
Digital Forensics
Digital ForensicsDigital Forensics
Digital Forensics
 
Windows Registry Forensics with Volatility Framework
Windows Registry Forensics with Volatility FrameworkWindows Registry Forensics with Volatility Framework
Windows Registry Forensics with Volatility Framework
 
Registry Forensics
Registry ForensicsRegistry Forensics
Registry Forensics
 
Windows Forensic 101
Windows Forensic 101Windows Forensic 101
Windows Forensic 101
 
04 Evidence Collection and Data Seizure - Notes
04 Evidence Collection and Data Seizure - Notes04 Evidence Collection and Data Seizure - Notes
04 Evidence Collection and Data Seizure - Notes
 
Live memory forensics
Live memory forensicsLive memory forensics
Live memory forensics
 
CS6004 Cyber Forensics
CS6004 Cyber ForensicsCS6004 Cyber Forensics
CS6004 Cyber Forensics
 
Anti forensic
Anti forensicAnti forensic
Anti forensic
 

Similar to Forensic artifacts in modern linux systems

UNIX Operating System ppt
UNIX Operating System pptUNIX Operating System ppt
Basics of Linux Commands, Git and Github
Basics of Linux Commands, Git and GithubBasics of Linux Commands, Git and Github
Basics of Linux Commands, Git and Github
Devang Garach
 
Kqueue : Generic Event notification
Kqueue : Generic Event notificationKqueue : Generic Event notification
Kqueue : Generic Event notification
Mahendra M
 
Linux Operating System
Linux Operating SystemLinux Operating System
Linux Operating System
KunalKewat1
 
Root file system
Root file systemRoot file system
Root file system
Bindu U
 
2 - SystemComponents.ppt
2 - SystemComponents.ppt2 - SystemComponents.ppt
2 - SystemComponents.ppt
TekalignTaye
 
Lesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File SystemLesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File System
Sadia Bashir
 
84640411 study-of-unix-os
84640411 study-of-unix-os84640411 study-of-unix-os
84640411 study-of-unix-os
homeworkping3
 
TLPI Chapter 14 File Systems
TLPI Chapter 14 File SystemsTLPI Chapter 14 File Systems
TLPI Chapter 14 File SystemsShu-Yu Fu
 
Lamp
LampLamp
LampReka
 
Lamp1
Lamp1Lamp1
Lamp1Reka
 
linux file sysytem& input and output
linux file sysytem& input and outputlinux file sysytem& input and output
linux file sysytem& input and output
MythiliA5
 
Unix operating system architecture with file structure
Unix operating system architecture with file structure Unix operating system architecture with file structure
Unix operating system architecture with file structure
amol_chavan
 
Introduction to unix
Introduction to unixIntroduction to unix
Introduction to unix
Chandru Jangin
 
Linux administration classes in mumbai
Linux administration classes in mumbaiLinux administration classes in mumbai
Linux administration classes in mumbai
Vibrant Technologies & Computers
 

Similar to Forensic artifacts in modern linux systems (20)

Unix 3 en
Unix 3 enUnix 3 en
Unix 3 en
 
Linux filesystemhierarchy
Linux filesystemhierarchyLinux filesystemhierarchy
Linux filesystemhierarchy
 
UNIX Operating System ppt
UNIX Operating System pptUNIX Operating System ppt
UNIX Operating System ppt
 
Basics of Linux Commands, Git and Github
Basics of Linux Commands, Git and GithubBasics of Linux Commands, Git and Github
Basics of Linux Commands, Git and Github
 
Kqueue : Generic Event notification
Kqueue : Generic Event notificationKqueue : Generic Event notification
Kqueue : Generic Event notification
 
Linux Operating System
Linux Operating SystemLinux Operating System
Linux Operating System
 
Root file system
Root file systemRoot file system
Root file system
 
2 - SystemComponents.ppt
2 - SystemComponents.ppt2 - SystemComponents.ppt
2 - SystemComponents.ppt
 
Lesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File SystemLesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File System
 
84640411 study-of-unix-os
84640411 study-of-unix-os84640411 study-of-unix-os
84640411 study-of-unix-os
 
Basic Linux Internals
Basic Linux InternalsBasic Linux Internals
Basic Linux Internals
 
TLPI Chapter 14 File Systems
TLPI Chapter 14 File SystemsTLPI Chapter 14 File Systems
TLPI Chapter 14 File Systems
 
Lamp
LampLamp
Lamp
 
Lamp1
Lamp1Lamp1
Lamp1
 
Lamp1
Lamp1Lamp1
Lamp1
 
linux file sysytem& input and output
linux file sysytem& input and outputlinux file sysytem& input and output
linux file sysytem& input and output
 
Unix operating system architecture with file structure
Unix operating system architecture with file structure Unix operating system architecture with file structure
Unix operating system architecture with file structure
 
Linux training
Linux trainingLinux training
Linux training
 
Introduction to unix
Introduction to unixIntroduction to unix
Introduction to unix
 
Linux administration classes in mumbai
Linux administration classes in mumbaiLinux administration classes in mumbai
Linux administration classes in mumbai
 

More from Gol D Roger

Seizing Electronic Evidence & Best Practices – Secret Service
Seizing Electronic Evidence & Best Practices – Secret ServiceSeizing Electronic Evidence & Best Practices – Secret Service
Seizing Electronic Evidence & Best Practices – Secret Service
Gol D Roger
 
Cybercrimeandforensic 120828021931-phpapp02
Cybercrimeandforensic 120828021931-phpapp02Cybercrimeandforensic 120828021931-phpapp02
Cybercrimeandforensic 120828021931-phpapp02
Gol D Roger
 
8 0-os file-system management
8 0-os file-system management8 0-os file-system management
8 0-os file-system management
Gol D Roger
 
8 1-os file system implementation
8 1-os file system implementation8 1-os file system implementation
8 1-os file system implementation
Gol D Roger
 
Deep Web
Deep WebDeep Web
Deep Web
Gol D Roger
 
Desktop Forensics: Windows
Desktop Forensics: WindowsDesktop Forensics: Windows
Desktop Forensics: Windows
Gol D Roger
 
Email Forensics
Email ForensicsEmail Forensics
Email Forensics
Gol D Roger
 
Windows logon password – get windows logon password using wdigest in memory d...
Windows logon password – get windows logon password using wdigest in memory d...Windows logon password – get windows logon password using wdigest in memory d...
Windows logon password – get windows logon password using wdigest in memory d...
Gol D Roger
 
HTTPs Strict Transport Security
HTTPs    Strict Transport Security HTTPs    Strict Transport Security
HTTPs Strict Transport Security
Gol D Roger
 
IT Passport Examination.
IT Passport Examination.IT Passport Examination.
IT Passport Examination.
Gol D Roger
 
Basic configuration fortigate v4.0 mr2
Basic configuration fortigate v4.0 mr2Basic configuration fortigate v4.0 mr2
Basic configuration fortigate v4.0 mr2
Gol D Roger
 
windows server 2012 R2
windows server 2012 R2windows server 2012 R2
windows server 2012 R2
Gol D Roger
 
Users guide-to-winfe
Users guide-to-winfeUsers guide-to-winfe
Users guide-to-winfeGol D Roger
 
10 things group policy preferences does better
10 things group policy preferences does better10 things group policy preferences does better
10 things group policy preferences does betterGol D Roger
 

More from Gol D Roger (14)

Seizing Electronic Evidence & Best Practices – Secret Service
Seizing Electronic Evidence & Best Practices – Secret ServiceSeizing Electronic Evidence & Best Practices – Secret Service
Seizing Electronic Evidence & Best Practices – Secret Service
 
Cybercrimeandforensic 120828021931-phpapp02
Cybercrimeandforensic 120828021931-phpapp02Cybercrimeandforensic 120828021931-phpapp02
Cybercrimeandforensic 120828021931-phpapp02
 
8 0-os file-system management
8 0-os file-system management8 0-os file-system management
8 0-os file-system management
 
8 1-os file system implementation
8 1-os file system implementation8 1-os file system implementation
8 1-os file system implementation
 
Deep Web
Deep WebDeep Web
Deep Web
 
Desktop Forensics: Windows
Desktop Forensics: WindowsDesktop Forensics: Windows
Desktop Forensics: Windows
 
Email Forensics
Email ForensicsEmail Forensics
Email Forensics
 
Windows logon password – get windows logon password using wdigest in memory d...
Windows logon password – get windows logon password using wdigest in memory d...Windows logon password – get windows logon password using wdigest in memory d...
Windows logon password – get windows logon password using wdigest in memory d...
 
HTTPs Strict Transport Security
HTTPs    Strict Transport Security HTTPs    Strict Transport Security
HTTPs Strict Transport Security
 
IT Passport Examination.
IT Passport Examination.IT Passport Examination.
IT Passport Examination.
 
Basic configuration fortigate v4.0 mr2
Basic configuration fortigate v4.0 mr2Basic configuration fortigate v4.0 mr2
Basic configuration fortigate v4.0 mr2
 
windows server 2012 R2
windows server 2012 R2windows server 2012 R2
windows server 2012 R2
 
Users guide-to-winfe
Users guide-to-winfeUsers guide-to-winfe
Users guide-to-winfe
 
10 things group policy preferences does better
10 things group policy preferences does better10 things group policy preferences does better
10 things group policy preferences does better
 

Recently uploaded

Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 

Recently uploaded (20)

Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 

Forensic artifacts in modern linux systems

  • 1. Forensic Artifacts in Modern Linux Systems Prof. Dr. Bruce Nikkel M Division of Computer Science September 10, 2018
  • 2. Purpose and Scope of Workshop Describe things of forensic interest, show how to find and extract data from:M hacked/compromised Linux servers M criminal operated Linux servers (Command and Control) M abused/misused Linux desktop systems (suspect users, victim users) M seized and imaged systems (dead disk forensics) M focus on modern Linux system artifacts (systemd, etc.) M focus on artifacts independent of Linux distribution *Not* the focus of this workshop: M using Linux as an analysis platform (most of this analysis can also be done with encase/ftk/xways) M how to use Linux based forensic tools M live Linux system analysis and memory forensics M Linux based mobile devices (Android) M Application artifacts (browser, email, office, etc) This is not exhaustive, there are many OS artifacts not covered here (obscure/rare artifacts, distro specific artifacts, etc.) Bern University of Applied Sciences 2/24
  • 3. Overview of Workshop High level overview of workshop topics (from a forensic/investigative perspective): M partitions and filesystems M mbr/uefi, grub, initrd/initramfs M linux file/directory layout M systemd: boot/shutdown, services, scheduled tasks M installed software and packages M log files and systemd journal M swap, cache, and persistent data M system and user configuration M desktop artifacts M encryption and steganography M conclusion Workshop format: mix of theory/slides and demonstrations Example disk images are shown as either "image.dd" or "/dev/sda" Bern University of Applied Sciences 3/24
  • 4. Partitions and Filesystems Examples of typical storage devices:M SATA drives: /dev/sda M NVME drives: /dev/nvme0n1 M MMC/SD cards: /dev/mmcblk0 M (Virtual Machine: /dev/vda) Examples of typical partition devices: M /dev/sda1 M /dev/nvme0n1p1 M /dev/mmcblk0p1 M (/dev/vda1) Most common partition schemes are DOS and GPT M disktype /dev/sda M mmls image.dd M UEFI systems have GPT layout and use a system partition with a FAT filesystem for EFI boot files Bern University of Applied Sciences 4/24
  • 5. Partitions and Filesystems Some examples of filesystems used by modern Linux:M typical for installation: ext4, btrfs, xfs M many others supported: fat, ntfs, ext2, ext3 M network filesystems: nfs, samba/cifs, sshfs M pseudo filesystems: proc, sys, dev Interesting artifacts about an EXT4 filesystem: M when the filesystem was created M last mounted, last written, last checked M number of times mounted M last repaired M tune2fs -l /dev/sda1 M fsstat /dev/sda1 Network and Virtual filesystems are interesting in live system analysis, less for dead disk analysis (but we can try to find out some things, like when/where they were mounted) Bern University of Applied Sciences 5/24
  • 6. Partitions and Filesystems The SleuthKit ("TSK") has filesystem analysis tools for:M listing and extracting files, inodes, blocks M identifying and extracting deleted files M building timelines (MACB timestamps) M extracting slack and unallocated areas for analysis M other filesystem artifacts (journaling filesystems,etc.) All the TSK commands grouped by function: M Partition/volume analysis: mmcat, mmls, mmstat, fsstat, img_cat, img_stat M Analyzing by blocks/sectors: blkcalc, blkcat, blkls, blkstat M Analyzing by inodes: icat, ifind, ils, istat, tsk_recover M Analyzing by filename: fcat, ffind, fls, fiwalk M Journaling filesystems: jcat, jls, usnjls M Timelines: mactime, tsk_gettimes M Search and sort: jpeg_extract, sigfind, sorter, srch strings, tsk_comparedir, hfind, tsk_loaddb These commands work on: attached devices, raw images (dd), and forensic images (EnCase/FTK). Bern University of Applied Sciences 6/24
  • 7. MBR/UEFI, Grub, initrd/initramfs MBR - 512 byte boot sector, jumps to next stage loaderM can analyze boot sector for possible malware (boot sector viruses are rare today) M dd if=image.dd of=bootsector.dd bs=512 count=1 UEFI - FAT system partition with files, more intelligent boot loading M look for unusual efi binaries M if you have access to mainboard, get UEFI variables stored in NVRAM Grub artifacts (GRand Unified Bootloader) M /boot/grub/grub.cfg or /boot/grub2/grub.cfg M /etc/grub.d/* or /etc/default/grub M can show list of previous OS installations, kernel parameters used, etc. Kernel ramdisk (initrd or initramfs) M debian: lsinitramfs -l /initrd.img M fedora: lsinitrd -v /boot/initramfs-4.16.11-100.fc26.x86_64.img M arch: lsinitcpio -v /boot/initramfs-linux.img M suse: lsinitrd /boot/initrd M if root filesystem is encrypted, may have interesting cleartext info Bern University of Applied Sciences 7/24
  • 8. Linux File System Layout Directories of interest to forensic investigators: M bootstrap configuration /boot (efi partition mounted on /boot/efi) M system configs: /etc M logs, cache, state: /var (especially /var/lib and /var/log) M user data: /home and /root Some directories are mountpoints for pseudo filesystems: M /proc, /sys, /dev, /run M not very useful for dead disk forensics Other tips: M be aware of hidden files/dirs (filenames starting with ".") M the "FILES" section of manpages can indicate items of potential interest M use forensic timelines to identify ’busy’ directories Bern University of Applied Sciences 8/24
  • 9. Systemd Boot/Shutdown, Services, Scheduled Tasks SystemdM modern Linux system and service manager M very consistent across distributions M manages starting, stopping, restarting of daemons Systemd configuration common locations: M defaults: /usr/lib/systemd/ or /lib/systemd/ M custom: /etc/systemd/ M user: ~/.config/systemd These directories contain systemd unit files, that configure or control: M services and daemons M sockets and devices M mount points, automount points M swap files and swap partitions M start-up targets M timers (scheduled jobs), watched file system paths Provides forensic trace information about the system and user configuration Bern University of Applied Sciences 9/24
  • 10. Systemd Boot/Shutdown, Services, Scheduled tasks Examples of things to look for as a forensic investigator: M overview of services started on boot M proxy and relay daemons M strange services that could be backdoors or malcious code M vpn tunnels (new: wireguard vpn, this is growing in popularity, look for /etc/wireguard/, the wg0 interface, or systemd wireguard files) M service units for: bitcoin, torrent, tor, tunneled protocols, etc. Scheduled jobs: M traditional cron jobs: /var/spool/cron, /var/spool/anacron, /etc/cron.*/*, and /etc/crontab M traditional at jobs (one time execution): /var/spool/at M systemd timers (*.timer files) M user and system jobs are separate (for cron and systemd) Note: there are over 150 manpages describing systemd and various relevant files Bern University of Applied Sciences 10/24
  • 11. Installed Software and Packaging Most popular packaging formats (not consistent across distributions):M rpm (redhat and suse) M apt/deb (debian/ubuntu, etc.) M pacman/tar (arch, manjaro) The interesting forensic artifacts in packaging systems are: M list of installed software packages (package databases) M removed software packages (install logs, previously downloaded packages) M install and removal timestamps Other packaging systems growing in popularity: M snap/snappy M flatpacks Backups and archive files (ok, not packages, but...): M tar snar files have a list of deleted, changed, created files from backups M tar --show-snapshot-field-ranges Bern University of Applied Sciences 11/24
  • 12. Installed Software and Packaging Debian based systems M logs: /var/log/apt/* M database: /var/lib/dpkg/* (especially the ’status’ file) Redhat and SuSe based systems M logs: /var/log/dnf.rpm.log* M database: /var/lib/rpm/* Arch pacman based systems M arch also has "AUR" or Arch User Repository user M database: /var/lib/pacman/local/*/* M logs: paclog command, /var/log/pacman.log Note: users can bypass the packaging system and copies any files anywhere (’make install’ for example). Bern University of Applied Sciences 12/24
  • 13. Log Files and Systemd Journal Programs and daemons typically log to one of three places:M traditional syslog (/var/log/messages or /var/log/syslog) M systemd journal M self written log files (usually in /var/log/*) Traditional Linux logging: M logs can be different levels of verbosity (debug, informational, etc.) M a running linux kernel has a ring buffer log (dmesg) M applications may separate error logs from transaction logs M syslog messages are sent to a syslog daemon and saved to files Systemd journal has features that are interesting for investigators: M better recording of logs during early system initialization M stderr output of a daemon is captured M logs are stored in a structured binary format that can be filtered, searched, or exported M Forward Secure Sealing (FSS) preserves integrity of the logs (like a forensic chain of custody) Bern University of Applied Sciences 13/24
  • 14. Log Files and Systemd Journal Journalctl data and commands: M location: /var/log/journal/$RANDOMSTRING/* M system logs: system@* M user logs (with UID): user-1000@* M journalctl --root=/location/of/forensic/image/mount/ M journalctl --file=user-1000@ M journalctl --directory=/some/directory/with/journal/ Journalctl tips: M logged boots: journalctl --list-boots M kernel messages: journalctl --dmesg M time periods: journalctl --since=2018-09-05 --until=2018-09-06 M more verbose: journalctl -ax M search with "/", n-next, N-previous Bern University of Applied Sciences 14/24
  • 15. Log Files and Systemd Journal What you might find in the logs and systemd journal: M attached and mounted USB drives M network interfaces and MAC addresses (NetworkManager) M dhcp results with IPs addresses (NetworkManager) M evidence of malicious activity and attacks (failed logins) M successful logins (local and remote) and user sessions M reboots, boots, daemon start/stop/restart M virtual network interface creation (vpns/tunnels) M application/daemon errors and messages M user activity (pgp/gpg agent activity) M notebook Lid close/open, power cable plugin Files in /var/log/* are disappearing from use, so learn journalctl Some systems may not keep a persistent copy of the journal across boots Most systems still have utmp/wtmp files: last -f /var/log/wtmp Bern University of Applied Sciences 15/24
  • 16. Cache, Swap and Persistent data Desktop systems using NetworkManager cache interesting things: M /var/lib/NetworkManager/* M dhcp leases and timestamps M observed wifi bss ids Desktop systems with Bluetooth cache interesting things: M /var/lib/bluetooth/* M paired bluetooth devices M file timestamps reveal previous pairing activty Lots of really great info in /var/lib, often with timestamps: M depending on the software installed, all kinds of interesting system persistence and cached data M example: switching from charging to discharging (/var/lib/upower/*) M (hint, convert epoch timestamps to human time: date -d @1535347485) Bern University of Applied Sciences 16/24
  • 17. Cache, Swap and Persistent data Temporary files and directoriesM /tmp and /var/tmp may contain files M (but may be deleted after boot or logout) M swapfile or swap partition (see /etc/fstab) If swap is the size of ram or larger, it can be used for hibernation: M a hibernating system has a complete memory dump saved to disk M check the end of journal to see if the system went into hibernation M can be extracted with forensic tools (icat, dd, etc.) M memory analysis can be done to find many artifacts: running processes, established network connections, possibly keys and passwords Printers and printed pages M attached and configured printers: /etc/cups/* M print jobs from cupsd: /var/cache/cups/* M /var/spool/cups/* and /var/log/cups/* Large amounts of cached user data in /home/user/.cache, this contains application data (photo thumbnails for example) Bern University of Applied Sciences 17/24
  • 18. System and User Configuration System and kernel:M LSB (Linux Standards Base): /etc/lsb-release or o/etc/os-release M kernel version: file vmlinuz M kernel config/parameters grub.cfg and /etc/sysctl.* M kernel modules: /etc/modprobe*, /etc/modules, /etc/modules-load* M startup services/daemons (systemd units) Systemd network config: M default: /usr/lib/systemd/network/ or /lib/systemd/network M custom: /etc/systemd/network/ M also distro specific (debian /etc/network/interfaces) Crashed programs M system may need to be configured to save core files M /var/lib/systemd/coredump M this is a memory dump of a process: established network connections, possibly keys and passwords M manpage core(5) Bern University of Applied Sciences 18/24
  • 19. System and User Configuration Users and groupsM traditionally in /etc/passwd and /etc/group M some systems may use ldap M UID and GID analyzed as filesystem meta data M (Sleuthkit: mactime -p /etc/passwd -g /etc/group) M users and groups may refer to people or processes M difference between system and application activity is not always clear M difference between system and user activity is not always clear OS and user configuration files M traditional Unix/Linux files in /etc M gconf/dconf, systemd units M dot files ~/.* M dot files ~/.config/* M user customized shells (.bashrc) and shell history M each distro may have additional configuration artifacts that are interesting Bern University of Applied Sciences 19/24
  • 20. Desktop Artifacts Freedesktop.org (formerly known as: X Desktop Group or XDG) M XDG documentation and specifications at freedesktop.org M Provides compatibility across distros and desktop environments M KDE and Gnome most popular DEs Key directories interesting to forensic investigators: M systemd unit files for XDG: /etc/xdg/systemd M $XDG_DATA_HOME, default ~/.local/share M $XDG_CONFIG_HOME, default ~/.config M $XDG_CACHE_HOME, default ~/.cache M contains user’s GUI data and configuration M (there are also system-wide equivalent defaults) Bern University of Applied Sciences 20/24
  • 21. Desktop Artifacts Interesting things we find here:M autostarting GUI apps ~/.config/autostart/* M contents of user’s desktop: ~/Desktop (contains Desktop entry files) M recently opened docs: ~/.recently-used or ~/local/share/recently-used.xbel M thumbnails ~/.cache/thumbnails M "Trash" ~/.local/share/Trash or ~/.Trash M User override default apps: ~/.config/mimeapps.list M application downloads: ~/Downloads Other notes M often 2 sets of timestamps: filesystem (MACB) and timestamps inside the files M These directories and filenames may vary depending on the desktop and XDG variables M X11 vs Wayland? These both operate below the XDG/freedesktop.org Environment, so it should (mostly) not matter Bern University of Applied Sciences 21/24
  • 22. Encryption and Steganography Forensic examiners will find different types of encryption: M application file encryption - protected PDF, office docs, etc M individual file containers - GPG, Encrypted Zip M directories - ecryptfs, ext4 encrypted sub-directories M volumes - TrueCrypt/Veracrypt M block devices - Linux LUKS M drive hardware - OPAL/SED Decrypting requires: M password or passphrase M cryptographic key string or key file M smartcard or hard token The forensic challenge is to find the decryption key (some tools: John the Ripper, HashCat, bulk_extractor, $5 wrench) Bern University of Applied Sciences 22/24
  • 23. Encryption and Steganography Steganography is considered a part of anti-forensics M It hides data in non-obvious places M least significant bits of color, sound, etc. M tries to hide data in different slack areas M Veracrypt allows hiding volumes inside volumes Some tools: M stegdetect M stegsnow M openstego M busysteg M gsteg M photocrypt Bern University of Applied Sciences 23/24
  • 24. Conclusion M Thanks for listening! M If you know some additional Linux forensic artifacts not mentioned, please send them to me, I’ll add them to my slides. M Law Enforcement: You are welcome to contact me at BFH for Linux analysis support. M Contact details: bruce.nikkel@bfh.ch M These slides are available at: digitalforensics.ch Bern University of Applied Sciences 24/24