nerdexam
CompTIACompTIA

XK0-005 · Question #1713

XK0-005 Question #1713: Real Exam Question with Answer & Explanation

The correct answer is B: function x() { info=$(ping -c 1 $1 | awk -F "/" 'END {print $5}'); echo "$1 | $info" }. The ping command is used to measure network latency. The function provided uses ping -c 1 to ping the target once and extracts the average round-trip time using awk. This is a simple and effective way to monitor network latency during a scan or other network activity.

Scripting, Containers, and Automation

Question

A security analyst is monitoring the network to identify latency or slowdowns during a vulnerability scan. Which of the following functions will best achieve this? bash function x() { info=$(ping -c 1 $1 | awk -F "/" 'END {print $5}') echo "$1 | $info" }

Options

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

Explanation

The ping command is used to measure network latency. The function provided uses ping -c 1 to ping the target once and extracts the average round-trip time using awk. This is a simple and effective way to monitor network latency during a scan or other network activity.

Topics

#Bash Scripting#Networking#Network Monitoring#Command-line Utilities

Community Discussion

No community discussion yet for this question.

Full XK0-005 PracticeBrowse All XK0-005 Questions