from pwn import *
import base64
from pwnlib.util.iters import mbruteforce
from hashlib import sha256
import string

context.log_level = 'debug'
r = remote("54.177.114.50", 9999)



with open("test_mod_final.exe", "rb") as f:
    data = f.read()


def brutel(cur):

    content = tmp + str(cur)
    s = sha256(content.encode())
    if s.hexdigest().startswith("000000") and int(s.hexdigest()[6:8], 16) < 0x40:
        return True

    return False

r.sendlineafter('> input the team token', 'vviTxDo4Ree7KyG7grYWiA==')

pow_result = 'hack'

r.sendlineafter('>', pow_result)

for i in range(10):

    r.sendlineafter('>', 'Y')
    r.sendlineafter('> Upload the file (base64)', base64.b64encode(data))

    


# r.interactive()
