In this post we solve the second level of Micro Corruption, an embedded security CTF. First lets check the main function:
We take a look at the check_password function that is being called in the main function:
- The first line of the check_password function compares 0x5a48 to the password the user enters. If the values don't match, the jump takes us to #44ac.
- When the values match, there is another comparison of 0x7166 to 0x2 in r15. Similarly, if the values match we are taken to the next step else we jump to #44ac which clears r14 and then r15 is set to 0.
- The third comparison of 0x3664 and 0x4 in r15 is also similar to previous comparisons.
- After the fourth comparison of 0x256c with 0x6 in r15, if the comparison matches, then value 1 is moved to r15 from r14.
- If the comparisons don't match then the value 0 is moved from r14 to r15. And we finally return to the main function.
This final value written to r15 is very important as it is used to test in the main function and if it is 0, the access is not granted. If the value is 1 or not 0, then access is granted, solving this level. So, the password must be 0x5a48, 0x7166, 0x3664 and 0x256c concatenated together? We could decode the hex value or directly input the hex value by using the check box.
But there is a final very interesting twist in the puzzle.
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.