Skip to content
PURPLEDUEL

Secrets inside an executable

Encodings & secrets · medium level · 5 objectives · 600 XP in total

A company handed you a compiled program, the vault, and swears nobody can read its secrets. Prove it wrong: extract the service code left inside the file.

Lab 4 of 6 in the Encodings & secrets path. If you get stuck you have 3 hints, from the vaguest to the most precise: they cost 0, 40 and 120 XP.

What you learn

Objectives complete themselves while you work in the terminal; each one is worth experience points:

  • Read the README (50 XP)
  • Ask file what cassaforte is (100 XP)
  • Extract the readable text with strings (150 XP)

Topics: codici, strings, binari.

Commands you will use

The terminal is simulated and understands about forty Linux commands. In this lab you will mostly need these:

  • cat: prints the contents of a file: the most direct way to read configurations, notes and logs.
  • file: recognises what kind of file you are looking at (text, executable, image) from its contents, not its name.
  • strings: extracts the readable text from a binary file: it reveals passwords and addresses left inside a program.
  • grep: finds the lines that contain a word, even across whole folders with -r. It is the main tool for analysing text and logs.
  • |: the vertical bar | chains commands: the output of the first becomes the input of the next, so small tools form a complete analysis.

The simulated environment

You work in a simulated Linux shell, in the home folder of the user runner: invented files and folders, no network target.

The defensive lesson

Once the lab is solved, the write-up explains what went wrong and how to protect yourself:

Compiling a program does not turn it into a locked drawer: any text written inside (passwords, API keys, tokens, internal addresses) is recovered with strings in a second, without even running it. Secrets belong neither in code nor in executables: they are read at startup from environment variables or a secrets manager, changed if they leak, and searched for with secret-scanning tools before release.

Before and after this lab

To unlock it you must have solved:

After this lab you can move on to:

The Encodings & secrets path

Encodings & secrets teaches a distinction that saves a lot of data: encoding is not encrypting. Base64, hexadecimal, ROT13 and mirrored text change how information looks but do not protect it, because anyone can turn it back into plain text without a key. In the labs you recognise these formats by their look, peel them off one layer at a time even when they are stacked, extract readable text from a compiled program and understand why real protection needs real encryption, salted hashes and a secrets manager.

All labs in the Encodings & secrets path

Learn more with the guides

All guides