#TIL : Create tiny chat channel via netcat

In a network, you can create a tiny chatting channel using netcat. It’s lightweight TCP protocol with plain-text transmission, so be carefully on using.

First, create a channel by picking port number (ex: 7777)

1
$ sudo nc -l 0.0.0.0 7777

Then, tell you friend your IP and channel port. He will use this info to connect the channel

1
$ nc 192.168.1.2 7777

Finnally, start chatting !! Each message will be send when you press [Enter]

Note: End the session by press Ctrl + D

netcat chatting

#TIL : Send a file through networking via netcat

If you’re working on 2 machines in same networking and want to send a file from machine A to machine B. But you don’t have USB, floopy disk :lol: or insanse Bluetooth. There is simple way to send a file to another computer without setting up SSH or SMB (althrough these way are safer than it).

On the machine A (with IP address : 192.168.1.2)

1
$ cat data.txt | sudo nc -l 0.0.0.0 6666

On the machine B

1
$ nc 192.168.1.2 6666 > here_the_data.txt

Have fun playing net😼 !! ;)