LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   Maintaining contact with a socket after an execve call (https://www.linuxquestions.org/questions/linux-security-4/maintaining-contact-with-a-socket-after-an-execve-call-251463/)

humbleRay 11-05-2004 08:20 AM

Maintaining contact with a socket after an execve call
 
hi,

i have a project in college [sniped by moderator].

I am currently testing my payload and am having a spot of bother with the execve() call,

I want execve to launch a shell, and for this shell to communicate with the existing socket, so that it will execute any client side commands.

I have dup2 the socket with the stdin and stdout, but i dont think that this is preserved after execve, i know that execve will inherit any open file descriptors, so there has to be some way of making this work, the question is how!

At the moment the shell will esecute one client side command before crapping out, any ideas or suggestions would be most appreciated, i have included my payload source code below,

thanks
Ray

[sniped by moderator]

humbleRay 11-05-2004 09:26 AM

the problem was actually with the -c command

when you run /bin/sh -c ls (for example)
it doesnt actually open up a shell,

Thanks
Ray

unSpawn 11-08-2004 03:24 PM

//Moderator.note0: if this is part of your homework or an assignment, then please try to complete it yourself.
//Moderator.note1: no posting/asking for any exploit code please.

Read the LQ Rules.
Thanks for keeping LQ "clean".


All times are GMT -5. The time now is 06:19 PM.