Ticker

6/recent/ticker-posts

Header Ads Widget

Shared Hosting with Namecheap. Free .Website domain & WhoisGuard

Transferring files with netcat {nc}


Why? If you ever are in the situation of being stuck behind a firewall or VPN connection and want to transfer a file from the machine inside the VPN or firewalled back to your local desktop.
On the server we’re going to pipe the output of file through cat and set netcat to listen on port 4009
# cat file-i-want-to-send.ext | nc -l 4009
On my desktop im going to open a nc session to port 4009 and redirect the output to a local file.
# nc server.ip.address 4009 > file-i-want-to-recieve.ext
And viola! you can verify the file is intact by doing a md5sum on the server and compare it to the one locally
On Server
# md5sum file-i-want-to-send.ext
# e4ef527eac8f5afe26d8464a963694ad file-i-want-to-send.ext
On Client
# md5sum file-i-want-to-recieve.ext
# e4ef527eac8f5afe26d8464a963694ad file-i-want-to-recieve.ext

Post a Comment

0 Comments