chatting and transfer file with netcat

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 -p 5678

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

Client:


nc 192.168.1.1 5678

Okay, 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 -p 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.mp3

File 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.

source



Thank you for reading this post. You can now Leave A Comment (0) or Leave A Trackback.

Post Info

This entry was posted on Tuesday, February 27th, 2007 and is filed under Uncategorized.

You can follow any responses to this entry through the Comments Feed. You can Leave A Comment, or A Trackback.



Previous Post: Set Up A Fileserver For Small/Medium Enterprises With SME Server 7.1 »
Next Post: RISC OS 5.13 Available for Download »

Read More

Related Reading:



Leave a Reply

Note: Any comments are permitted only because the site owner is letting you post, and any comments will be removed for any reason at the absolute discretion of the site owner.