Valid PT0-003 Dumps shared by ExamDiscuss.com for Helping Passing PT0-003 Exam! ExamDiscuss.com now offer the newest PT0-003 exam dumps, the ExamDiscuss.com PT0-003 exam questions have been updated and answers have been corrected get the newest ExamDiscuss.com PT0-003 dumps with Test Engine here:
A penetration tester creates a list of target domains that require further enumeration. The tester writes the following script to perform vulnerability scanning across the domains: line 1: #!/usr/bin/bash line 2: DOMAINS_LIST = "/path/to/list.txt" line 3: while read -r i; do line 4: nikto -h $i -o scan-$i.txt & line 5: done The script does not work as intended. Which of the following should the tester do to fix the script?
Correct Answer: D
The issue with the script lies in how the while loop reads the file containing the list of domains. The current script doesn't correctly redirect the file's content to the loop. Changing line 5 to done < "$DOMAINS_LIST" correctly directs the loop to read from the file. Step-by-Step Explanation * Original Script: DOMAINS_LIST="/path/to/list.txt" while read -r i; do nikto -h $i -o scan-$i.txt & done * Identified Problem: * The while read -r i; do loop needs to know which file to read lines from. Without redirecting the input file to the loop, it doesn't process any input. * Solution: * Add done < "$DOMAINS_LIST" to the end of the loop to specify the input source. * Corrected script: DOMAINS_LIST="/path/to/list.txt" while read -r i; do nikto -h $i -o scan-$i.txt & done < "$DOMAINS_LIST" * Explanation: * done < "$DOMAINS_LIST" ensures that the while loop reads each line from DOMAINS_LIST. * This fix makes the loop iterate over each domain in the list and run nikto against each. * References from Pentesting Literature: * Scripting a