LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Impersonating ROOT privileges within a user app (https://www.linuxquestions.org/questions/programming-9/impersonating-root-privileges-within-a-user-app-768114/)

Litch84 11-10-2009 03:00 AM

Impersonating ROOT privileges within a user app
 
Running Apache/PHP, I want to call a program that requires ROOT access (Direct I/O with /dev/sd?)...

sudo is not available (Requires a tty associated with the user, but the user Apache does not).

Help?

unSpawn 11-10-2009 03:28 AM

Quote:

Originally Posted by Litch84 (Post 3751320)
Running Apache/PHP, I want to call a program that requires ROOT access

It's all in the details: application name, how and where from it's supposed to be called, et cetera. Please be way more specific.

graemef 11-10-2009 06:11 AM

Two immediate thoughts for more information...

Do you have root access on the server?
Why is sudo not an option?

sundialsvcs 11-10-2009 07:34 PM

:rolleyes: There's a reason why that sort of thing isn't "easy."

zhjim 11-10-2009 07:44 PM

[suicide is painless]
http://httpd.apache.org/docs/2.2/suexec.html

[classical AC/DC song title]
PHP Code:

<?php system(sudo /higway/to/hell)?>

Have fun

Litch84 11-10-2009 11:14 PM

Thanks for all your input, but it's been solved elsewhere.

The solution involved using execl() and setuid().

unSpawn 11-11-2009 12:44 AM

Quote:

Originally Posted by Litch84 (Post 3752452)
setuid()

Awesome. Just awesome. Not!


All times are GMT -5. The time now is 01:28 PM.