Skip to content

Semtex Level 7

Source: This content is aggregated from overthewire (MIT). Visit the original repository for the latest version.

Multi-vitamin

Getting out of the restricted shell shouldn't take you more than five minutes. Then have a look at /rdx/multivitamin. Try to analyse the algorithm very carefully. There is a weakness that really speeds up your quest...\

Multiplication is easy, and so is division...? You might want to look at http://gmplib.org/ if you use c.

Study guide

Level map: analyse the program in /rdx/multivitamin after leaving the restricted shell.

What this level teaches

Restricted-shell escapes and cryptanalysis of an arithmetic scheme.

Key ideas

  • Restricted shells. The page says getting out should take about five minutes. Many programs offer ways to run other commands.
  • Study the algorithm carefully. The page says a weakness really speeds up the solution.
  • Big numbers. The hint "multiplication is easy and so is division...?" and the link to the GMP library suggest arithmetic on very large numbers.

How to approach it

  1. Get out of the restricted environment.
  2. Read the algorithm and identify which operation is easy to reverse.
  3. Use a big-number library to implement the attack.

Why it matters

Number-theoretic schemes are only as strong as the hardness of the underlying problem, and misuse can destroy that hardness.