Author Topic: Crackme 03  (Read 1505 times)

0 Members and 1 Guest are viewing this topic.

Offline daxda

  • Peasant
  • *
  • Posts: 114
  • Cookies: 112
  • Not the guy you're looking for
    • View Profile
    • Daxda on Github
Crackme 03
« on: December 28, 2013, 04:21:12 pm »
Welcome to crackme No. 03!
This time the reverser has to solve the challenge without modifying the binary itself (no patching).
As always please do not post the plain solution key to solve it. Write a little tutorial on how you solved it so that everyone who isn't as experienced or stuck has a chance to learn from you!

Good luck and have fun.

Download Crackme03

(Compiled on Linux 64-bit, available for Linux 32-bit and 64-bit)

PS: If you experience any issues or find bugs let me know asap.
« Last Edit: December 28, 2013, 05:31:11 pm by daxda »

Offline s3my0n

  • Knight
  • **
  • Posts: 276
  • Cookies: 58
    • View Profile
    • ::1
Re: Crackme 03
« Reply #1 on: December 30, 2013, 06:02:04 pm »
Ok, I couldn't be bothered reversing all the nested if's, so I hacked cracked it :P
I used Linux LD_PRELOAD hooking mechanism to put a single '0' inside the tmp key file.
This way "if(buffer == '0')" will be true so then "if(i == 1 || i == 7)" will get executed and evaluate to false, thus going to the beginning/end of the loop that increments the counter by 1.
Since strlen(buffer) is 1 and counter is 1, it will break out of the loop and execute the "bad" function, which is the success function  ;D
« Last Edit: December 30, 2013, 06:49:06 pm by s3my0n »
Easter egg in all *nix systems: E(){ E|E& };E

Offline dz_ruyk

  • NULL
  • Posts: 1
  • Cookies: 1
    • View Profile
Re: Crackme 03
« Reply #2 on: January 04, 2014, 01:15:24 am »
Hi.
Another option is to hook fgets function like this:


Code: (c) [Select]
char *
fgets(char *s, int size, FILE *stream)
{
    *s = '\0';
    return s;
}

Then first compare of string length and counter drops us to call of bad() function.