This week on HakTip Shannon is using Netcat to make two processes talk to each other on a network!
How to make Netcat talk to other processes:
We have learned how to use Netcat to chat with another computer, and how to push a file transfer. Today, I’m going to show you how to use Netcat to make two processes talk to each other on a network. I want to send all of my files in a directory to my Linux machine. My Windows machine (10.73.31.59) will send a directory to my Linux machine. So on the sender computer:
Type tar -cf – /foldername | nc -l -p 1337
On my W8 computer:
Type nc 10.73.31.145 1337 | tar -xf –
Now my new pictures and directory have been transferred!
I can also copy just one file, which we did similarly in a past HakTip (ep 83):
Sender- Type cat web.jpeg | nc -l -p 1337
On W8, Type nc 10.73.31.145 1337 > web.jpeg
And to copy over and restore the whole freakin HDD:
sender: cat /dev/hdb | nc -l -p 1337
On my second comp, type nc 10.73.31.59 1337 > /dev/hdb
With that said, I wouldn’t recommend using Netcat to transfer your entire disc. If there are any errors during transfer, it’s not going to tell you. You can choose to use DD to duplicate your disc with Netcat (but even so, make sure you know what you are doing so it doesn’t end up being standing for Destroyer of Discs).
After the break, I’ll show you how to set up a quick proxy!
I’ll be wrapping up my Netcat series in the next week or so, so if you have questions, send me a comment below or email us at TIPS.
And be sure to check out our sister show, Hak5 for more great stuff just like this. I’ll be there, reminding you to trust your technolust.