SOC Analyst Basics - Linux Log Files
SOC Analyst Basics - Linux Log Files
SOC
ANALYST
SERIES
https://academy.maikroservice.com
Practical SOC Analyst 101
https://maikroservice.com/waitlist
https://academy.maikroservice.com
Linux stores log files in a couple
different locations
/var/log
https://academy.maikroservice.com
do all /var/log folders
look the same across linux
distributions?
no
example: debian
https://academy.maikroservice.com
example: ubuntu2204
https://academy.maikroservice.com
example: ubuntu2304
https://academy.maikroservice.com
wait a second - they are
different even between the
same operating system?
https://academy.maikroservice.com
ok but... there are so many
files?! How do I know
which one to search
through?
Great question!
https://academy.maikroservice.com
auth.log
https://academy.maikroservice.com
auth.log
it holds:
login events
user changes (e.g. user added)
group changes
system reboots
executed sudo commands
and more
https://academy.maikroservice.com
auth.log examples
https://academy.maikroservice.com
syslog
https://academy.maikroservice.com
the systemlog or syslog is one
of the most important log files
of the unix operating system
it combines:
https://academy.maikroservice.com
syslog example:
https://academy.maikroservice.com
ok cool but where can we
find failed login attempts?
https://academy.maikroservice.com
btmp / wtmp are binary log
files - so you need a special
command to read them.
Dont believe me?
https://academy.maikroservice.com
https://academy.maikroservice.com
AHHHH MY EYES MAKE IT
STOOOOOP
OK - Gotcha - mistakes
were made
https://academy.maikroservice.com
use the last and lastb commands
https://academy.maikroservice.com
use the last and lastb commands
pffff BOOOORING
its empty.
https://academy.maikroservice.com
oh ya right - umm let’s generate
some failed logins?!
sudo lastb - reads btmp
https://academy.maikroservice.com
and umm... where can we see
when users last logged in?
use the lastlog commands
https://academy.maikroservice.com
and if a hacker logs into the
root account:
https://academy.maikroservice.com
The last log for today is for
debugging
journalctl
$ journalctl -xe
https://academy.maikroservice.com
if anything on your unix system
goes wrong - check journalctl
first!
$ journalctl -xe
# -x = show metainformation
# -e = jump to the end of the file (the newest
entries)
https://academy.maikroservice.com
for more content just like this
@maikroservice