nerdexam
EC-Council

312-50V13 · Question #140

What does the following command in netcat do? nc ­l ­u ­p55555 < /etc/passwd

The correct answer is C. grabs the /etc/passwd file when connected to UDP port 55555. This netcat command sets up a UDP listener on port 55555 and redirects the contents of /etc/passwd as input, which will be sent to the first client that connects.

Submitted by stefanr· Mar 6, 2026System Hacking

Question

What does the following command in netcat do? nc ­l ­u ­p55555 < /etc/passwd

Options

  • Alogs the incoming connections to /etc/passwd file
  • Bloads the /etc/passwd file to the UDP port 55555
  • Cgrabs the /etc/passwd file when connected to UDP port 55555
  • Ddeletes the /etc/passwd file when connected to the UDP port 55555

How the community answered

(67 responses)
  • A
    12% (8)
  • B
    6% (4)
  • C
    81% (54)
  • D
    1% (1)

Why each option

This netcat command sets up a UDP listener on port 55555 and redirects the contents of `/etc/passwd` as input, which will be sent to the first client that connects.

Alogs the incoming connections to /etc/passwd file

The command redirects the *content* of `/etc/passwd` *out* over the network to a client, not incoming connections *to* the file.

Bloads the /etc/passwd file to the UDP port 55555

While it involves UDP port 55555, it doesn't 'load' the file to the port as if storing it; it streams its content *through* the port to a connecting client.

Cgrabs the /etc/passwd file when connected to UDP port 55555Correct

The `nc -l -u -p55555` part establishes netcat in listen mode, using UDP, on port 55555. The input redirection `< /etc/passwd` pipes the content of the `/etc/passwd` file into netcat's standard input, so when a remote client connects, netcat will send this file's content to them.

Ddeletes the /etc/passwd file when connected to the UDP port 55555

The command uses input redirection (`<`), which reads from the file, it does not modify or delete it.

Concept tested: Netcat input redirection and listener mode for file transfer

Source: https://linux.die.net/man/1/nc

Topics

#netcat#UDP#file transfer#linux commands

Community Discussion

No community discussion yet for this question.

Full 312-50V13 Practice