Toggle Navigation
Hatchery
Eggs
CZCTF2
__init__.py
Users
Badges
Login
Register
MCH2022 badge?
go to mch2022.badge.team
__init__.py
raw
Content
import ubinascii, uhashlib, rgb hashlist = [b'f83e255efc3d084ee9aab9434fc15f4f4d48738a1617545a8f263c9b48637abf', b'a0dcbd9bc0da26d980b4f4d1f46a931e5012e7097309cbd1598be0025b221a13', b'7a5a4d2f805dbae95ebc75248b6fef2bef613db187b58fb08c84e29823bc19fb', b'a0a69961699343bff19fc4f7b5396833a4665965ff7addfd51d1e8eb63878e5e', b'a647ec7b5d41907f431ab11e867d7cf1b65319fee23e5431db44a12f12e348d4', b'847f0086dba485ee2587f5feb12e8277f238b16528bb4e7c8ca7432736c5e5f0', b'98299e4868b647d376f9e20077f9244aa3908b0eb855c0f6317d4acc76dcb192', b'd47b26f576deac8b8312a91d71465af0273fe6fddf609166d7b61be6664c6368', b'6fc681fe6145a8737bf6092f6732bd0a8b5a9e59bbcf9c757cd7166090c36b09', b'93744142f1ec498bf1afa6ac60d7eb3b42397d3b94030f26ca66e47236379042', b'daf7032fa34b01dc4383997e73bb68fd861ec6ae08f0074e6b8afcf66ad4884d', b'f1db4bc30fa05ead74a42152ff5bb1af0c904e38a0107b915be4c6b9efd5fd09', b'3f1e25fcf69d005502f9867f81eba860b35417d438fe2107459260522230f151', b'661e4d3adf5355a85e287586ee8402457fc0998339789a0763b8c91c10e750df', b'5f8dec43fcbc7080583ef721a1c00ab6dfcd12a24a34ccd3805a58dcbd063c73', b'8542b9d2aad55b52a601b5730e05205d84d9bc2924d7b5b0f7adfb27d019563f', b'92eb4dc91864ff7f2bbe79d58d9f3c7a143b8e434f0c16e02bd7749d00c1822f', b'95b342042dc37adc21e8a871fb2a0ab9f60651bbed2ee83752ad722576c93cd8', b'3b8b3e6cba77b8a225f8c43b6846a6838d25544d820cf07316245341318a95de', b'f717bdc06eecd3267075b892ecdfc65181764d82ef2f3eebe62e288c910dc934', b'7881acce046786094dbd5c078f7ed8afb1a77b5dad86ef76b95a127d6fe7c3fc', b'0fcf333eef83d9417d60400a2ad01ac718bf0aa0a5e449cc31b0fd93ff36385a', b'bd27ca8dd83363d37d1e9618cc31c1758b93648fb6d564da820fb810889c9869', b'aead3180e2d72649c502be1262d13d8f3d176be3c8e2f8e1887fb77f2b9e792a', b'0543781e6b1fbba227030263260d4e38540108cfcceb35478f232076e6b59d44', b'66daea8f54ae8d610ecdcd82ed55844d9bae3bfcd114b9f9f9153919fcb9815f', b'75bc4cc60a4bb7166dba145bab7c5bb094435fcb35ca633623169cb9c2161f0e', b'22c6bf2e345525d04ef756a8ae2d3a994990968d5eb51179ef168f4f97de729b'] rgb.clear() def hash_iter(char,iter,salt="faketaxi"): for i in range(0,iter): char = uhashlib.sha256(salt+str(char)).digest() return ubinascii.hexlify(char) def guess_my_password(input): if(len(input) < 28): print("Password too short!") return False if(len(input) > 28): print("Password too long!") return False char = 0 hash_check = "CTF-Campzone-" for i in input: hash_check = hash_iter(i,32,hash_check) if hash_check != hashlist[char]: print("Password not correct!") return False char += 1 print("Correct!") rgb.scrolltext(makexor(input),(0,255,192),(0,0)) return True def makexor(passw): output = b'' flag = b"\x0f\x16~B U\x190\x0fKd\x18\x05\x13\x0b6K6B?'hy\x05?C6N" print (len(flag)) for i in range(0,28): output += chr(flag[i] ^ ord(passw[i] ) ) return output rgb.clear() rgb.scrolltext("You can never crack me!") globals()["guess_my_password"] = guess_my_password print("import czctf2") print("Why don't you go and czctf2.guess_my_password()!")