Friday, June 10, 2011

NC to CHAT and transfer file!

NETCAT, or sometimes the command known as nc capable of doing a lots of thing. The examples of how to use nc to scan open ports showing here.

Here, using netcat to initiate a private chat, we need a listener server with open port and a client connect to the listener server.

Listener: (IP: 192.168.1.1)

nc -l 5678-l is listen, -p is to specify port.

Client:

nc 192.168.1.1 5678Okay, both side can start chatting.

The same way for file transfer. Let say listener server as a file receiver and client as a sender.

Listener: (Receiver)

nc -vv -l 5678 > dump.mp3-vv is make the transaction very verbose, so that you will know what is happening.

Client: (Sender)

nc 192.168.1.1 5678 < dump.mp3File transfer using nc usually fast, because it do not do encryption/decryption over the communication. It is good for transfer file from point to point or in LAN. You can do it over internet but you need to make sure you have do port forwarding on the listener port.

No comments:

Post a Comment