Cracking a password hash
Many systems do not store passwords in plaintext — instead, they store the SHA-256 hash of the password. However, even though a hash is one-way, if the password is "simple", it can be found using a dictionary attack: we hash every word in a list of known passwords and compare it with the stored value.
Below are the unsalted (no salt) SHA-256 hashes of three users. Find all three passwords using the attached dictionary (wordlist.txt).
h1 = 0f794d836fe17aa42cb1bbe828ea339e73584333348e3e812c4ec79d37fced38
h2 = 66b46b40cc8270c1fc5753cffc86383d76c10e2ae1cf1ba732d387dc143e21b7
h3 = 35ea6a9b3e116cfcf121f51b83bc3efe58638b3fd4ac2c7a6a19e3165a16aba3
Assemble the flag from the found passwords (in the order of the hashes): BAYROQ{H4SH_<parol1>_<parol2>_<parol3>}
Why do we need a salt? Since these hashes are without a salt, the same password always produces the same hash — therefore a rainbow table or dictionary attack works. If a random salt is added to each password, the hash turns into sha256(tuz + parol) and precomputation becomes useless — an attacker has to compute everything again for each salt.