Challenges › Cryptography

Recover the Hidden Suffix

medium · 100 XP · machine with a lab · free · solves: 0

A test service encrypts your input with AES in ECB mode. Before it encrypts, it adds a hidden suffix after your input and pads the result with PKCS#7. The key is fixed and secret. There is no hidden prefix. The suffix contains the flag.

Start the lab. The service runs on host oracle, TCP port 9000.

Protocol. The service sends two banner lines when you connect. Send one command per line:

client.py opens one connection and gives you Oracle.encrypt(data) for your scripts. Run it alone to send one input: python3 client.py 41414141.

Your task.

  1. Find the block size from the changes in ciphertext length.
  2. Confirm ECB mode with repeated input blocks.
  3. Recover the suffix one byte at a time. Use the suffix length to stop before the padding bytes.

Submit the flag that you find in the suffix.

Tags: learn

Try next