App - System

Sunday 20 May 2018, 00:18  #1
ELF x86 - Stack buffer overflow basic 4
coconuthead
  • 7 posts

This one is about to stump me. I have working shellcode that I have tested independently with another binary. Actually, my solution works if I step through it with GDB. However, the challenge binary just segmentation faults if run without a debugger.

Is there something about environment variables that I am not understanding? Any ideas on what might explain why it works with a debugger attached?

Friday 7 September 2018, 19:07  #2
ELF x86 - Stack buffer overflow basic 4
NonStandardModel
  • 42 posts

The debugger sets few environment variables. Compare the environment with and without the debugger (use "show environment" in GDB to see the environment). Note that you can remove the environment variables that the GDB added before you start debugging the binary (use "unset environment VAR_NAME_HERE" in GDB). If I remember correctly the GDB added environment variables LINES and COLUMNS, that are used by GDB to pretty print on the terminal screen.