nerdexam
ExamsGCIHQuestions#641
GIAC

GCIH · Question #641

GCIH Question #641: Real Exam Question with Answer & Explanation

The correct answer is A: C:\>nc.exe 10.0.0.1 2222. The basic netcat syntax to initiate an outbound TCP connection is 'nc <host> <port>' with no additional flags. Flags like -l and -L put netcat into listen mode instead of connect mode.

Reconnaissance, Scanning, and Enumeration

Question

Which of the following netcat commands will connect to tcp port 2222 on a remote system (10.0.0.1)?

Options

  • AC:>nc.exe 10.0.0.1 2222
  • BC:>nc.exe 10.0.0.1 -l -p 2222
  • CC:>nc.exe 10.0.0.1 -L 2222
  • DC:>nc.exe 10.0.0.1 -p 2222

Explanation

The basic netcat syntax to initiate an outbound TCP connection is 'nc <host> <port>' with no additional flags. Flags like -l and -L put netcat into listen mode instead of connect mode.

Common mistakes.

  • B. The -l flag places netcat in listen (server) mode, so this command would attempt to bind and listen locally rather than connect outbound to the remote host.
  • C. The -L flag (uppercase) in some netcat variants sets a persistent listen mode, not an outbound connection mode.
  • D. The -p flag specifies the local source port to bind to on the client side, not the destination port, so this command does not correctly specify a remote destination port.

Concept tested. Netcat client syntax for outbound TCP connections

Reference. https://nmap.org/ncat/guide/ncat-man.html

Topics

#netcat#TCP connection#command-line tools#port connection

Community Discussion

No community discussion yet for this question.

Full GCIH Practice