The Stack / Buffer Overflows
Results 1 to 3 of 3

Thread: The Stack / Buffer Overflows

  1. #1
    Junior Member
    Join Date
    Jun 2006
    Posts
    8

    The Stack / Buffer Overflows

    I'm trying to learn buffer overflows, on a Gentoo 2.6.17 system. I'm fairly sure I've got the idea down, but whenever I try to store anything in memory, the location moves around constantly. For example:

    $ export ASD="test"
    $ ./getenvaddr ASD
    ASD is located at 0xbf8a1855
    $ ./getenvaddr ASD
    ASD is located at 0xbf9d4855
    $ ./getenvaddr ASD
    ASD is located at 0xbfca2855
    $ ./getenvaddr ASD
    ASD is located at 0xbf9e2855

    And so on. Is this normal, or is my computer moving around these locations for some special reason?

    Thanks for any help,
    Brett
    Last edited by bsoric; December 20th, 2006 at 11:24 AM.

  2. #2
    Senior Member
    Join Date
    Aug 2006
    Location
    India
    Posts
    289
    I think that this is happening because everytime the process for yourprogram is created, the starting address is chosen randomly so tha location varies or might be that the system is using some memory during its operation which will make is consume some exra variable amount of memory in the RAM after which your process is created.
    "Everything should be made as simple as possible, but not simpler."

    - Albert Einstein

  3. #3
    Senior Member deftones12's Avatar
    Join Date
    Jan 2003
    Location
    cali forn i a
    Posts
    333
    not sure what you're trying to store, but in 2.6 to help prevent code executions as a result of buffer overflows there is a memory randomization patch.
    try this and see if it works.
    ~$: echo 0 > /proc/sys/kernel/randomize_va_space
    as root
    then try it and see if the same address comes up.
    but when you're done it'd be good to have randomize_va_space set to 1 for security although its easily bypassed.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 Security News

     Patches

       Security Trends

         How-To

           Buying Guides