Skip to content

Writeups for the challenges I made for THNB national CTF

Notifications You must be signed in to change notification settings

j4k0m/thnb-ctf-writeups

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 

Repository files navigation

thnb-ctf-writeups

Writeups for the challenges I made for THNB national CTF

Another Easy Crypto

from Crypto.Cipher import AES

def decrypt(key, enc):
    try:
        cipher = AES.new(key, AES.MODE_ECB)
        return cipher.decrypt(enc)
    except Exception:
        pass
    return 0

with open("flag.dat", "rb") as flag:
    flag = flag.read()
    print("FLAG: ", flag)

for key in open("/usr/share/wordlists/rockyou.txt", "rb"):
    key = key.strip()
    padded_key = key + bytes(b"\x00" * (16 - len(key)))
    decrypted = decrypt(padded_key, flag)
    if decrypted != 0:
        if b'thnb{' in decrypted:
            print(decrypted)

convert hexa flag to bin for better result (https://tomeko.net/online_tools/hex_to_file.php?lang=en)

image

Shuffled

print("".join(chr(max(list(map(ord, line)))) for line in open("flag.txt", "r").readlines()))

image

this is super easy

flag = [0x75, 0x69, 0x6f, 0x63, 0x7a, 0x4e, 0x6f, 0x32, 0x5e, 0x62, 0x69, 0x35, 0x73, 0x5e, 0x79, 0x6e, 0x53, 0x7c]

for i in range(0, 255):
    c = "".join(list(map(chr, [j ^ i for j in flag])))
    if "thnb{" in c:
        print(c)

image

1337 Director

from itertools import cycle

flag = [0x38, 0x09, 0x0f, 0x10, 0x19, 0x24, 0x19, 0x2d, 0x56, 0x43, 0x32, 0x25, 0x09,0x3e, 0x02, 0x1a,0x56, 0x1b, 0x13, 0x19,0x51,0x00,0x3d, 0x01, 0x09, 0x29, 0x24, 0x3a, 0x07, 0x14]

base = "Larbi"

def xor(key):
    key = key.encode("utf-8")
    xored = ''.join(chr(c^k) for c,k in zip(flag, cycle(key)))
    if "thnb" in xored:
        print(xored)

def decrypt(char):
    i = 1
    new_string = ""
    while i < len(base):
        new_string = base[:i] + char + base[i:]
        xor(new_string)
        i += 1

for i in range(33, 126):
    char = chr(i)
    decrypt(char)

or you can do it manually.

image

image

Easy Crypto

flag = [12644, 10088, 11330, 8918, 14268, 2058, 8360, 4680, 2340, 2640, 2244, 8360, 11118, 2340, 2640, 4680, 8360, 2744, 6630, 2640, 800, 8360, 2058, 8360, 5244, 1968, 6794, 2244, 8360, 5100, 13328, 2340, 4148, 12198, 2340, 2640, 2058, 4020, 14750]

for i in flag:
    for j in range(32, 126):
        if pow(j,2)-(7*j) == i:
            print(chr(j), end="")

image

Loader

Soon..

About

Writeups for the challenges I made for THNB national CTF

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published