PT0-002 · Question #188
A penetration tester downloaded the following Perl script that can be used to identify vulnerabilities in network switches. However, the script is not working properly. Which of the following…
The correct answer is B. Remove lines 3, 5, and 6. The Perl script is non-functional due to problematic lines of code. Removing lines 3, 5, and 6 will likely resolve syntax errors or logical issues, allowing the script to execute correctly.
Question
A penetration tester downloaded the following Perl script that can be used to identify vulnerabilities in network switches. However, the script is not working properly. Which of the following changes should the tester apply to make the script work as intended?
Exhibit
Options
- AChange line 2 to $ip= 10.192.168.254;
- BRemove lines 3, 5, and 6.
- CRemove line 6.
- DMove all the lines below line 7 to the top of the script.
How the community answered
(53 responses)- A4% (2)
- B70% (37)
- C9% (5)
- D17% (9)
Why each option
The Perl script is non-functional due to problematic lines of code. Removing lines 3, 5, and 6 will likely resolve syntax errors or logical issues, allowing the script to execute correctly.
Changing the IP address on line 2 would only alter the target of the script, not fix an underlying issue preventing the script from working properly in the first place.
Removing lines 3, 5, and 6 addresses specific syntax errors, unnecessary variable declarations, or conflicting configurations that are preventing the Perl script from executing successfully. Without the actual script, the most direct implication of this answer is that these lines are syntactically or logically incorrect for the script's intended function.
Removing only line 6 would not resolve the issues present on lines 3 and 5, indicating that multiple problematic lines exist.
Moving lines below line 7 to the top is a solution for incorrect function or variable ordering, but it does not address the fundamental issues with specific problematic lines that need removal.
Concept tested: Debugging script errors, Perl syntax
Topics
Community Discussion
No community discussion yet for this question.
