Dream Diary - Chapter 1

I managed to get a shell, but i could not make a reliable exploit. Someone who managed to get through that 0x7f restriction, please PM me, I’m curious how could it be done.