Which Nmap Command Generates a List of Active Hosts from a Discovery Scan?
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? - 
Community Votes
100% of anonymous learners picked answer B. Votes are pick records left by other test-takers — they are not the verified answer.
Community Insight
The exam tests your understanding of Nmap flags and output parsing; the trap is confusing host discovery (-sn) with port scanning options like --open or -O.
Discover the correct Nmap command to turn discovery scan output into a list of active hosts. The community agrees that using -sn, grep, and awk (option B) is the reliable method.
A common mistake is choosing option C, which uses --open and sed, but this scans for open ports and does not produce the discovery output shown; the correct approach requires -sn for a ping scan.
Community Discussion (5 comments)
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
Expert Analysis
Why the Answer Is Correct
Option B is correct because nmap -sn performs a ping scan (host discovery without port scanning), which produces "Nmap scan report for" lines. The pipeline grep "Nmap scan" filters for those lines, and awk '{print $5}' extracts the IP address from the fifth field. This directly transforms the scan output into a clean list of active hosts. Community comments [1] and [3] both confirm this exact reasoning.
Why the Other Options Are Wrong
Option A uses -oG for grepable output and pipes to sort, but it does not filter or extract IPs into a list. Option C uses --open (which is not a valid Nmap flag for host discovery) and an odd sed expression. Option D uses -O for OS detection and cut -f is incomplete for extracting IPs. Only B combines the correct Nmap flag with text processing to achieve the goal.
Community Comment Notes
Comment [1] provides a clear breakdown of how the command works, emphasizing that -sn disables port scanning. Comment [4] correctly identifies the output as ping scans with latency times. Comment [5] argues for C, but the use of --open is not appropriate for discovery scans, and the community overwhelmingly supports B with 89 votes.
Official Reference
Exam Strategy
Memorize the purpose of -sn: it performs host discovery only. When parsing Nmap output, remember that 'Nmap scan report for' lines put the IP as field 5, so grep and awk are your friends for creating active host lists.