Blog

ISSessions CTF 2021 Programming Sha256

Mar 31, 2021 | 1 minute read

#SHA256

Just like NATO, Morse, and the other quick prompt challenges, get something, hash it, return it.

Solution

Same as most others, just adding an extra filter after hashing to ensure that the digest is properly formatted. That pesky grep newline strikes again.

#!/bin/bash
site=$1
operation=$2
data=$(curl -c cookies "http://progsha256.ctf.issessions.ca/" | grep -oE "data\".*" | grep -oE "[a-f0-9]{10}+" | tr -d '\n' | sha256sum | grep -oE "[0-9a-f]+" | tr -d '\n')
curl -b cookies "http://progsha256.ctf.issessions.ca/index.php?answer=$data"