GCIH · Question #500
Analyze the following command. What will this command do? $ nc -1 -p 443 -e /bin/csh
The correct answer is D. Listen on port 443 and return a shell to connecting hosts. The Netcat command nc -l -p 443 -e /bin/csh sets up a listener on port 443 that spawns a C shell for any host that connects to it.
Question
Analyze the following command. What will this command do? $ nc -1 -p 443 -e /bin/csh
Options
- AProvide an encrypted login shell to act as a proxy relay
- BConnect to port 443 of a remote host and provide a shell relay
- CImpersonate the HTTPS process and hide it using a shell process
- DListen on port 443 and return a shell to connecting hosts
How the community answered
(37 responses)- A5% (2)
- B3% (1)
- C3% (1)
- D89% (33)
Why each option
The Netcat command `nc -l -p 443 -e /bin/csh` sets up a listener on port 443 that spawns a C shell for any host that connects to it.
Netcat does not provide encryption and transmits all traffic in cleartext, so this command cannot create an encrypted login shell.
The `-l` flag means listen mode, not connect mode - this command waits for incoming connections rather than connecting outbound to a remote host.
Listening on port 443 does not impersonate or interact with the HTTPS protocol because no SSL/TLS is involved and the command simply binds that port number to a shell process.
The `-l` flag puts Netcat into listen mode, causing it to wait for incoming connections rather than initiating one. The `-p 443` option specifies the local port to listen on, and `-e /bin/csh` executes the C shell and ties its input/output to the network connection. Any remote host that connects to port 443 receives an interactive shell session.
Concept tested: Netcat listen mode with shell execution flags
Topics
Community Discussion
No community discussion yet for this question.