LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 12-13-2005, 10:04 PM   #1
Milosevic
LQ Newbie
 
Registered: Nov 2005
Posts: 19

Rep: Reputation: 0
Small program calling /bin/bash


Hi. I'm having some problems trying to understand what is going on here. Here's the program code:

Code:
//---------------file.c--------------
#include <unistd.h>

int main()
{
    execl("/bin/bash","bash",NULL);
    return 0;
}
//------------------End of file.c--------------
Then i compiled it and changed the permissions to the following:

-rwsrwxrwx 1 root root 11051 2005-12-14 01:57 file//SUID here
-rw-r--r-- 1 milosevic users 105 2005-12-14 01:48 file.c

Finally:
milosevic@slackws:~/c$ ./file
milosevic@slackws:~/c$ id
uid=1000(milosevic) gid=100(users) groups=100(users),11(floppy),17(audio),19(cdrom)

I just don't understand why i'm still milosevic, and not root.

Milosevic.
 
Old 12-14-2005, 09:09 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
I'm having some problems trying to understand what is going on here.
I think you think you're trying to get some rootshell dropping thing going.


I just don't understand why i'm still milosevic, and not root.
Well, all it does is exec a shell. What you probably want is tricking a process with enough privileges in prepping the rootshell *for* you.

Mind you, LQ - Security is more sort of a Whitehat forum. We understand that basic knowledge of Blackhat-fu is a necessity, but we don't encourage anyone to post detailed questions about or replies or HOWTO's about the workings of exploits, with the exception of questions in case your box was breached using one. If you want to increase your Blackhat-fu mana, then please do so outside of LQ. TIA.
 
  


Reply



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
Change /bin/bash to /bin/zsh Smokey Slackware 12 07-14-2004 01:06 AM
why did bash 2.05b install delete /bin/bash & "/bin/sh -> bash"? johnpipe Linux - Software 2 06-06-2004 06:42 PM
bin/bash:usr/bin/lpr NO SUCH FILE OR DIRECTORY Adibe_Hamm Linux - Newbie 3 10-14-2003 02:30 AM
Calling long BASH code within a C program Linh Programming 4 06-24-2003 01:41 PM
c++ calling bash? adam_boz Programming 4 10-23-2002 12:23 PM

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

All times are GMT -5. The time now is 11:22 PM.

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