the cat
S.12

MicroCorruption: Novosibirsk

Novody is home...

3 Nov 2020 · write-up · format specifiers

but a manual:

So this hardware version differs from b.03 in that HSM-2 is what is connected to port 2.

Also, passwords cannot be too long. Mmmh?

The main function:

There are a lot of clues here.

First, the call to printf() makes you think of format specifiers. This you encountered at a previous lock in Addis Ababa: revisit notes. These can be exploited modify value in memory(%n).

Attempts:

  1. Can return address(at sp) be modified?

The input buffer length is 500 characters. Even with this though, no memory overwrite occurs. The return address is not modified.

This implies that you cannot use shellcode injection in the input. (since you can not jump back to the shellcode address).

  1. Can the putchar function be beneficial somehow? Since it sets a value at r15 which is passed to the conditional_unlock_door?

A look at the put_char function:

Interesting...
The byte value at r15 is passed to INT 0 which displays it. Mmmh! What if the operation at address 0x4552 is overwritten such that the INT of value at r15 is called instead?

What if 7f is passed ? In such a case, where the operation at 0x4552 is cancelled, passing7f at r15 would call int 7f!

During printing back the copied input to display at the input byte 7f, this is what happens now...

aaand...

браво!

Onwards! There's nothing Wayang you down now :)