Courseiva
OS and Network Forensics →mediumMultiple Choice

CHFI OS and Network Forensics Practice Question

During a Linux forensic investigation, you find the following entry in /var/log/auth.log: "Accepted publickey for root from 203.0.113.5 port 54321 ssh2: RSA SHA256:abc...". The user claims they never connect from that IP. Which forensic artifact should you examine next to confirm unauthorized access?

⚠ Common exam trap

EC-Council often tests the distinction between authentication artifacts (authorized_keys) and post-authentication artifacts (bash_history), leading candidates to mistakenly focus on what the attacker did after login rather than how they got in.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

~/.ssh/authorized_keys for unauthorized keys

The log entry shows a successful SSH authentication using a public key from an unknown IP. The most direct way to confirm unauthorized access is to check ~/.ssh/authorized_keys for any rogue public keys that were added without the user's knowledge, as this file controls which keys are permitted to authenticate as that user. If an attacker added their own public key here, they could log in without a password, making this the primary artifact to examine.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    bash_history for suspicious commands

    Why it's wrong here

    The per-user ~/.bash_history can be missing, truncated, or pointed to /dev/null by hardening or attacker cleanup, and it only records interactive command lines, not every file change. A malicious user can also edit or delete the history file to hide the exact command that added an SSH key, so relying on it undermines forensic integrity. While useful for leads, emptiness or gaps cannot rule out an unauthorized key already present in authorized_keys.

  • ✗

    /etc/shadow for recent modifications

    Why it's wrong here

    /etc/shadow is the system account database holding password hashes and aging metadata, and it is updated only when a password is set or changed with passwd/chage. Because SSH public-key authentication bypasses password authentication entirely, adding an unknown key to ~/.ssh/authorized_keys does not touch shadow or produce any timestamp there. Inspecting shadow for recent modifications would therefore reveal nothing about an unauthorized key, and a recent mtime in shadow would reflect account/password administration, not SSH key persistence.

  • ✓

    ~/.ssh/authorized_keys for unauthorized keys

    Why this is correct

    The ~/.ssh/authorized_keys file for each user is the authoritative list of public keys allowed to log in as that account via SSH. Attackers commonly append a single base64-encoded line containing their public key, often with command= or from= restrictions to evade detection, enabling silent passwordless access independent of any password change. Comparing every entry against known administrative keys—while verifying file ownership, permissions, and the account's shell—is the direct method to locate such an implanted credential.

  • ✗

    /var/log/syslog for cron job entries

    Why it's wrong here

    /var/log/syslog aggregates kernel, daemon, and cron messages, including sshd authentication events and cron execution lines, but it does not log the contents or modification of an authorized_keys file. A cron-based persistence mechanism might eventually appear as a job run, yet it is a different persistence method and would not explain the generated key-based access already discovered. Journald rotation and log tampering can also create gaps, making syslog less definitive than inspecting the SSH key file itself.

Quick reference

Asymmetric Encryption Algorithm Comparison

AlgorithmKey ExchangeSignaturesEquivalent Security KeyNotes
RSA-3072YesYes128-bitWidely deployed; slow for bulk data
ECDSA P-256NoYes128-bitFast signatures; standard TLS certs
ECDH / ECDHEYesNo128-bitPerfect forward secrecy in TLS 1.3
DH / DHEYesNo128-bit (3072-bit key)Replaced by ECDHE in modern TLS
Ed25519NoYes~128-bitSSH keys, modern PKI

About these practice questions

This CHFI question is part of Courseiva's 745-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This CHFI practice question is part of Courseiva's free EC-Council certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CHFI exam.