Topic
  • 3 replies
  • Latest Post - ‏2010-06-02T03:46:30Z by larryp7639
jveleg
jveleg
2 Posts

Pinned topic Qemu to execute a char buffer (shellcode)

‏2010-04-22T12:24:13Z |
Greetings,

I use Qemu user mode (qemu-i386). I have to modify the
source code to make it execute a char buffer rather than loading an ELF file and execute it.
For example it could take a string from command line:
qemu-i386 "ABABABABA"
and try execute it as a byte array like it was code
I was looking in elfload.c and linuxload.c files trying to bypass the ELF loading and to
load by own char buffer to memory and make Qemu execute it. Is there any way to do that?
Or this is impossible?
Any comment is very very welcome and appreciated

Thanx in advance
Updated on 2010-06-02T03:46:30Z at 2010-06-02T03:46:30Z by larryp7639
  • ishields
    ishields
    988 Posts

    Re: Qemu to execute a char buffer (shellcode)

    ‏2010-04-22T12:42:52Z  
    Sounds like the sort of thing a virus writer would want to do. See NX bit:Linux for some additional background on why you may not succeed at this.

    Ian Shields
  • jveleg
    jveleg
    2 Posts

    Re: Qemu to execute a char buffer (shellcode)

    ‏2010-04-22T13:16:12Z  
    Thanx for the reply,

    First of all, I'm developing this for the opposite reasons, security and Intrusion Detection.
    Thanx for the link for the NX bit.

    I ran a linux binary and saw at which addresses the code and the stack were placed and then
    I tried to do the same using target_mmap (of Qemu) for allocating space for the shellcode
    and its stack (I used mprotect to allow code execution for the code part) at the
    same addresses. No success yet.

    What's the difference between a normal binary that has an entry point at lets say 0x8000000
    and its stack at 0x9000000 ? I did the same for my code buffer and still no success.

    Is it because my code does not contain the _start or _init function that is inserted
    by the gcc to all binaries?

    I don't know...

    Any comment is welcome.
  • larryp7639
    larryp7639
    3 Posts

    Re: Qemu to execute a char buffer (shellcode)

    ‏2010-06-02T03:46:30Z  
    Hi, I am a new member of forum. Would a newcomer be warmly welcome here? Good day you guys!!!
    Updated on 2010-06-02T03:46:30Z at 2010-06-02T03:46:30Z by larryp7639