CrossCTF_2018: Kryptonight 1

Category: Crypto Points: 775 Description:

I took a walk around the world to ease my troubled mind. nc ctf.pwn.sg 1502 Creator - amon (@nn_amon)

Write-up

When we connect to the socket, we get a pretty long paragraph (truncated for brevity),

$ nc ctf.pwn.sg 1502
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -> b5a7f63abb94d07d1a6445c36c07c7e8327fe61b1647e391b4c7edae5de57a3d
7092df9d95b8c26ad2ca604a883176057b6c083a1a7ce4b253e328705b0a8e2040fc47bfbd6421bd9b3bf4839d3991b285e8795d260a4a3a5f99de319e98b69ad1c768e7c12e6ba0d4c44ac2dd9fec77b8ab63c1d84e49[...]?

Given the name of the challenge, I immediately turned towards a algorithm I knew rather well, Cryptonight. Given the cryptocurrency craze, I knew I was on the right track. Thankfully, @nn_amon had also contributed to a library for this, so we can make use of that.

After installing it with npm, we can go to work on this,

# node
> var multiHashing = require('multi-hashing');
undefined
> var data = new Buffer("7092df9d95b8c26ad2ca604a883176057b6c083a1a7ce4b253e328705b0a8e2040fc47bfbd6421bd9b3bf4839d3991b285e8795d260a4a3a5f99de319e98b69ad1c768e7c12e6ba0d4c44ac2dd9fec77b8ab63c1d84e49[...]", "hex");
undefined
> multiHashing['cryptonight'](data, 1).toString("hex");
'38b45cade509af3ce0173686e71fafcf0d4f9102c81e2b541d4113ad5cc45145'

Entering that into our other terminal, we then get our flag!

$ nc ctf.pwn.sg 1502
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -> b5a7f63abb94d07d1a6445c36c07c7e8327fe61b1647e391b4c7edae5de57a3d
7092df9d95b8c26ad2ca604a883176057b6c083a1a7ce4b253e328705b0a8e2040fc47bfbd6421bd9b3bf4839d3991b285e8795d260a4a3a5f99de319e98b69ad1c768e7c12e6ba0d4c44ac2dd9fec77b8ab63c1d84e49[...]?
38b45cade509af3ce0173686e71fafcf0d4f9102c81e2b541d4113ad5cc45145
Flag: CrossCTF{h0dl_t1l_u_d1e}

Therefore, the flag is CrossCTF{h0dl_t1l_u_d1e}.

results matching ""

    No results matching ""