Baby Time Capsule
https://app.hackthebox.com/challenges/Baby%2520Time%2520Capsule
import json
from Crypto.Util.number import long_to_bytes
from pwn import *
from sympy.ntheory.modular import crt
from sympy.simplify.simplify import nthroot
conn = remote('94.237.55.179', 53797)
rem = list()
num = list()
for i in range(3):
conn.sendline(b'Y')
a = conn.recvline()
r = json.loads(a[74:-1].decode())
m = r['time_capsule']
n = r['pubkey'][0]
e = 5
m = int(m, 16)
n = int(n, 16)
rem.append(m)
num.append(n)
x = crt(num, rem, check=True)
# print(f'x = {x[0]}')
flag = nthroot(x[0], 5)
print(flag)
print(long_to_bytes(flag))
conn.sendline(b'N')
conn.recvline()
conn.close()
â°â python3 decrypt.py ââ¯
[+] Opening connection to 94.237.55.179 on port 53797: Done
3133512701921564926666059129802238375015291423590355094862405004229914481893581069974415008616334994674940586670768933862016098685
b'HTB{t3h_FuTUr3_15_bR1ghT_1_H0p3_y0uR3_W34r1nG_5h4d35!}'
[*] Closed connection to 94.237.55.179 port 53797
Last updated