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…
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)- A11% (6)
- B4% (2)
- C4% (2)
- D81% (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
Community Discussion
No community discussion yet for this question.