Re: Linux Security

From: E. Charters (echarters_at_sympatico.ca)
Date: 02/21/05

  • Next message: Thomas Tuttle: "Re: Bill Gates as he presents the Windows Media Player system crash"
    Date: Mon, 21 Feb 2005 06:01:39 -0500
    
    

    There is gdb that works with assembler that will
    allow you to see the output line by line.

    gdb will work with c programs and assembler.

    What I would try is to write the function in C and
    then insert it in the buffer. Perhaps it is the way
    you are trying to call it that matters. There is
    no execution of the code as there is no load
    and execute provision ipso facto in your process.

    EC<:-}

    dude84 wrote:
    >
    > E. Charters wrote:
    >
    >> did you terminate the string you stacked with a newline character?
    >> --> "\n" ??
    >
    > Yes I did terminate the string with a \n character.
    > I created a string variable and pushed the variable onto the stack.
    > Here is a copy of the code:
    > File: message2.s
    > gcc2_compiled:
    > ,data
    > .LCO:
    > .string "Hello World\n"
    > .global main
    > .type main,@function
    > main:
    > pushl $.LCO
    > call printf
    > addl $0x4,%esp
    > call exit
    > This program functions when run from a prompt. This program is
    > strictly assembler.
    >
    >>
    >> otherwise the standard C function printf will fail when you pass it
    >> the address of the stack, which is what I presume you passed it.
    >>
    >> The other problem is that stdio.h was not known to be included in your
    >> routine. How do you include it, such that the function knows where to
    >> send the io?
    >
    > I actually added one printf to the main program to try and make the
    > function available to the assembler. It didn't change anything.
    >
    >>
    >> C may be low level and all, but mixing it with assembler may be
    >> fraught with problemos.
    >
    >
    > When I take this code and pass it into a stack based buffer
    > overflow, the hex code from it does not run. The program produces
    > strange results. Can anyone explain to me why this hex code would not
    > work in a buffer overflow, and what I need to do in order to be able to
    > do something simple like a printf from within the buffer of a buffer
    > overflow (keep in mind there cannot be any \x00's in the machine code)?
    >
    >
    >>
    >>
    >> EC<:-}
    >>
    >> dude84 wrote:
    >>
    >>> Hi,
    >>>
    >>> I need assistance with learning how to write assembler code
    >>> (custom) that will work with computer security related issues like a
    >>> stack based buffer overflow. Can anyone point me in the direction of
    >>> a newsgroup that could help me with this?
    >>> I've written a piece of assembler that calls the printf function,
    >>> and when I pass it into the buffer on my machine it does nothing and
    >>> segmentation faults. I'm using gas with gcc. I push the string onto
    >>> the stack call the function, add the memory space back to the stack,
    >>> and call the function to exit the program. I need someone's help to
    >>> explain why the hex code from this program does nothing.
    >>>
    >>>
    >>


  • Next message: Thomas Tuttle: "Re: Bill Gates as he presents the Windows Media Player system crash"

    Relevant Pages

    • Re: Ancient history
      ... this environments... ... they involve exclusive assembler implementation. ... with explicit buffer lengths as part of the normal infrastructure ... ... programmer to manage buffer lengths). ...
      (sci.crypt)
    • Re: Linux Security
      ... There is gdb that works with assembler that will ... then insert it in the buffer. ... >> otherwise the standard C function printf will fail when you pass it ...
      (comp.os.linux.security)
    • Need help interfacing Gnu "as" to fpc (very specific)
      ... days I have been looking at AT&T syntax for the Gnu assembler ... The header is the problem ... buffer visible in fpc. ...
      (comp.lang.pascal.misc)
    • Re: Public disclosure of discovered vulnerabilities
      ... > scope for user error is the same as assembler. ... a frequent "mistake" is that target buffer locations lack any ... even in assembler coding ... ... conventions include simple additional structure ... ...
      (sci.crypt)
    • Re: Newbie in Forth needs help...
      ... You are right I'm tying to make cross assembler. ... I should make one dictionary named target ... The herepoints into the image buffer. ... F-PC works under XP too. ...
      (comp.lang.forth)