nerdexam
CompTIA

PT0-001 · Question #135

A penetration tester is scanning a network for SSH and has a list of provided targets. Which of the following Nmap commands should the tester use?

The correct answer is A. nmap -p 22 -iL targets. The Nmap -iL flag reads target hosts from an input file, making it the correct choice when scanning a provided list of targets on a specific port.

Reconnaissance and enumeration

Question

A penetration tester is scanning a network for SSH and has a list of provided targets. Which of the following Nmap commands should the tester use?

Options

  • Anmap -p 22 -iL targets
  • Bnmap -p 22 -sL targets
  • Cnmap -p 22 -oG targets
  • Dnmap -p 22 -oA targets

How the community answered

(46 responses)
  • A
    91% (42)
  • B
    4% (2)
  • C
    2% (1)
  • D
    2% (1)

Why each option

The Nmap -iL flag reads target hosts from an input file, making it the correct choice when scanning a provided list of targets on a specific port.

Anmap -p 22 -iL targetsCorrect

The -p 22 flag restricts the scan to SSH port 22, and -iL (input list) instructs Nmap to read target IP addresses or hostnames from the specified file. Together, these flags perform a targeted SSH port scan against every host in the provided list, which matches the scenario exactly.

Bnmap -p 22 -sL targets

-sL performs a list scan that only resolves and enumerates hostnames without sending probe packets to any port, so no actual SSH scan is conducted.

Cnmap -p 22 -oG targets

-oG specifies grepable output format for writing scan results to a file and has no function for reading an input list of targets.

Dnmap -p 22 -oA targets

-oA outputs scan results simultaneously in normal, XML, and grepable formats and is strictly an output option, not an input mechanism.

Concept tested: Nmap -iL flag for scanning from an input target list

Source: https://nmap.org/book/man-input-output.html

Topics

#Nmap#SSH scanning#port scanning#target list

Community Discussion

No community discussion yet for this question.

Full PT0-001 Practice