Netcat

Chat

Client (initiating)		Listener (receiving)
nc 10.0.0.2 1234 ------> nc -lp 1234

File Content Transfer

Client (sending)		    Listener (receiving)
nc 10.0.0.2 1234 < file.txt ------> nc -lp 1234 > file.txt

Listener (sending)	       Client (receiving)
nc -lp 1234 < file.txt ------> nc 10.0.0.1 1234 > file.txt

Send Text

Can send text too (this example is sent to localhost):

echo "text" | nc localhost 10000

Using SSH Tunnels (Edit this)

Listener (sending)

nc -l -p 9876 < file.txt

Receiver

Last updated

Was this helpful?