Warm-Up

The goals of this assignment are to:

  1. Refresh your TCP and UDP programming skills
  2. Learn how to use containers to complete course assignments

Vulnerable Service

Canvas contains a container image1 named netsec_warmup.easy.img.xz that provides a vulnerable network service. The service implements the following protocol:

\[ \begin{align*} C \rightarrow S &: \mathsf{u16}(|\mathsf{challenge}|) \cdot \mathsf{challenge} \\ C \rightarrow S &: \mathsf{u16}(|\mathsf{identifier}|) \cdot \mathsf{identifier} \\ S \rightarrow C &: \mathsf{u16}(|\mathsf{value}|) \cdot \mathsf{value} \\ \end{align*} \]

where \(\mathsf{identifier}\) is a UTF-8 string that is your @northeastern.edu email address, \(|x|\) is the length of a byte array \(x\), \(\mathsf{u16}(x)\) encodes an integer \(x\) as two big-endian bytes, and \(\cdot\) is concatenation.

The only content your program should write to stdout is the following JSON object:

{
    "id": "{{identifier}}",
    "value": "{{base64(value)}}"
}

where base64(x) is the base64 encoding of x. Whitespace formatting doesn’t matter, only that piping the output of your program validates as JSON of the above form. Feel free to write whatever you like to stderr.

Submission Instructions

Package your solution as a gzipped TAR archive. Your solution should expand to the following directory structure.

$ tree -F warmup
warmup
├── Dockerfile
└── src/

The source code to your solution should be contained in src/. Your Dockerfile should, when processed using docker, create a container image that runs your solution given a network interface as an argument. For instance, if the vulnerable service traffic is visible on interface eth0, then your container must successfully print the secret when executed like so:

$ docker run -it --rm --privileged --network=host ${solution_image} eth0

Submit the solution archive to Canvas.

Extra Credit

  • Exploit the harder version of the vulnerable service contained in netsec_warmup.hard.img.xz
  • Reverse engineer the service to extract the authentication key

  1. For help with building and running containers, see this quickstart.↩︎


© 2023 wkr