BM02
Last updated
Was this helpful?
Last updated
Was this helpful?
Type
Difficulty
Binary
Medium
‌
In this challenge a Linux binary were provided. It not easy in order to solve it we have to debug it and use some patching technique.
I used here IDA to debug the binary.
First of all, I created breakpoints at the ending of each function to change the direction and point to any direction or function I want.
As above figure shows that there is two paths that the function will follow after it completed. It is highlighted with red and green arrows, green arrow means the default path.
So here we have to modify that path and make the function jump to red arrow.
There many ways to do that, but preferred to do the complicated way.
Here I changed the value of register ZF
to 1, after that the function pointed that will execute the false function (not the default).
After that, I moved to analysis the binary what it do while executing. I identified that their is function that having loop that print a letter every one time. That function is highlighted with red border in the figure below.
Then I made the binary execute and go through that function in order to print all letters.
Finally, I did the final path and changed the register CF value to 1 in order to make the binary exit from the loop function and put the value of the printed loop letters into the heap.
As shown in the above figure, the data are stored on the heap. Now we will check that that heap data contains.
After checking the heap we will discover that the loop function was printing every letter of the flag.
Flag: n1CePatCHiNG010189