CompTIA PenTest+ PT0-003 (V3) Practice Question

You have a script that loops through a list of subdomains to check which ones resolve. The script runs a command on each item and prints lines containing “has address” when an address is found. You want to modify the script so that whenever a line contains “has address,” the resolved address is written to a file named addresses.txt. Which change meets these goals?

  • Modify the file name in the script to addresses.txt and keep the existing command logic

  • Pipe the output to tail, then append the last line to addresses.txt

  • Use a command that searches for 'host info' instead of 'has address' and prints to standard output

  • Add an if condition that checks for 'has address', then use echo to append the match to addresses.txt

CompTIA PenTest+ PT0-003 (V3)
Reconnaissance and Enumeration
Your Score:
Settings & Objectives
Random Mixed
Questions are selected randomly from all chosen topics, with a preference for those you haven’t seen before. You may see several questions from the same objective or domain in a row.
Rotate by Objective
Questions cycle through each objective or domain in turn, helping you avoid long streaks of questions from the same area. You may see some repeat questions, but the distribution will be more balanced across topics.

Check or uncheck an objective to set which questions you will receive.

SAVE $51
$425.00 $374.00
SAVE $57
CompTIA PenTest+ Voucher with Retake
v3 / PT0-003
Includes Retake
$474.00 $417.00
Bash, the Crucial Exams Chat Bot
AI Bot