nerdexam
GIAC

GCFA · Question #254

You work as a Network Administrator for Perfect Solutions Inc. The company has a Linux-based network. You are working as a root user on the Linux operating system. While performing some security…

The correct answer is D. Last. The last command on Linux reads the /var/log/wtmp file and displays a list of all previous user logins, including the hostname or IP address of the remote machine from which each user connected.

Advanced Mac & Linux Forensics

Question

You work as a Network Administrator for Perfect Solutions Inc. The company has a Linux-based network. You are working as a root user on the Linux operating system. While performing some security investigation, you want to see the hostname and IP address from where users logged in. Which of the following commands will you use to accomplish the task?

Options

  • ADig
  • BNetstat
  • CNslookup
  • DLast

How the community answered

(45 responses)
  • A
    2% (1)
  • B
    7% (3)
  • C
    16% (7)
  • D
    76% (34)

Why each option

The `last` command on Linux reads the /var/log/wtmp file and displays a list of all previous user logins, including the hostname or IP address of the remote machine from which each user connected.

ADig

The `dig` command is a DNS query utility used to look up DNS records such as A, MX, and NS entries, not to display user login history.

BNetstat

The `netstat` command displays current active network connections, routing tables, and interface statistics, but it does not show historical login sessions or their source addresses.

CNslookup

The `nslookup` command performs forward and reverse DNS lookups, resolving hostnames to IPs and vice versa, and does not report user login history.

DLastCorrect

The `last` command parses the binary /var/log/wtmp log file and outputs each login session with the username, terminal, source hostname or IP address, login time, and session duration. Because it records remote login origin information, it is the correct tool for a security investigation focused on identifying where users logged in from. It requires no special privileges beyond reading the wtmp file, but running as root ensures access to all entries.

Concept tested: Linux login history and remote session auditing

Source: https://man7.org/linux/man-pages/man1/last.1.html

Topics

#Linux commands#login history#user activity forensics#last command

Community Discussion

No community discussion yet for this question.

Full GCFA Practice