0xma Cyber Security Articles




July 9, 2021

Transfer Files with NetCat

In this tutorial we will see how to transfer files from one machine to another machine using netcat. It might come in handy in situations where we are trying to copy some file from one box to another and the only tool at our disposal is netcat.

We have a file called "backup-ssh-identity-files.tgz" in the target machine that we are interested in downloading to our local machine.



This command that we run on our local machine creates a listener and whatever input it receives from the remote machine, it will save it to a file called "backup-ssh-identity-files.tgz".



This command that we run on the target box takes the "backup-ssh-identity-files.tgz" file as its input and transfers it to our local box (10.10.14.5).



In here we can see that the file has been successfully downloaded and we have been able to extract its contents.

If you liked reading this article, you can follow me on Twitter: 0xmaCyberSec.