Windows and Linux for Defenders
the handful of ideas that make logs and alerts make sense
Almost every alert you will ever investigate happens on a Windows or Linux machine. You do not need to be an administrator, but a few core ideas turn confusing logs into stories.
Processes, users and permissions
- A process is a running program. Every process has a parent (the process that started it) and runs as some user. "Word started PowerShell" is a very different story from "the user started PowerShell".
- Every action is done as an account. Normal users have limited rights; administrators (Windows) or root (Linux) can change almost anything. Attackers want those rights.
- Services (Windows) and daemons (Linux) are programs that run in the background, often starting at boot. They are a favorite place to hide persistence.
Files, registry and startup
- Windows keeps many settings in the registry, and programs can register themselves to start automatically (Run keys, scheduled tasks, services).
- Linux keeps settings mostly in plain text under
/etc, user files under/home, logs under/var/log, and uses scheduled jobs (cron) and service units (systemd) for startup.
Where the evidence is
- Windows: the Event Log (Security, System, Application). Useful events include successful and failed logons and the creation of new processes or accounts, when auditing is enabled.[1] Sysmon is a free tool that adds much richer detail.
- Linux:
/var/log/auth.logor/var/log/secure(logins andsudo),/var/log/syslogorjournalctl, plus web and application logs.
Things that are normal, and things that are not
Normal: system processes with expected parents, administrators signing in at expected times, scheduled updates. Worth a look: an Office program launching a command shell, a new administrator account at 3 a.m., a program running from a temporary or download folder, many failed logins followed by a success.
Two habits worth building
Learn the baseline: what normal looks like on your systems, because you spot attacks as differences. And learn to ask of every event: which user, which process, from where, and why now?
Sources
Test yourself
My notes
Private — saved only on this device, never sent anywhere.