picoCTF 2022 | buffer overflow 0 Write-up

Challenge description

Smash the stack Let’s start off simple, can you overflow the correct buffer? The program is available here. You can view source here. And connect with it using: nc saturn.picoctf.net 65445

Category: Binary Exploitation

Solution

This is a very basic buffer overflow challenge. Let’s look at the program’s source code:

An interesting clue regarding the flag

Reading this, and knowing that a buffer overflow will cause a segmentation fault, my intuition is that the flag will be printed out in the event of a segmentation fault. Let’s keep going.

The buffer for our input is 100 bytes

Simple enough, I’ll just throw 101 characters at the program. You can type it out or use any method of generating random text.

And like that, the flag is ours

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: