XiphosResearch / netelf

Run executables from memory, over the network, on Windows, Linux, OpenVMS... routers... spaceships... toasters etc.
282 stars 33 forks source link

Run a .dll or .so file instead of executable #5

Open HarryR opened 7 years ago

HarryR commented 7 years ago

On Windows use MemoryModule, on Linux just dlopen the file or socket.

argv[0] should be the symbol name to load and call.

Then call the symbol with:

symbol(socket_handle, argc, argv);
jpivarski commented 7 years ago

This is what I was looking for when I came here. I'm trying to find a library that will take an ELF string with a single function defined in it and produce a function pointer that I can call.

HarryR commented 7 years ago

You could use dlopen in combination with memfd and /process/self/fd/...

Use pwnlib to generate the elf file.

It should be easy to implement the dlopen functionality in netelf, but I wanted to keep the code simple.

On 29 Aug 2017 13:59, "Jim Pivarski" notifications@github.com wrote:

This is what I was looking for when I came here. I'm trying to find a library that will take an ELF string with a single function defined in it and produce a function pointer that I can call.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/XiphosResearch/netelf/issues/5#issuecomment-325655895, or mute the thread https://github.com/notifications/unsubscribe-auth/AASjNrJdS7PwnICmenEBfug36K21ODHxks5sdAtKgaJpZM4LpcMt .