nerdexam
CompTIA

PT0-001 · Question #159

After successfully enumerating users on an Active Directory domain controller using enum4linux a penetration tester wants to conduct a password-guessing attack Given the below output: Which of the…

The correct answer is B. grep user enuza41inux_output.txt I awk '{print $1}' | cut -d[ -? I cut -d] -f1>; username.txt. The correct pipeline uses grep to isolate user lines from enum4linux output and then chains cut commands with bracket delimiters to extract clean usernames.

Reconnaissance and enumeration

Question

After successfully enumerating users on an Active Directory domain controller using enum4linux a penetration tester wants to conduct a password-guessing attack Given the below output:

Which of the following can be used to extract usernames from the above output prior to conducting the attack?

Exhibit

PT0-001 question #159 exhibit

Options

  • Acat enum41inux_output.txt > grep -v user I sed s/\[//' I sed s/]//' 2> usernames.txt
  • Bgrep user enuza41inux_output.txt I awk '{print $1}' | cut -d[ -? I cut -d] -f1>; username.txt
  • Cgrep -i rid v< enura.41inux_output. txt' | cut -d: -? i cut -d] -f1>; usernames. txt
  • Dcut -d: -f2 enum41inux_output.txt | awk '{print S2}' I cut -d: -f1 > usernaraes.txt

How the community answered

(19 responses)
  • A
    16% (3)
  • B
    74% (14)
  • C
    5% (1)
  • D
    5% (1)

Why each option

The correct pipeline uses grep to isolate user lines from enum4linux output and then chains cut commands with bracket delimiters to extract clean usernames.

Acat enum41inux_output.txt > grep -v user I sed `s/\[//' I sed `s/\]//' 2> usernames.txt

The syntax uses '>' instead of '|' between cat and grep, which redirects stdout to a file rather than piping it, making the entire command logically broken.

Bgrep user enuza41inux_output.txt I awk '{print $1}' | cut -d[ -? I cut -d] -f1>; username.txtCorrect

This command greps for lines containing 'user' to filter the relevant enum4linux output, uses awk to isolate the correct field, then applies sequential cut commands using '[' and ']' as delimiters to extract only the username string that appears between the brackets, which matches the standard enum4linux user enumeration output format and produces a clean list for a password-guessing attack.

Cgrep -i rid v< enura.41inux_output. txt' | cut -d: -? i cut -d] -f1>; usernames. txt

Filtering on 'rid' targets RID-related lines rather than user account lines, producing a different subset of output that does not cleanly yield usernames for a credential attack.

Dcut -d: -f2 enum41inux_output.txt | awk '{print S2}' I cut -d: -f1 > usernaraes.txt

The awk variable is written as '$S2' which is a typo for '$2', and the overall field delimiter logic does not correctly target the bracket-enclosed username format present in enum4linux output.

Concept tested: Parsing enum4linux output with Linux text tools

Topics

#enum4linux#username enumeration#command-line parsing#Active Directory

Community Discussion

No community discussion yet for this question.

Full PT0-001 Practice