Ahmad Mahfouz

Random notes

SMASH THE STACK LEVEL2

time to play

let’s read what it says

first function catcher  and it trigger the suid  and drop the bash nice  this is what we want

the main function  takes arguments

print a string

if statement says

if not 3 arguments or  the 2nd argument, not a number

return 1

else

trigger signal SIGFPE for function catcher

let’s make a search for SIGFPE

http://www.gnu.org/software/libc/manual/html_node/Program-Error-Signals.html

this signal responsible for arithmetical errors   like divide by Zero (this is interesting  )

then the abs function return the absolute value of divided arg 1 and arg 2

so let’s play again

seems we fall in the if statement coz it returns 1

so we need a hint 😀

after digging around I got the hint to guess what   😀

after u read the “full” manual page for SIGFPE here is the hint inside the notes xD “l. (Also dividing the most negative integer by -1 may generate SIGFPE.)”

ref: http://linux.die.net/man/2/signal

so let’s give it the most negative 😀

w000t

 

btw i know that is weird because  ( -994949494994949494491233/-1) = 9.94949495E23

but this how posix work

Leave a Reply

Your email address will not be published. Required fields are marked *.

*
*
You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.