I'm going through the various overthewire wargames and I have a question about narnia0. The code in c contains
if(val==0xdeadbeef)
system("/bin/sh");
else {
printf("WAY OFF!!!!\n");
I got it to work with the simple buffer overflow, but I wanted to try using gdb to find other ways to exploit it. I disassembled main, then set a breakpoint after cmpl and before jne. Then I changed the machine code from 0x75 to 0x74. When I continued, it ran
system("/bin/sh");
but when I ran id I was still only in the narnia0 user group, whereas if I did the buffer overflow I was in the narnia1 group. Is it impossible to escalate privilege as gdb, and is there any work-around to escalate privilege in an environment where you can change the machine code/variables?