nerdexam
GIAC

GPEN · Question #115

Which of the following commands can be used for port scanning?

The correct answer is A. nc -z. Netcat's -z flag enables zero-I/O mode, which sends no data and is used specifically for port scanning to check which ports are open.

Vulnerability Discovery & Scanning

Question

Which of the following commands can be used for port scanning?

Options

  • Anc -z
  • Bnc -t
  • Cnc -w
  • Dnc 璯

How the community answered

(46 responses)
  • A
    78% (36)
  • B
    7% (3)
  • C
    13% (6)
  • D
    2% (1)

Why each option

Netcat's -z flag enables zero-I/O mode, which sends no data and is used specifically for port scanning to check which ports are open.

Anc -zCorrect

The nc -z flag activates zero-I/O mode in Netcat, where it connects to a port to determine if it is open without sending or receiving any data. This makes it functionally equivalent to a basic port scan, allowing a user to quickly sweep a range of ports - for example, nc -z host 20-80 - to identify listening services.

Bnc -t

nc -t enables TELNET protocol negotiation in the connection, which is unrelated to port scanning.

Cnc -w

nc -w sets a timeout in seconds for idle connections, controlling how long Netcat waits before giving up, not performing a port scan.

Dnc 璯

The character shown is a corrupted or invalid argument and does not correspond to any recognized Netcat flag.

Concept tested: Netcat zero-I/O mode for port scanning

Source: https://man7.org/linux/man-pages/man1/ncat.1.html

Topics

#netcat#port scanning#nc -z flag#network reconnaissance

Community Discussion

No community discussion yet for this question.

Full GPEN Practice