Skip to content

Instantly share code, notes, and snippets.

@eruffaldi
Last active December 20, 2017 14:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eruffaldi/4fc12cbd4001a464d2af93e12c208488 to your computer and use it in GitHub Desktop.
Save eruffaldi/4fc12cbd4001a464d2af93e12c208488 to your computer and use it in GitHub Desktop.
Simple Network Transfer

Direct

Receiver: nc -q2 -l 12345 > myfile.tar

Sender tar cf - FILES --verbose --checkpoint=64000 | nc IPDEST 12345

This can be reversed in direction

Encyprion

SHARED_SECRET="shared secret"

OPENSSL="openssl" OPENSSL_CMD="$OPENSSL enc -a -A -aes-256-cbc"

INPUT | $OPENSSL_CMD -e -k "$SHARED_SECRET" | nc IPDEST 12345 nc -q2 -l 12345 | $OPENSSL_CMD -d -k "$SHARED_SECRET"

http://www.dest-unreach.org/socat/doc/socat-openssltunnel.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment