PROTOSTAR WALKTHROUGH STACK-4

Prof.bubs
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:

Now calculating the buffer needed to get into eip :

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

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. :)

--

--