CompTIA PenTest+ (PT0-002) — Question 46
The attacking machine is on the same LAN segment as the target host during an internal penetration test. Which of the following commands will BEST enable the attacker to conduct host delivery and write the discovery to files without returning results of the attack machine?
Answer options
- A. nmap -sn -n -exclude 10.1.1.15 10.1.1.0/24 -oA target_txt
- B. nmap -iR 10 -n -oX out.xml | grep "Nmap" | cut -d "" -f5 > live-hosts.txt
- C. nmap -Pn -sV -O -iL target.txt -oA target_text_Service
- D. nmap -sS -Pn -n -iL target.txt -oA target_txtl
Correct answer: A
Explanation
Option A is correct because it uses the '-sn' flag to perform a ping scan, excludes a specific IP, and saves the output to files without displaying results on the terminal. The other options do not effectively match the requirements: B outputs results to the terminal, C focuses on service detection without the desired file output format, and D uses a SYN scan which may not align with the host discovery needs.