LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 11-05-2004, 08:20 AM   #1
humbleRay
LQ Newbie
 
Registered: Nov 2004
Posts: 2

Rep: Reputation: 0
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]

Last edited by unSpawn; 11-08-2004 at 03:22 PM.
 
Old 11-05-2004, 09:26 AM   #2
humbleRay
LQ Newbie
 
Registered: Nov 2004
Posts: 2

Original Poster
Rep: Reputation: 0
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
 
Old 11-08-2004, 03:24 PM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
//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".
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
IPC in socket using select system call Gomathy Linux - Networking 0 01-28-2005 06:37 AM
maintaining website nadine.mauch Linux - General 3 07-07-2004 09:38 AM
Maintaining Updates ltsai Linux - Software 0 10-02-2003 12:37 AM
Problem with accept() socket call which doesn't return jph Programming 4 08-06-2003 06:30 AM
help!!! how can i timeout a socket connect call... ? bzImage Programming 1 03-06-2002 02:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 06:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration