ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 29 - CS0-003 discussion

Report
Export

A security analyst is writing a shell script to identify IP addresses from the same country. Which of the following functions would help the analyst achieve the objective?

A.
function w() { info=$(ping -c 1 $1 | awk -F ''/'' 'END{print $1}') && echo ''$1 | $info'' }
Answers
A.
function w() { info=$(ping -c 1 $1 | awk -F ''/'' 'END{print $1}') && echo ''$1 | $info'' }
B.
function x() { info=$(geoiplookup $1) && echo ''$1 | $info'' }
Answers
B.
function x() { info=$(geoiplookup $1) && echo ''$1 | $info'' }
C.
function y() { info=$(dig -x $1 | grep PTR | tail -n 1 ) && echo ''$1 | $info'' }
Answers
C.
function y() { info=$(dig -x $1 | grep PTR | tail -n 1 ) && echo ''$1 | $info'' }
D.
function z() { info=$(traceroute -m 40 $1 | awk 'END{print $1}') && echo ''$1 | $info'' }
Answers
D.
function z() { info=$(traceroute -m 40 $1 | awk 'END{print $1}') && echo ''$1 | $info'' }
Suggested answer: B

Explanation:

The function that would help the analyst identify IP addresses from the same country is:

function x() { info=$(geoiplookup $1) && echo ''$1 | $info'' }

This function takes an IP address as an argument and uses the geoiplookup command to get the geographic location information associated with the IP address, such as the country name, country code, region, city, or latitude and longitude. The function then prints the IP address and the geographic location information, which can help identify any IP addresses that belong to the same country.

asked 02/10/2024
MARIO CRUZ
40 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first