puzzle-land

This challenge gives us a python script with the flag split up and randomized and the hash of the correct flag:

from hashlib import blake2b 

# piesele din steag sunt amestecate
flag = ['ea87f8}', 'h{c197a0', '644f0b26', '26fc5753', '7bd7bfd7', '3b7f75ca', 'db1dd753', '4adbd1f9', 'c800171e', 'abso-tec']
flag = "".join(flag).encode()

blake = blake2b()
blake.update(flag)
hashed = blake.hexdigest()

### valoarea originala a flagului hash-uit :  f1596e539f988dc3bdf619258b4570671e9bbe71c94e7342336c4717970355c5858662150877711ecaa97372667a3a523939638d1793eb5fbf14013ef6ae8288

After making this absolutely HORRIBLE code I got the correct flag: abso-tech{c197a03b7f75ca7bd7bfd7db1dd7534adbd1f9c800171e26fc5753644f0b26ea87f8}.

from hashlib import blake2b 

# piesele din steag sunt amestecate
flag = ['644f0b26', '26fc5753', '7bd7bfd7', '3b7f75ca', 'db1dd753', '4adbd1f9', 'c800171e']
#           #           #           #           #           #           #           #
flag_start = 'abso-tech{c197a0'
flag_end = 'ea87f8}'

def find_flag():
    for item in flag:
        tmp1 = flag.copy()
        tmp1.remove(item)
        for item2 in tmp1:
            tmp2 = tmp1.copy()
            tmp2.remove(item2)
            for item3 in tmp2:
                tmp3 = tmp2.copy()
                tmp3.remove(item3)
                for item4 in tmp3:
                    tmp4 = tmp3.copy()
                    tmp4.remove(item4)
                    for item5 in tmp4:
                        tmp5 = tmp4.copy()
                        tmp5.remove(item5)
                        for item6 in tmp5:
                            tmp6 = tmp5.copy()
                            tmp6.remove(item6)
                            for item7 in tmp6:
                                tmp7 = tmp6.copy()
                                tmp7.remove(item7)
                                _flag = flag_start + item + item2 + item3 + item4 + item5 + item6 + item7 + flag_end
                                blake = blake2b()
                                _flag = _flag.encode('utf-8')
                                blake.update(_flag)
                                hashed = blake.hexdigest()
                                print(str(_flag) + " : " + hashed)
                                if hashed == "f1596e539f988dc3bdf619258b4570671e9bbe71c94e7342336c4717970355c5858662150877711ecaa97372667a3a523939638d1793eb5fbf14013ef6ae8288":
                                    print("flag found!:" + str(_flag))
                                    return


find_flag()

### valoarea originala a flagului hash-uit :  f1596e539f988dc3bdf619258b4570671e9bbe71c94e7342336c4717970355c5858662150877711ecaa97372667a3a523939638d1793eb5fbf14013ef6ae8288

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.