Is the memory map of a process different when executed in GDB?



Hi,
I'm beggining studying deeply exploits. Now I have a problem. I'm
trying a return-to-libc exploit but I get a segmentation fault when
executed in the terminal and I get the code correctly executed when I
run it inside GDB. Does GDB alter the memory map of a process when
executed inside it? In which way? Where I can read info about this?
This is the problem:

fcano@gohan ~/ShellcodersHandbook/code/ch02 $ ./ret2libc 609 1776
Using address: 0xbfffeb08
fcano@gohan ~/ShellcodersHandbook/code/ch02 $ ./victim $BUF
Segmentation fault
fcano@gohan ~/ShellcodersHandbook/code/ch02 $ gdb ./victim
GNU gdb 6.7.1
Copyright (C) 2007 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) r $BUF
Starting program: /home/fcano/ShellcodersHandbook/code/ch02/victim $BUF
sh-3.2$

Any ideas?



Relevant Pages

  • Re: Fedora 9
    ... GNU gdb Fedora ... This is free software: you are free to change and redistribute it. ... There is NO WARRANTY, to the extent permitted by law. ... Program received signal SIGSEGV, Segmentation fault. ...
    (Fedora)
  • Re: Fedora 9
    ... GNU gdb Fedora ... This is free software: you are free to change and redistribute it. ... There is NO WARRANTY, to the extent permitted by law. ... Program received signal SIGSEGV, Segmentation fault. ...
    (Fedora)
  • Re: Fedora 9
    ... GNU gdb Fedora ... This is free software: you are free to change and redistribute it. ... There is NO WARRANTY, to the extent permitted by law. ... Program received signal SIGSEGV, Segmentation fault. ...
    (Fedora)
  • Re: Fedora 9
    ... GNU gdb Fedora ... This is free software: you are free to change and redistribute it. ... Program received signal SIGSEGV, Segmentation fault. ... Missing separate debuginfos, use: debuginfo-install atk.i386 cairo.i386 ...
    (Fedora)
  • Stability issues / UFS based panic on recent CURRENT (03/22)
    ... Copyright 2004 Free Software Foundation, ... GDB is free software, covered by the GNU General Public License, and you are ... There is absolutely no warranty for GDB. ... #0 doadump at pcpu.h:246 ...
    (freebsd-current)