nerdexam
CompTIA

SY0-301 · Question #425

The security administrator is analyzing a user's history file on a Unix server to determine if the user was attempting to break out of a rootjail. Which of the following lines in the user's history…

The correct answer is A. cd ../../../../bin/bash. Repeated use of 'cd ../../../../' traverses up multiple directory levels, which is the standard method to escape a chroot rootjail by reaching the real filesystem root.

Security operations

Question

The security administrator is analyzing a user's history file on a Unix server to determine if the user was attempting to break out of a rootjail. Which of the following lines in the user's history log shows evidence that the user attempted to escape the rootjail?

Options

  • Acd ../../../../bin/bash
  • Bwhoami
  • Cls /root
  • Dsudo -u root

How the community answered

(34 responses)
  • A
    74% (25)
  • B
    15% (5)
  • C
    9% (3)
  • D
    3% (1)

Why each option

Repeated use of 'cd ../../../../' traverses up multiple directory levels, which is the standard method to escape a chroot rootjail by reaching the real filesystem root.

Acd ../../../../bin/bashCorrect

A chroot rootjail restricts a process to a subdirectory, treating it as the filesystem root. The command 'cd ../../../../bin/bash' attempts directory traversal by moving up multiple parent directories to reach the actual system root and then access a real shell binary, which is the canonical technique for escaping a poorly configured chroot environment.

Bwhoami

'whoami' simply queries the current user identity and provides no information about an attempt to change filesystem scope or escalate privileges.

Cls /root

'ls /root' attempts to list the root user's home directory, which may indicate reconnaissance but does not indicate an attempt to break out of a jailed environment.

Dsudo -u root

'sudo -u root' attempts privilege escalation to the root user account but does not attempt to escape the restricted filesystem boundary imposed by a chroot jail.

Concept tested: Chroot rootjail escape via directory traversal

Source: https://linux.die.net/man/2/chroot

Topics

#rootjail escape#directory traversal#Unix security#log analysis

Community Discussion

No community discussion yet for this question.

Full SY0-301 Practice