the cat
S.13

MicroCorruption: Santa Cruz

Cali-ng in!

4 Nov 2020 · write-up · buffer overflow

Nice! Here is a lock. This is the manual:

There is not much clues from the manual.

The main function just calls the login function:

You run a test run to get a feel on the program. Since the provisioned length of the input buffer is greater than the prompted one:

The program proceeds...

there is a cmpoperation done between the length of the copied username input and the value at r4(0x43cc) - 0x18 = 0x43b4: this was originally set to 0x10.

This value gets overwritten by the 19th username input byte: 0x61(remember that the strcpy dest address for username input is 0x43a2 from earlier).

Since r15(0x61) > r11(0x18), no carry flag is set.(For more on this, refer to previous notes. The program continues.

You run a test to bypass this:

The authentication check fails, but the program proceeds:

Can the return address be modified?

You rerun a test with these steps:

You give this a try with the following input:

username:

password:

This is what you observe:

Another one down!

Onwards and Algiers. _0/