exam questions

Exam PT0-002 All Questions

View all questions & answers for the PT0-002 exam

Exam PT0-002 topic 1 question 314 discussion

Actual exam question from CompTIA's PT0-002
Question #: 314
Topic #: 1
[All PT0-002 Questions]

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
  • B. nmap –sn 192.168.0.1-254 | grep “Nmap scan” | awk ‘{print $5}’
  • C. nmap ––open 192.168.0.1-254 | uniq | sed ‘s/Nmap//2’ > file.txt
  • D. nmap –O 192.168.0.1-254 | cut –f
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
PhillyCheese
11 months, 2 weeks ago
Selected Answer: B
Explanation: -sn disables port scanning and performs host discovery only. grep "Nmap scan" filters the output to lines containing the phrase “Nmap scan.” awk '{print $5}' extracts the fifth field (IP addresses) from the filtered lines1. This provides a list of active hosts.
upvoted 4 times
...
DustyRex1
1 year ago
Selected Answer: B
This command performs a ping scan (-sn) to identify which hosts are up in the given range (192.168.0.1-254), filters the lines containing "Nmap scan" using grep, and then extracts the fifth field (the IP address) using awk.
upvoted 2 times
...
ER1
1 year, 1 month ago
Selected Answer: B
The output are ping scans, identifiable because they have latency times.
upvoted 2 times
...
Big_Dre
1 year, 1 month ago
Selected Answer: C
The given command uses nmap, uniq, and sed to perform a scan on a range of IP addresses, filter the output, and save the results to a file. Here's a breakdown of each part of the command: nmap ––open 192.168.0.1-254: This command uses nmap to perform a scan (-–open) on the IP range from 192.168.0.1 to 192.168.0.254. The --open option tells nmap to show only the hosts with at least one open port. | uniq: The uniq command filters the output to remove duplicate lines. This can be useful if there are repeated entries in the nmap output. | sed ‘s/Nmap//2’: The sed command is used to perform a substitution (s) operation on the output. Specifically, it removes the second occurrence of the word "Nmap" from each line. > file.txt: This part of the command redirects the processed output to a file named file.txt. In summary, the command scans the specified IP range to identify hosts with open ports, removes duplicate lines from the output, removes the second occurrence of the word "Nmap" from each line, and then saves the processed output to a file named file.txt.
upvoted 1 times
...
aee9303
1 year, 2 months ago
nmap –sn 192.168.0.1-254 | grep “Nmap scan” | awk ‘{print $5}’ The output are ping scans, identifiable because they have latency times. Ping: -sn The piping is taking the one thing and adding the next. awk is outputting to a table, in this case it means to output by printing the five scans (to the screen).
upvoted 3 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...