Daily AlpacaHack Writeup (2026-06-1 ~ 2026-06-7)

Daily AlpacaHack の Writeup.
(2026/6/1 - 2026/6/7)

Half-Year Recap (Misc, 2026/6/1)

Cache Me If You Can (Web, 2026/6/2)

curl http://34.170.146.252:21724/flag -v
curl http://34.170.146.252:21724/flag?a=1 -v
        

vm1 (Misc, 2026/6/3)

this.constructor.constructor('return process.env')()
        

Small e (Crypto, 2026/6/4)

from Crypto.Util.number import long_to_bytes
from gmpy2 import iroot

n = 16128804155875357893998760311719646398956415880698030561267568338090219290157891603532638172238485032759477580902658887080008705298094907918287851011968741355832250883201674570984807747020548844000957785264007870180470757091580750057164459793752714479791809579867574578330198492457059782036488831975650496564440123488599724632450667071325022385750061329492222092884811845354233534224359344208133180005606806945605297101512063251571527406665365800913912218217052716171501186370562004264601496219549705742961866516829669705353956908439174513725075192615787533907765532381255155275740682938535103389401380698116201073921
e = 5
c = 64426504087303951813246838078441662275222839708900359133341615671136342522173619331456628167122546441601604084831803481393964091908425281568746434522937994926680805728974560373917459735665811835839800559253331009380339923486729675042508940809673293031690986041297853338860088143997503137266972063924345287607333207047324410623795727456034926116681588542164755751442528534922088003628572923240330092448273804434443462174179583212626649843445735888430144970416125998013969727919556751231951554897102023125257208495501

m = iroot(c, e)

print(long_to_bytes(m[0]))
        

RPS GAME (Misc, Crypto, 2026/6/5)

0, 0, 0: 0
1, 0, 0: 1
0, 1, 0: 0
0, 0, 1: 0
1, 1, 0: 2
1, 0, 1: 1
0, 1, 1: 0
1, 1, 1: 0
        
from pwn import *

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

HANDS = ["r", "p", "s"]
next_hand = "p"

for i in range(1000):
    prompt = sh.recvuntil(">".encode())
    print(prompt.decode())

    sh.sendline(next_hand.encode())
    
    prompt = sh.recvuntil("Opponent:".encode())
    print(prompt.decode())
    opp, you = sh.recvline().decode().strip().split(",")
    next_hand = HANDS[(HANDS.index(opp) + 1) % 3]

sh.interactive()
        

Flag for localhost (Web, 2026/6/6)

curl http://34.170.146.252:42474/ -H "X-Forwarded-For:127.0.0.1"
        

C++ flag checker (Rev, 2026/6/7)

stored = b'\xfc\x6c\xe5\xc9\xee\x63\x2e\x49\xfc\x06\x72\x66\xc8\xb8\x0a\x44\xdc\x1b\xf0\x6b\x82\x93\x27\x91\x92\x9c\x7a\x17\x62\xf0\x3a\x74\x9a\x9d\xf7\x15\x59\x99\x3d\xc5\x6b\x5b\x4a\xad\x3e\x17\x33\x89\x61\x4d\xfc\xe0\x2b\xf9\x27\xf9\x3c\xfc\x7c\x77\x13\x3f'

flag = ""

for i, char_byte in enumerate(stored):
    flag += chr(((stored[i] - (i+10)**3)&0xff)^0x55)
    
print(flag)