nerdexam
CompTIA

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

Submitted by luis.pe· Mar 6, 2026Reconnaissance and Enumeration

Question

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 -- placeholder? MISSING-TEXT--

Options

  • Acrunch 1 254 loop
  • Bseq 1 254
  • Cecho 1-254
  • D{1.-254}

How the community answered

(18 responses)
  • B
    78% (14)
  • C
    17% (3)
  • D
    6% (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

#Bash scripting#network scanning#ping sweep#seq command

Community Discussion

No community discussion yet for this question.

Full PT0-003 Practice