Wow⌠I had a feeling, but the difficultyâs on another level.
Thats absolutely lunatic, ĹxĹ;;Thatâs absolutely lunatic, ĹxĹ;;
Îľ-(´ăťď˝)
Perhaps because it involves a system hack,
itâs a whole level above the usual web-based
war games on Wargame.kr in terms of difficulty.
I ended up referring to someone elseâs
solution while working through it.
And since posting the actual
source code would make the thread messy,
Iâll place it in a text file so it can simply be copy-pasted.
Anyway, letâs get started right away.
Right, if Iâm having a punt at roughly translating
the gist of this in my own way,
itâs something like this:
So, youâre on about MD5 hash collisions then,
are we? (¡¡¡) Right,anyway.
Right then, first things first,
open up yer Linux terminal.
Then you just wanna connect using
1 | ssh col@pwnable.kr -p2222 |
Now,the password right?
It wonât actually show up as youâre typing it
â donât mind that,just bash it in,hit Enter,
and bam, youâre logged in. Easy peasy!
Right then next up,you just wanna whack in
the ls command to see what files youâve got lurking around.
Now col youâd probably reckon thatâs
some sort of executable or maybe even a Python file, right?
But the actual one we really need to be bothered with,
the crucial bit, is col.c
so if you have a proper gander at the main bit,
the password, right, that needs to be 20
characters long. And hereâs the crucial part:
the hash code (0x21DD09EC) and
the password return value,
theyâve both gotta be
absolutely spot on, exactly the same.
No messing about with that, understood
That bash check_password(const char* p)
Bit, Yeah?
What itâs doing is, itâs taking chunks of the data
like, 4 bytes at a time â thatâs the size of an int, innit?
â and itâs then accumulating those into âresâ five times.
So, the thinking is,
if you just add the exact same value five times over you should,
I reckon, get that hash code itâs after. Simple as that, really.
Derivation of results
Right, so thatâresâvalue,yeah?
Thatâs just the result of piling up
whatever came out of the âforâloop,
five times over.
And if you then,like,divvy thatâresâvalue by five,
it turns out that the data
so if you then like,multiply this lot by five again
youâll find youâre short by 0x4.So,
the assumption weâre making here is
that the data is essentially four lots of0x6C5CEC8 and then one bit of 0x6C5CECC added in.
then,since itâs all about little endian,yeah?
All you need to do is just feed the program that data
in hexadecimal,in the exact sequence.
Thatâs the one.
using Python for that, yeah?
Now, hereâs the kicker, mind you:
when the program picks that up as an input
itâll jolly well recognise it as a char.
So, you just gotta watch out for that. Proper careful,like.
Flag
And with this rather handy key weâve just nabbed
itâs back to the very beginning, isnât it?
you just gotta punch in your key value.
And once thatâs
sorted, hit theâauthâbutton Simples.
Right,and then you swing back round,
and there it is: marked up with a green dotted line.
Means youâve bloody well sorted it, doesnât it?
Right, well thatâs the whole bloody spiel done.
Cheers for wading through all that, yeah : )
Alright then,
hope you have a decent day and
all your bits and bobs go swimmingly.
Itâs a proper scorcher out there,
mind you, so try not to go getting heatstroke, yeah?
And, uh, watch out for that bloody Wuhan pneumonia. Stay safe, mate. : )
