0x0 App - System

dimanche 22 avril 2018, 06:41  #1
App - System Buffer Overflow 1
crazy-eddie
  • 1 posts

I figured it out (finally because the answer is on SO and I found it looking for stuff on dash), but why didn’t this work ?

`python -c ************************************ | ./ch13`

I would have expected it to work for a similar reason why the answer does. I spent hours on this :p Am I misunderstanding the effects or did it just not have time to flush output before it was gone ?

mercredi 11 juillet 2018, 12:10  #2
App - System Buffer Overflow 1
Alkeryn
  • 2 posts

because this isn’t a python command
either you do "echo ************************************ | ./ch13"
either you do "python -c ’print("************************************")’ | ./ch13"
also side note you can use operators on python strings so you could just do
"python -c ’print("*"*36) | .ch13"
What is useful with that is you can also do things like "python -c ’print("padding"*numberofpading + "what to write idk shellcode or adress") | ./ch13"
and also if you want to put an adress because x86 is little endian you would have to reverse the bytes
but you can easily do so with "python -c ’print("adress"[: : -1])’"
note that [: : -1] reverse the string