PT0-003 · Question #303
A penetration tester uses a Python script to enumerate open ports across a list of IP addresses. The current script runs sequentially, which slows it down during larger engagements. The tester wants…
The correct answer is B. Importing a library that allows use of workers. Using a worker-based concurrency approach (such as a thread/process pool) allows the script to scan multiple targets in parallel, significantly improving throughput for network I/O-bound tasks like port enumeration.
Question
A penetration tester uses a Python script to enumerate open ports across a list of IP addresses. The current script runs sequentially, which slows it down during larger engagements. The tester wants to improve the script’s performance so it can handle multiple targets simultaneously. Which of the following changes is the best way to achieve this goal?
Options
- AUsing the function to throttle the scanning rate
- BImporting a library that allows use of workers
- CReplacing the function with a loop
- DChanging the port list from a tuple to a dictionary for better lookup speed
How the community answered
(41 responses)- A7% (3)
- B76% (31)
- C15% (6)
- D2% (1)
Explanation
Using a worker-based concurrency approach (such as a thread/process pool) allows the script to scan multiple targets in parallel, significantly improving throughput for network I/O-bound tasks like port enumeration.
Topics
Community Discussion
No community discussion yet for this question.