Sitemap

PROTOSTAR WALKTHROUGH STACK-4

2 min readSep 9, 2021

--

Hello hackers! hope you are all doing well and good. Let us jump to stack4 of our protostar

https://exploit.education/protostar/stack-four/

This challenge seems quite similar to the previous one but the only difference is we have to overflow the buffer space and get to eip region and throw in the win function’s address and that should give us our required output. Now let's put our theory to the test!.

/opt/protostar/bin/stack4

Let us first find out our win functions address:

Press enter or click to view image in full size

Now calculating the buffer needed to get into eip :

Get Prof.bubs’s stories in your inbox

Join Medium for free to get updates from this writer.

buffer(64 bytes)+padding(8bytes) + ebp(4bytes)

After using my brains to solve this complex math problem I found out that 76 bytes are needed to get to eip region (▀̿Ĺ̯▀̿ ̿) and then by giving the win functions address we will get our output.

So this is our payload:

(python -c “print ‘A’*75 + ‘\xf4\x83\x04\x08’”) | ./stack4

Press enter or click to view image in full size

And voila! Σ(-᷅_-᷄๑)!

That's the end of stack 4. More of these stack challenge series are yet to be released. If you think this walkthrough helped you in any way please do leave a like and thank you once again for reading. :)

--

--

Prof.bubs
Prof.bubs

Written by Prof.bubs

Techinal support engineer by day, lazy racoon by night, cybersecurity geek all the time