Examers.io
ExamsOrganizationsHow it worksPricingHelp & FAQ
CompTIA logo

CompTIAPenTest+

Domain 2Objective 4

Script Modification PT0-003 Practice Questions (Page 2)

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 6–10

  1. 6application · medium

    A penetration tester is reviewing a Python script that is supposed to enumerate open ports on a target. The script has the following code snippet: ```python import socket target = "192.168.1.10" for port in range(1, 100): s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.settimeout(1) result = s.connect_ex((target, port)) if result == 0: print(f"Port {port} is open") s.close() ``` The tester notices that the script is slow because it scans ports sequentially. The tester wants to improve performance by scanning multiple ports concurrently. Which modification should the tester make?

    Select an answer first
  2. 7application · medium

    A system administrator is writing a PowerShell script to enumerate all open TCP listening ports on a local Windows machine. The script needs to output the port number and the process ID (PID) that is listening. Which PowerShell cmdlet should the script use to gather this information?

    Select an answer first
  3. 8application · medium

    A penetration tester is writing a Bash script to enumerate HTTP headers from a web server. The script needs to use `curl` to fetch the headers and then extract the `Server` header value. Which Bash command should the tester use to achieve this?

    Select an answer first
  4. 9foundation · easy

    In a Python script used for port scanning, which construct is used to define a block of code that should be executed repeatedly for each port in a list?

    Select an answer first
  5. 10foundation · easy

    A Python enumeration script currently prints results to the console. What modification would allow the results to be saved to a file for later analysis?

    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.