LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-10-2009, 03:00 AM   #1
Litch84
LQ Newbie
 
Registered: Nov 2009
Posts: 4

Rep: Reputation: 0
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?
 
Old 11-10-2009, 03:28 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
Quote:
Originally Posted by Litch84 View Post
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.
 
Old 11-10-2009, 06:11 AM   #3
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
Two immediate thoughts for more information...

Do you have root access on the server?
Why is sudo not an option?
 
Old 11-10-2009, 07:34 PM   #4
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940
There's a reason why that sort of thing isn't "easy."
 
Old 11-10-2009, 07:44 PM   #5
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
[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
 
Old 11-10-2009, 11:14 PM   #6
Litch84
LQ Newbie
 
Registered: Nov 2009
Posts: 4

Original Poster
Rep: Reputation: 0
Thanks for all your input, but it's been solved elsewhere.

The solution involved using execl() and setuid().
 
Old 11-11-2009, 12:44 AM   #7
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by Litch84 View Post
setuid()
Awesome. Just awesome. Not!
 
  


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
Asking for root privileges in a GUI app sleeping Programming 4 09-07-2006 12:57 PM
Root privileges for user ar1 Linux - Security 2 01-07-2005 09:33 PM
User with root privileges ShakyJake Linux - Newbie 2 06-18-2004 12:12 PM
Given regular user root privileges clo99dx Linux - Newbie 6 06-05-2004 04:27 PM
How can I create a user with the same privileges as the root ? Menestrel Linux - Newbie 3 11-19-2003 09:38 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:04 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