10. Serve a static web page as a web server.

Now go to http://<host_ip_address>:8000/test.html to access it. Note that in order to use a well known port 80, you will need to run nc with root privilege as follows.

$ while true; do sudo nc -lp 80 < test.html; done

11. (Insecure) online chat between two hosts.

On one host (192.168.233.203):

$ nc -lp 5000

On another host:

$ nc 192.168.233.203 5000

After running the above commands, anything typed on either host appears on the other host’s terminal.

12. Launch a “remote shell” which allows you run from local host any commands to be executed on a remote host.

On a remote host (192.168.233.208):

$ nc -lp 5000 -e /bin/bash

On local host:

$ nc 192.168.233.208 5000

After running the above command on local host, you can start running any command from local host’s terminal. The command will be executed on the remote host, and the output of the command will appear on local host. This setup can be used to create a backdoor on a remote host.

13. Create a web proxy for a particular website (e.g., google.com).

The above commands create a named pipe proxypipe, and use nc to redirect all incoming TCP/5000 connections to http://www.google.com via the bidirectional pipe. With this setup, you can access Google by going to http://127.0.0.1:5000.