Jared
Jared

Reputation: 3892

Sending Primitive Message across Internet using TCP/IP

Is there a very primitive method or protocol to send messages from two machines not on the same local network? I don't know what is available, but is there a terminal or prompt method for sending plaintext messages over the internet? Is it simple enough to code it from scratch?

Can I send a simple plaintext message from one machine to the next (if I have that machine's information) and then toy around with adding encryption and other crytopgraphy methods as an exercise?

Upvotes: 0

Views: 263

Answers (2)

Mark Setchell
Mark Setchell

Reputation: 207550

You need netcat or sometimes called nc. It is on most Linux distros and OSX and available for Windows too.

Examples available here.

Documentation here.

On a server, run

$ nc -l 2389 > receivedfile

to listen on port 2389 and write whatever it receives to file "test"

And on the client, send a file to that port

cat yourfile | nc localhost 2389

or send a message

echo Hello | nc localhost 2389

Once you have got straightforward file transfer working, you can send an encrypted file like this:

openssl enc -aes-256-cbc -salt -in yourfile | nc localhost 2389

Upvotes: 1

ModusPwnins
ModusPwnins

Reputation: 156

It sounds like telnet will do the job you're looking for. It's the most primitive protocol I can think of for this use case.

All data octets except 0377 are transmitted over the TCP transport as is. Therefore, a Telnet client application may also be used to establish an interactive raw TCP session[.]

Upvotes: 0

Related Questions