
CompTIAPenTest+
Domain 2Objective 4
Script Modification PT0-003 Practice Questions (Page 4)
Part of the Reconnaissance and enumeration domain, which accounts for 21% of the PT0-003 exam. CompTIA does not publish an official question count, but from its 165-minute exam (~65–110 total, ~14–23 in this domain), expect 4–6 from this objective — we provide 26 practice questions to prepare you well beyond it. (estimate)
26questions here
6free pages
9concepts
21%of the exam
Questions 16–20
- 16
A Bash script outputs results to the terminal. How can the script be modified to save the output to a file while still displaying it on the screen?
Select an answer first - 17
In a Bash script, which construct is used to execute a block of code multiple times, such as iterating over a list of target hosts?
Select an answer first - 18
A security analyst is writing a PowerShell script to enumerate all user accounts in an Active Directory domain and output their `SamAccountName` and `Enabled` status to a CSV file. The script currently uses `Get-ADUser -Filter *`. The analyst needs to ensure the output file contains only the two required properties and is easily importable by other tools. Which modification should the analyst make?
Select an answer first - 19
A penetration tester has a Python script that uses the `requests` library to enumerate directories on a web server. The script currently checks for HTTP 200 responses to identify valid directories. The tester needs to modify the script to also identify directories that return HTTP 403 (Forbidden) because they might contain sensitive files. The tester wants to minimize false positives from soft 404s. Which modification should the tester make?
Select an answer first - 20
Which Bash utility is commonly used to perform DNS lookups and resolve hostnames to IP addresses during enumeration?
Select an answer first
Finished these 5 questions?
Review the revealed explanations, or continue through the curriculum.
Free Basic Practice is a study aid with revealable answers — not a scored exam. Examers.io is independent and not affiliated with or endorsed by CompTIA. “PT0-003” is a trademark of its owner, used for identification only.