RainFall/bonus3/walkthrough

23 lines
604 B
Plaintext

We compare characters of argv[1] the string of the last flag.
But the string of the flag is shortened depending on the value of atoi(argv[1]). If we enter 14, the 14th characters is replaced by a zero.
So maybe we can put a 0, so the string of last flag becomes an empty string.
But then we are comparing "0\0" with "\0", which isn't equal.
Fortunately, atoi on an empty string also returns 0.
```
bonus3@RainFall:~$ ./bonus3 ""
$ whoami
end
$ cat /home/user/end/.pass
3321b6f81659f9a71c76616f606e4b50189cecfea611393d5d649f75e157353c
$ cd /home/user/end
$ cat end
Congratulations graduate!
```
:)