Monday, March 17, 2014

Lesson 56 - The Cat and the Invisible Pipe

As promised, today it was a day for nc hacking.

First we discussed protocols and addresses. Like 

  • snailmail protocol, where your address consists of your name, street address and zip etc. 
  • email protocol and email address
  • telephone protocol, where the telephone address is the protocol
  • computers talk with TCP/IP protocol and they have an IP address. 
So, we dug out the IP address of her computer using ifconfig. I explained that we are going to create a "pipe" between our computers to be able to send messages and that we're going to use Netcat (nc) for that. I explained also that in TCP/IP you need to use the IP address and a "port" which is just a number and has to be quite big. We agreed on port 10100. I had her write down the IP and the port.



Then we started Netcat on her machine, and made it "listen to" port 10100.

    nc -l 10100

Such excitement! Nothing happend though. The computer is waiting for the other one to connect.



Then we went to my machine and connected it to hers.

    nc 192.168.1.10 10100

So hack! But nothing happens here either. But when I told her that we can now send secret messages though the INVISIBLE PIPE that we just created, her eyes started to glare. So we started chatting through the invisible pipe (a TCP socket really). It even worked when I took my computer downstairs!

After that we did the same but directed the output from Netcat to a local file, as in


    nc -l 10100 >sala

So now we sent message to each other, so that the recipient could only read the message from the file on their machine. She used vim to read the message I had sent to her.

    vim sala

Now she's replying to me using email. Very internet!

No comments:

Post a Comment