LAB: netcat and some of its friends

Remember nc time-server 13 from the wireshark assignment? We're going to play a little more with nc. It's fun, and some comfort with nc will come in very handy during the next couple weeks.

Setup

You're going to want two terminals, preferably but not necessarily on separate hosts. For example:

Make sure both terminals have nc installed.

Make sure at least one terminal has python3 installed.

Make sure one of your hosts has Wireshark installed

A simple chat

For the rest of this document, I'm going to call one of your terminals "host1", and the other "host2". For my personal setup, host1 will be Kali in a VMWare VM, and host2 will be my macOS machine, but your setup will be whatever you choose.

Variations with nc

Easy web server with python


Your Carleton user name, lower case:

For the Chat, the listener was on host1. Can you do the same thing in reverse, with the listener on host2?

Is port 5000 special? Can you use a different port for these exercises?

What protocol does Wireshark show for the Chat communications?

Are the Chat packets encrypted? Why or why not?

Can you do the Chat thing between your own computer and a classmate's computer? What happens when you try?

Describe briefly what is happening when you do nc -l -p 5000 > destination_filename (on host2) and cat filename | nc HOST2_IP 5000 (on host1).

If you use Wireshark to watch the curl/python3 interaction, what do you see?

Can you use nc instead of curl as your client for the python3 web server? How?

Any questions?