RingZer0team CTF - Challenge 56
Posted on Tue 02 May 2017 in Security
There are a bunch of fantastic Capture The Flag security challenges on RingZer0Team.com. I've been working through some of these for a wee while now, and with the New Zealand Cyber Security Challenge coming up again soon, I thought I'd get back into some of them.
Challenge 56 ("Hash Breaker", under the Coding Challenges) is one of a series of challenges where you're simply presented with a hash - you need to return the plaintext value to the page within 3 seconds.
Of course, this is impossible to do manually, so it's a programming challenge.
The hash looks like a simple SHA-1, so I put it into an online hash reverser and discovered it's just a SHA1 hash of a random number. SHA1 is really fast, so this should be simple.
Here's how I tackled the problem:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
|
There's no error handling in that code, so if it runs for more than a few seconds it's probably toast.