LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   Quick Question About Sudo (https://www.linuxquestions.org/questions/linux-security-4/quick-question-about-sudo-190094/)

HappyDude 06-05-2004 03:35 PM

Quick Question About Sudo
 
I wrote a little application (see below) that activates eth0 so my noobishness doesn't make me reboot. I was just wondering is it safe to sudo root it?

Code:

#include <stdio.h>
#include <stdlib.h>

int main () {

  system("/etc/rc.d/rc.inet1");

}


neuroX 06-05-2004 05:11 PM

suid root?
I don't think that it needs to be run as suid root, because any old user can execute rc.inet1.

but to answer the question:
since you have the absolute path of the program, in order to exploit that program to get root, the user would have to modify or replace rc.inet1.

HappyDude 06-05-2004 08:29 PM

Lol, that never occured to me that I might not need to be root... I'll just keep fiddling then, thank you.

Ciccio 06-07-2004 10:59 AM

anyway. check #ifconifg and #service (man) they are system commands that allow you to work with your network or to simply start|stop|restart the 'network' service.

stickman 06-08-2004 07:28 PM

Quote:

Originally posted by neuroX
but to answer the question:
since you have the absolute path of the program, in order to exploit that program to get root, the user would have to modify or replace rc.inet1.

Or anything called in rc.inet1.

neuroX 06-09-2004 12:33 AM

Quote:

Originally posted by stickman
Or anything called in rc.inet1.
your right....
it doesn't use the absolute path to grep, so maybe on some systems you could make a file in the current dir called 'grep' and make it "#!/bin/bash; /bin/sh" or something to that effect.


All times are GMT -5. The time now is 04:39 PM.