nerdexam
CompTIA

CS0-003 · Question #39

A security analyst is trying to identify anomalies on the network routing. Which of the following functions can the analyst use on a shell script to achieve the objective most accurately?

The correct answer is D. function x() { info=$(traceroute -m 40 $1 | awk 'END{print $1}') && echo "$1 | $info" }. This shell function uses traceroute to trace the route packets take to reach the destination specified by $1. The -m 40 option specifies a maximum of 40 hops for the trace. The awk 'END{print $1}' part extracts the final hop from the traceroute output, and then the function…

Submitted by yousef_jo· Mar 6, 2026Security operations

Question

A security analyst is trying to identify anomalies on the network routing. Which of the following functions can the analyst use on a shell script to achieve the objective most accurately?

Options

  • Afunction x() { info=$(geoiplookup $1) && echo "$1 | $info" }
  • Bfunction x() { info=$(ping -c 1 $1 | awk -F "/" 'END{print $5}') && echo "$1 | $info" }
  • Cfunction x() { info=$(dig $(dig -x $1 | grep PTR | tail -n 1 | awk -F ".in-addr" '{print $1}
  • Dfunction x() { info=$(traceroute -m 40 $1 | awk 'END{print $1}') && echo "$1 | $info" }

How the community answered

(54 responses)
  • A
    11% (6)
  • B
    4% (2)
  • C
    4% (2)
  • D
    81% (44)

Explanation

This shell function uses traceroute to trace the route packets take to reach the destination specified by $1. The -m 40 option specifies a maximum of 40 hops for the trace. The awk 'END{print $1}' part extracts the final hop from the traceroute output, and then the function echoes the destination and the info.

Topics

#network analysis#traceroute#shell scripting#network routing

Community Discussion

No community discussion yet for this question.

Full CS0-003 Practice