Hanoi As A Service was a 50 point pwnable in PoliCTF and gave me a reason to hate PROLOG.
We’re given nc haas.polictf.it 80
as point of attack. Let’s start:
1 2 3 4 5 6 7 8 9 |
|
Interesting. I now know I’m up against some Prolog program. Let’s see if we can inject Prolog code:
1 2 3 4 5 6 7 |
|
Looks like we can! Now, since I never learned Prolog as a kid (I’m more of a BASIC boy), I searched around for code examples. I couldn’t just grab the flag so I started with enumerating.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
|
I now had the location of the flag. Now, to read it… Turns out Prolog does not have a “normal” way to read arbitrary files (it expects Prolog terms or something). I searched for a good while and finally:
1 2 3 4 5 |
|
Back to python!
1 2 3 |
|
50 points and first blood for Team Vulnhub.