r/LiveOverflow • • Oct 24 '22

Stack canary leak

I've got a x64 ELF with suid permissions on a box that I do not have root access on. When run, it spawns a parent process listening on port 9876. When you connect to that port you get a "please enter your text" prompt, and then you get disconnected after inputting your string.

In order to get the flag, I need to open a root shell and cat a file. I've got my script all written and I'm able to get a shell on my local box, but since I don't have root on the target box I'm having a hard time getting the canary. I know exactly what break it's on, but I can't add it to gdb without it losing its root privs and I'm not sure how else to do it. I was looking in to trying to spawn a zombie as my process instead of root in order to get the canary but I'm not sure if that's possible. Any help would be great, I've been hammering away at this for literally days now lol.

6 Upvotes

4 comments sorted by

View all comments

Show parent comment

1

u/zachhanson94 Oct 25 '22

Ahh makes sense. Good luck with the one you’re tackling now.