NahamCon 2025 CTF Writeup

フラグ形式・禁止事項等 (抜粋)

flag{}
        

Read The Rules

Technical Support

Naham-Commencement 2025

# username
x1 = "dqxqcius"

username = ""
for i in range(len(x1)):
    if (ord(x1[i]) - 97) < 16:
        username += chr(ord(x1[i]) - 16 + 26)
    else:
        username += chr(ord(x1[i]) - 16)

print("username:", username)

# password
x2 = "YeaTtgUnzezBqiwa2025"
k = "nahamcon"

password = ""

for i in range(len(x2)):
    if ord(x2[i].lower()) < 97:
        password += x2[i]
        continue
    n = ord(k[i % len(k)]) - 97
    e = ord(x2[i].lower()) - 97

    d = e - n
    if d < 0:
        d += 26

    if x2[i].isupper():
        password += chr(d+97).upper()
    else:
        password += chr(d+97)

print("password:", password)
        

The Oddyssey

from pwn import *
import time

host = $HOST
port = $PORT

sh = remote(host, port)

sh.sendline("a".encode() * 1172)

msg = sh.recvall().decode()

with open("./test.txt", "w") as f:
    f.write(msg)

sh.interactive()
        
cat test.txt | grep flag
        

Quartet

cat quartet.z01 quartet.z02 quartet.z03 quartet.z04 > quartet.zip

unzip quartet.zip
        
strings quartet.jpeg | grep flag{