Avatar

memst

Practising computer addict

[C2C CTF 2023] Hash Shop

Description

You're given a weird code. Could you try and decipher it? Note: Encapsulate the flag value with FLAG{} eg: FLAG{<flag-value>}

39 35 66 36 31 39 63 33 31 63 37 65 38 62 61 66 62 35 32 36 66 32 39 64 38 63 66 66 39 39 34 65 63 39 66 61 63 66 38 61 33 39 33 35 39 63 30 31 33 36 63 35 66 33 34 65 38 33 31 65 32 64 34 62 32 37 34 34 35 30 30 32 36 66 31 64 62 31 64 38 61 33 33 37 65 66 34 37 62 31 33 63 31 38 38 33 39 62 63 35 36 61 31 36 65 32 38 64 35 65 33 37 66 38 65 37 37 32 39 39 61 37 64 61 32 65 37 36

Solution

The title Hash Shop hints that you should get a hash. Furthermore, the numbers look like they’re encoding ASCII characters. So try decoding:

a = "39 35 66 36 31 39 63 33 31 63 37 65 38 62 61 66 62 35 32 36 66 32 39 64 38 63 66 66 39 39 34 65 63 39 66 61 63 66 38 61 33 39 33 35 39 63 30 31 33 36 63 35 66 33 34 65 38 33 31 65 32 64 34 62 32 37 34 34 35 30 30 32 36 66 31 64 62 31 64 38 61 33 33 37 65 66 34 37 62 31 33 63 31 38 38 33 39 62 63 35 36 61 31 36 65 32 38 64 35 65 33 37 66 38 65 37 37 32 39 39 61 37 64 61 32 65 37 36".split(" ")
b = "".join([chr(int(i)) for i in a])
print(b)

But we get garbage output. Looking at it a bit closer, you can try decoding the numbers as hex, then you get:

b = "".join([chr(int(i, 16)) for i in a])
print(b)
# Output: 95f619c31c7e8bafb526f29d8cff994ec9facf8a39359c0136c5f34e831e2d4b274450026f1db1d8a337ef47b13c18839bc56a16e28d5e37f8e77299a7da2e76

This is clearly some hash. You can easily find it on crackstation. Or, if you want to go slower but not rely on online tools, use hashcat and the standard rockyou wordlist:

$ hashcat 95f619c31c7e8bafb526f29d8cff994ec9facf8a39359c0136c5f34e831e2d4b274450026f1db1d8a337ef47b13c18839bc56a16e28d5e37f8e77299a7da2e76 rockyou.txt

Hashcat gives some choices to select the hash, it seems most likely that it will be SHA2-512. A few seconds later you have the solution:

95f619c31c7e8bafb526f29d8cff994ec9facf8a39359c0136c5f34e831e2d4b274450026f1db1d8a337ef47b13c18839bc56a16e28d5e37f8e77299a7da2e76:xmen14758

Flag

FLAG{xmen14758}
Written on May 18, 2023