Skip to content
Advertisement

Buffer Overflow: NOP sled not working [closed]

Hey I’m trying to do a buffer overflow on a basic C program, the shellcode i’m using in gdb is in the form

NOP sled then msfvenom payload to connect back to my own machine, finally a memory address of somewhere in the NOP sled.

When running gdb, before the shellcode is executed I can see that the NOP instructions start at 0x7fffffffe010 which is the address I have at the end of the shellcode. After the shellcode is executed the rip register is at 0x7fffffffe010 however it gives me the warning:

 Cannot insert breakpoint 0.
 Cannot access memory at address 0x40000

 0x00007fffffffe010 in ?? ()

I thought the rip would now read the NOP’s and go into the payload to connect back to my machine I can’t understand why it’s not working.

Advertisement

Answer

Solved it!

I needed to compile the c with no stack protection and with an executable stack, i.e:

gcc -fno-stack-protector -z execstack -o output file.c

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement