PT0-003 · Question #154
A penetration tester writes a Bash script to automate the execution of a ping command on a Class C network: Which of the following pieces of code should the penetration tester use in place of the -- p
The correct answer is B. seq 1 254. The Bash script is designed to ping all IP addresses in a Class C network (192.168.10.1 to 192.168.10.254). The missing placeholder should generate a sequence of numbers from 1 to The correct syntax for iterating over a numerical range in Bash is: - seq 1 254 – Generates numbers
Question
Options
- Acrunch 1 254 loop
- Bseq 1 254
- Cecho 1-254
- D{1.-254}
How the community answered
(18 responses)- B78% (14)
- C17% (3)
- D6% (1)
Explanation
The Bash script is designed to ping all IP addresses in a Class C network (192.168.10.1 to 192.168.10.254). The missing placeholder should generate a sequence of numbers from 1 to The correct syntax for iterating over a numerical range in Bash is: - seq 1 254 – Generates numbers 1 to 254, which are appended to 192.168.10.$var. - The loop pings each host once (-c 1) in the range 192.168.10.1 to 192.168.10.254.
Topics
Community Discussion
No community discussion yet for this question.