Which tool can transfer files using arbitrary TCP/UDP ports, provided it is installed on the machine?

Study for the SANS560 GIAC Penetration Tester (GPEN) Test. Study with flashcards and multiple choice questions, each question has hints and explanations. Get ready for your exam!

Multiple Choice

Which tool can transfer files using arbitrary TCP/UDP ports, provided it is installed on the machine?

Explanation:
Netcat can transfer files over any TCP or UDP port because it acts as a simple data pipe that can listen on or connect to a chosen port. Once Netcat is installed on both machines, you pick a port and stream bytes between a file and the network socket, without being tied to a predefined file-transfer protocol. This makes it ideal for quick, flexible transfers, unlike FTP which relies on specific control and data channels on standard ports, or SSH/SFTP which use their own secured channels on designated ports. For a TCP transfer: on the receiving machine, run a listener and redirect the incoming data to a file, e.g., nc -l 1234 > received.bin; on the sending machine, connect to the listener and feed the file, e.g., nc target-host 1234 < file.bin. If you prefer UDP, add -u to both commands to use the UDP datagrams (note that UDP is not reliable, so ensure the transfer and error handling are appropriate). Netcat’s ability to operate on any port is what makes it suitable for this kind of arbitrary-port file transfer.

Netcat can transfer files over any TCP or UDP port because it acts as a simple data pipe that can listen on or connect to a chosen port. Once Netcat is installed on both machines, you pick a port and stream bytes between a file and the network socket, without being tied to a predefined file-transfer protocol. This makes it ideal for quick, flexible transfers, unlike FTP which relies on specific control and data channels on standard ports, or SSH/SFTP which use their own secured channels on designated ports.

For a TCP transfer: on the receiving machine, run a listener and redirect the incoming data to a file, e.g., nc -l 1234 > received.bin; on the sending machine, connect to the listener and feed the file, e.g., nc target-host 1234 < file.bin. If you prefer UDP, add -u to both commands to use the UDP datagrams (note that UDP is not reliable, so ensure the transfer and error handling are appropriate). Netcat’s ability to operate on any port is what makes it suitable for this kind of arbitrary-port file transfer.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy