Hey all, this one took me a while, specifically with getting root. For root, I had my exploit working locally against a binary with the appropriate permission with ASLR enabled. Remotely, I couldn’t get it to work for the longest time, even against the loopback interface of my Kali box.
I eventually figured out that the libc pointer was getting corrupted with recv when over ssh. I just ended up trimming the number and it worked like a charm. Debug output showed that the messages from my target binary were actually coming in out of order of SSH, but were fine locally, which explains the ptr corruption.
Has anyone seen this? Can someone please point me in the right direction to help me understand why I had to make that adjustment with the libc pointer?
Yah, that’s exactly what I did. I had a copy of libc from the remote host. I used that in my script. I used the same ssh connection options too, and set my process variable like you. I just had things come in out of order when doing it like that. Weird.
I don’t understand why we are giving the setuid(0) .
For ‘0’ it represents root user i knew it.
But this binary why we are giving setuid() please answer me dude.
I don’t understand.