HTB Challenge : Impossible Password


https://app.hackthebox.com/challenges/impossible-password


Download the file and test out the program.

Use strings for clues.

Try with the found password.

Use ltrace to observe the file.

The program compares with a random string and exits. We see that the program holds the time , srand and malloc functions. The string comparison randomly changes by time.

Disassemble

Let’s use a dissembler to explore the program.

Show the main function.

The first strcmp is for the first key and it goes to a function.

Explore that function.

This is the random function that is generating the 2nd key comparison.

Go back to the main function and patch the program.

During the test feature instead of the checking function we jump to 0x0040096a and then to fcn.00400978 that gives us the flag.

We can see the modifications if we print the main function again.

Test the program and the flag is found.