Skip to content

Commit

Permalink
Update descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
ConnorNelson committed Feb 21, 2025
1 parent 3d290bc commit 2a1838a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion intercepting-communication/level-1/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
From your host at 10.0.0.1, connect to the remote host at 10.0.0.2 on port 31337.

A great way to do this is to use the `nc` command (pronounced "netcat"), which allows you to open network connections from the command line.
A great way to do this is to use the netcat command, which allows you to open network connections from the command line.
For example, to connect to the remote host at 10.0.0.42 on port 4242, you would run:

```sh
Expand Down
4 changes: 2 additions & 2 deletions intercepting-communication/level-1a/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
From your host at 10.0.0.1, connect to the remote host at 10.0.0.2 on port 31337, and send the message: `Hello, World!`.

As before, you'll want to use the `nc` command.
As before, you'll want to use the netcat command.

You'll notice that `nc` will hang (e.g. you will not get a shell prompt back), waiting until the connection is closed.
You'll notice that netcat will hang (e.g. you will not get a shell prompt back), waiting until the connection is closed.
You can, as with most hanging processes, kill the process by pressing `Ctrl-C`.

In this challenge though, you need to send a message to the remote host.
Expand Down
12 changes: 6 additions & 6 deletions intercepting-communication/level-1b/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
From your host at 10.0.0.1, connect to the remote host at 10.0.0.2 on port 31337, and then shut down the connection.
From your host at 10.0.0.1, connect to the remote host at 10.0.0.2 on port 31337, and then shutdown the connection.

As before, you'll want to use the `nc` command.
As before, you'll want to use the netcat command.

Sometimes the other side of a connection wants to wait for you to finish sending all of your data before it finishes sending data back to you.
Imagine a protocol where the client might need to send lots of data, over a long duration, before the server can respond with some final result.
Expand All @@ -11,10 +11,10 @@ One option would be to have the client send a single packet at the end that just
But network packets can be complicated, with no guarantees from the network that they won't be split apart or merged together.
Or what if you want to be able to send "END" as part of the data?

Fortunately, TCP provides a solution to this problem, with the TCP "FIN" flag.
When a client sends a packet with the FIN flag set, it is saying "I'm done sending data, but I'm still listening for data from you."

Netcat is ultimately a simple tool, that translates data from standard input to network packets and vice versa to standard output.
So how do you send a packet with the FIN flag set?
So how do you shutdown the network connection in this way?
You do the equivalent file operation: you close standard input!
In an interactive terminal session, you can do this by pressing `Ctrl-D`.

Unfortunately, netcat may not actually do this by default.
Review the man page for `nc` (`man nc`) to see if there is any way to configure netcat to shutdown the network connection after closing standard input (EOF).

0 comments on commit 2a1838a

Please sign in to comment.