Netcat as tools in examples part1

NetcatNet cat is very usefull tool file transfer and port scan .

File transer
As server file
If you wont share file from serwer

Server (ip

tar c /home/jacek | nc -q 20 -l - p 6111

-l – start as server mode localhost on port 6111
-q 20 How many time his waiting after having seen an end of file in standard input

Client/Receiver (

nc -w 20 6111 > myhome.tar

And you can also clone partition with dd

nc -l -p 101 | dd of /dev/sda


dd id=/dev/sda | nc 101

Normal File trensfer
Listener (ip

nc -vv -l 1234 >

Client send file

nc 1234 <

I am here show you how to perform port scanning method with nc
To scan for a TCP port 22

nc -zv

To scan for a UDP port 22

nc -zuv

To scan a range of UDP port 1-1000

nc -zuv 1-1000

Simple Proxy
Route witch container

mkfifo prox1

nc -l -p 80 0<proxy1 | nc  80 1>proxy1 

Uplod photo files from camera on port

while [ 1 ]; do streamer -o /var/plot.png; nc -l 1717 < /var/plot.png; done

or from print screen

while true; do import -window root /tmp/image.png; nc -vv -l -p 101 < /tmp/image.png; done


Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s