nerdexam
CompTIACompTIA

PT0-002 · Question #188

PT0-002 Question #188: Real Exam Question with Answer & Explanation

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.

Tools and Code Analysis

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?

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.

Explanation

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.

Common mistakes.

  • A. 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.
  • C. Removing only line 6 would not resolve the issues present on lines 3 and 5, indicating that multiple problematic lines exist.
  • D. 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

#Perl Scripting#Script Debugging#Vulnerability Scanning#Penetration Testing Tools

Community Discussion

No community discussion yet for this question.

Full PT0-002 PracticeBrowse All PT0-002 Questions