CyberKit

wtmp / btmp / lastlog

Also called utmp, login accounting, last/lastb.

Binary Unix login-accounting databases behind the last, lastb, and lastlog commands.

What it is

A family of fixed-record binary files tracking login activity: utmp holds currently logged-in sessions, wtmp the historical login/logout record, btmp the failed login attempts, and lastlog each user's most recent login. They are parsed with last, lastb, and lastlog rather than read as text.

Where it lives

/var/log/wtmp, /var/log/btmp (often absent by default), /var/log/lastlog, plus the live-session /run/utmp

Why it matters

These give login times, durations, terminals, and source hosts that anchor a session timeline and reveal which accounts were used and from where. Because attackers sometimes zero or surgically edit wtmp/utmp to hide a session, gaps or impossibly clean records are themselves indicators.

In practice

A wtmp record showing a root pts session from an external IP at 03:00 contradicted the user's claim of being offline, and the matching utmp entry confirmed it was live during collection.

What to look for

  • Logins from unfamiliar IPs in last output.
  • Failed attempts in btmp from brute force.
  • Lastlog entries for accounts that should never log in.

Common mistake

Opening them as text. They are binary; use last, lastb and lastlog or a parser.

Practice it nearby

CyberKit has no tool for this term itself. These are the closest places to practice it.

In the field

Well-known tools where this shows up on the job. They are listed to show the landscape, not as a recommendation.

  • osquery Open source

    Exposes Linux and macOS system state as SQL tables you can query.

  • Velociraptor Open source

    Collects Linux artifacts such as logs, cron and shell history at scale. Our notes.

  • Falco Open source

    Watches system calls at runtime and alerts on suspicious behavior.

  • Wazuh Open source

    Collects Linux logs and checks file integrity on each host.

Read next

  • auth.log / secure: Linux authentication log recording logins, sudo use, SSH activity, and PAM events.
  • systemd Journal: Structured, indexed binary log managed by systemd-journald on modern Linux.
  • Anti-Forensic Log Tampering: Deleting, editing, or zeroing host logs and history to hide intruder activity.

Sources