yabo

Yabo was a basic buffer overflow challenge with executable stack.

Files

The binary

The binary starts a listener on port 9999 and waited for input.

Buffer Overflow

The program copies the input to a 1024 bytes buffer with strcpy and thus has a buffer overflow vulnerability.

We can use a jmp esp gadget to jump to our shellcode and run it.

I used the following shellcode:

A simple /bin/sh shellcode wouldn't work since the remote process that receives the input is a fork, the shell will be popped on the server but won't receive input through the socket. With the shellcode I used, exploiting is as easy as appending the desired command to the shellcode, so I used a bash + /dev/tcp shell.

Final Exploit

Last updated

Was this helpful?