Treasure

Binary Exploitation/Pwn (seccomp)

Given an ELF file, when we run it:

We can see it leaked an address and after approx. 1 second, it then triggers sig alarm. Then we proceed to decompile the binary using ida and got these functions:

Main:

sub_12E9:

sub_13EB:

From these functions we get that there's a constructor that have a sig alarm(1), leaks libc puts address, and load ./flag to fd 3. There's also a seccomp setup that does:

  • Allows only a small set of syscalls

  • Blocks open, mmap, mprotect, execve

  • Sendfile is allowed, and flag is already open as fd 3

So the exploit flow: get libc base from puts address -> build ROP chain that calls libc.sendfile -> send payload when read() is waiting.

solver.py:

When run we get the flag:

Flag: WRECKIT60{y0u_g0t_th3_tr34sur3!!}

Last updated