> For the complete documentation index, see [llms.txt](https://picoctf2022.haydenhousen.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://picoctf2022.haydenhousen.com/binary-exploitation/buffer-overflow-2.md).

# buffer overflow 2

## Challenge

Control the return address and arguments This time you'll need to control the arguments to the function you return to! Can you get the flag from this [program](https://github.com/HHousen/PicoCTF-2022/blob/master/Binary%20Exploitation/buffer%20overflow%202/vuln/README.md)? You can view source [here](https://github.com/HHousen/PicoCTF-2022/blob/master/Binary%20Exploitation/buffer%20overflow%202/vuln.c). And connect with it using `nc saturn.picoctf.net 50541`

## Solution

This challenge is almost identical to [OverFlow 2](https://github.com/HHousen/PicoCTF-2019/tree/master/Binary%20Exploitation/OverFlow%202) from PicoCTF 2019. However, we use ROP for this exploit since it is easy with [pwntools](https://github.com/Gallopsled/pwntools). Alternatively, the method from the link above should work too.

### Flag

`picoCTF{argum3nt5_4_d4yZ_b3fd8f66}`
