note 61998 added to function.shell-exec
| From: | rigsbratyahoodotcomdotbr at osu1 dot php dot net | Date: | Fri, 17 Feb 2006 02:24:47 +0000 |
| Subject: | note 61998 added to function.shell-exec | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-103874@lists.php.net to get a copy of this message | ||
If you need to execute a command without permission and could not execute it by ssh or install any
extension, there is a way in Apache 1.3.x and PHP 4.
Create a file on cgi-bin directory, like this:
#!/usr/bin/php
<?
echo shell_exec('whoami');
?>
Don't forget to set the file you created the permission to execute it. Hence, call it from
browser and you will se that this script will be executed by the shell user and not the user nobody
(apache default user if running a PHP script).
----
Server IP: 200.185.109.103
Probable Submitter: 200.220.136.102
----
Manual Page -- http://www.php.net/manual/en/function.shell-exec.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+61998
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+61998&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+61998&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+61998&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+61998&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+61998&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+61998&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+61998&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+61998&report=yes
Search -- http://master.php.net/manage/user-notes.php