Skip to content

Netcat an easy tool

2008 May 13
by Philippe Delodder

Imagine need to make a tar
file but no space left on local disk. You can use netcat to transfer
the tar file to an other networked machine.

The is as the sender being the server:

tar cf directory | nc -l -p 2048

But you can als connect the sender to the receiver:

tar cf directory | nc remotehost 2048

The receive connecting to the sender and storing the datastream at giving location:

nc remotehost 2048 > nameoftar.tar

The receiving end is running as server waiting for an incoming connection:

nc -l -p 2048 > nameoftar.tar

Note: if you uses gzip or bzip2, change the file to look soemthing like this:.tar.gz or .tar.bz2

Some usefull information(from wikipedia):

Netcat was voted the second most useful network security tool in a 2000 poll conducted by insecure.org on the nmap users mailing list.[1] In 2003, it gained fourth place,[2] a position it also held in the 2006 poll.[3]

If there are suggetions on the use onf netcat please let me know.

No comments yet

Leave a Reply

Note: You can use basic XHTML in your comments. Your email address will never be published.

Subscribe to this comment feed via RSS

Bad Behavior has blocked 203 access attempts in the last 7 days.