Linux Forensics [WIP]
- No networking related forensics is covered.
1 Live Response
1.1 Talk to the Humans
- What do they think happened
- Details on victim system(s)
1.2 Mount Response Kit with Known Good Tools
- cdrom preferred as it was not likely part of compromise
- USB MS can be used if no CDROM
- Using netcat to minimize contamination
1.3 Collecting Volatile Data
- date and time
- network interfaces
- funny networks
- promiscuous mode?
- network connections
- open ports
- programs associated with ports
- running processes
- open files
- routing tables
- mounted filesystems
- loaded kernel modules
1.4 Dead Analysis Justified?
- kernel version
- uptime
- filesystem datetime stamps
- hash values for system files
- current user logins
- login history
- system logs
- user accounts
- user history files
- hidden files and directories
- sending off suspicious files for further study
1.5 Dumping RAM
- Making the decision to dump RAM
- Using fmem https://github.com/NateBrune/fmem Linux Kernel Module designed to help analyze volatile memory in the linux kernel
- Using LiME https://github.com/504ensicsLabs/LiME A Loadable Kernel
Module (LKM) which allows for volatile memory acquisition from
Linux and Linux-based devices, such as Android. This makes LiME
unique as it is the first tool that allows for full memory captures
on Android devices. It also minimizes its interaction between user
and kernel space processes during acquisition, which allows it to
produce memory captures that are more forensically sound than those
of other tools designed for Linux memory acquisition.
- Using
/proc/kcore
2 Acquiring Filesystem Images
2.1 Write Blocking Options
- Forensic Linux distros
- Udev rules based blocker
3 Analyzing Filesystem Images
3.1 Mounting images
- Files with basic system info
- Files with suspicious user info
- Examining logs
- Process-related files
- Authentication-related files
- Using standard Linux tools to find information
- Strange files
- Regular files in /dev
- User history files
- Hidden files
- SUID/SGID files
- Detecting backdated files
- Recovering deleted files
- Finding deleted files
- Attempting recovery
4 Timeline Analysis
- When was system installed, upgraded, booted, etc.
- Newly created files (malware)
- Changed files (trojans)
- Files in the wrong place (exfiltration)
5 Digging Deeper into Linux Filesystems
- Disk editors
- Active@ Disk Editor
- Autopsy
5.1 Ext4/3/2/1
- Basics
- Superblocks
- Directory entries
- Inodes
- Data blocks
- Compatible, incompatible, and read-only compatible features
- Experimental features may be installed
- Boot code
- Using sigfind to find important blocks
- Understanding indirect block levels
- istat, ils, ifind, icat
- Links and mounts
- Hash trees
- Journaling
- jls
- jcat
- Finding data with blkstat, blkls, blkfind, blkid, and blkcalc
- Relating data found with grep to a file/application
- Finding block size, etc.
- Using grep with a keyword file
- Seeing data in context
- Associating a file with the data
- Undeleting files
- Searching unallocated space
6 Network Forensics
- Using snort on packet captures
- Using tcpstat
- Seperating conversations with tcpflow
- Tracing backdoors with tcpflow
7 File Forensics
- Using file signatures
- Searching through swap space
- Web browsing reconstruction
- Cookies
- Search history
- Browser caches
- Unknown files
- Comparing hashes to know values
- File command
- Strings command
- Viewing symbols with nm
- Reading ELF files
- objdump
- Bringing out big guns - gdb
8 Memory Forensics
- Volatility Profiles
- Retrieving process information
- Recovering command line arguments
- Rebuilding environment variables
- Listing open files
- Retrieving bash information
- Reconstructing network artifacts
- Kernel information
- Volatile file system information
- Detecting user mode rootkits
- Detecting kernel rootkits
9 Reversing Linux Malware
- What is "reversing"?
- https://github.com/michalmalik/linux-re-101 2018 {pm: Pretty good.}
- JD-GUI is a standalone graphical utility that displays Java source
codes of “.class” files.
- https://unix.stackexchange.com/questions/418354/
understanding- what-a- linux- binary- is-doing
- Tools: IDA and Radare
9.1 Digging deeper into ELF
- Headers
- Sections
- Strings
- Symbol tables
- Program headers
- Program loading
- Dynamic linking
9.2 Command line analysis tools
9.3 Running malware (carefully)
- Virtual machine setup
- Capturing network traffic
- Leveraging gdb
10 Writing the Reports
- Autopsy https://www.sleuthkit.org/autopsy/ Autopsy® is a digital
forensics platform and graphical interface to The Sleuth Kit® and
other digital forensics tools.
- https://tools.kali.org/reporting-tools/dradis Dradis is an open source framework to enable effective
information sharing, specially during security assessments. Dradis
is a self-contained web application that provides a centralized
repository of information to keep track of what has been done so
far, and what is still ahead.
Copyright © 2018
www.wright.edu/~pmateti • 2018-11-01