ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 45 - PT0-002 discussion

Report
Export

A penetration tester conducted a discovery scan that generated the following:

Which of the following commands generated the results above and will transform them into a list of active hosts for further analysis?

A.
nmap -oG list.txt 192.168.0.1-254 , sort
Answers
A.
nmap -oG list.txt 192.168.0.1-254 , sort
B.
nmap -sn 192.168.0.1-254 , grep "Nmap scan" | awk '{print S5}'
Answers
B.
nmap -sn 192.168.0.1-254 , grep "Nmap scan" | awk '{print S5}'
C.
nmap --open 192.168.0.1-254, uniq
Answers
C.
nmap --open 192.168.0.1-254, uniq
D.
nmap -o 192.168.0.1-254, cut -f 2
Answers
D.
nmap -o 192.168.0.1-254, cut -f 2
Suggested answer: B

Explanation:

the NMAP flag (-sn) which is for host discovery and returns that kind of NMAP output. And the AWK command selects column 5 ({print $5}) which obviously carries the returned IP of the host in the NMAP output.

This command will generate the results shown in the image and transform them into a list of active hosts for further analysis. The command consists of three parts:

nmap -sn 192.168.0.1-254: This part uses nmap, a network scanning tool, to perform a ping scan (-sn) on the IP range 192.168.0.1-254, which means sending ICMP echo requests to each IP address and checking if they respond.

grep "Nmap scan": This part uses grep, a text filtering tool, to search for the string "Nmap scan" in the output of the previous part and display only the matching lines. This will filter out the lines that show the start and end time of the scan and only show the lines that indicate the status of each host.

awk '{print $5}': This part uses awk, a text processing tool, to print the fifth field ($5) of each line in the output of the previous part. This will extract only the IP addresses of each host and display them as a list.

The final output will look something like this:

192.168.0.1 192.168.0.12 192.168.0.17 192.168.0.34

asked 02/10/2024
Samori Augusto
43 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first