I have found the perfect solution to write scripts which send files across machines over the Internet using netcat.

On the machine receiving files I do nc -l -p 1234 -k and then on the machines sending I use scripts which basically use some form of ncat 1234<some_file.

But this is very dangerous because anyone on the Internet can spawn a shell on the listening "server" machine or at least execute commands on it.

I can't use any sort of encryption or key because it would get easily leaked from the machines sending these files.

I am basically looking for a way to make netcat safely open the port and receive anything without risk. If this is not possible or still too dirty or risky to do, then I'm open to suggestions for other methods other than netcat to achieve this. Thanks in advance ;)

  • 2
    Why are you trying to reinvent secure copying tools such as scp, sftp, and even my favourite, rsync (over ssh)? – roaima Jul 13 at 0:01
  • because i'm a moron, thanks, will use this ssh stuff then – cablewelo2ma Jul 18 at 13:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.