note 68685 added to function.shell-exec
| From: | nathandehert at nospamgmail dot com | Date: | Mon, 07 Aug 2006 08:29:31 +0000 |
| Subject: | note 68685 added to function.shell-exec | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-115605@lists.php.net to get a copy of this message | ||
If you want to execute shell commands as root theres another workaround.
<?php
shell_exec('sudo -u root -S command_goes_here < /home/$User/dir/dir/dir/passfile');
?>
It will readout the file 'passfile' that you've hidden under quite some dirs (to make
it a bit less insecure) and use the content as password to login as root.
Note that storing your root password is far from secure but it's an easy way to execute
commands under root in controlled environments.
Nathan De Hert
----
Server IP: 216.194.113.175
Probable Submitter: 213.119.154.6
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.shell-exec.php
Edit -- https://master.php.net/note/edit/68685
Del: integrated -- https://master.php.net/note/delete/68685/integrated
Del: useless -- https://master.php.net/note/delete/68685/useless
Del: bad code -- https://master.php.net/note/delete/68685/bad+code
Del: spam -- https://master.php.net/note/delete/68685/spam
Del: non-english -- https://master.php.net/note/delete/68685/non-english
Del: in docs -- https://master.php.net/note/delete/68685/in+docs
Del: other reasons-- https://master.php.net/note/delete/68685
Reject -- https://master.php.net/note/reject/68685
Search -- https://master.php.net/manage/user-notes.php