based on the original program phpShell by Martin Geisler This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You can get a copy of the GNU General Public License from this address: http://www.gnu.org/copyleft/gpl.html#SEC1 You can also write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #$selfSecure Enable auto authenticate feature. This must be 0 in order to #use .htaccess file to control access to MyShell, otherwise let it as 1 #and set up your user and password using $shellUser and $shellPswd. #DO NOT TURN THIS OFF UNLESS YOU HAVE AN ALTERNATE METHOD TO PROTECT #ACCESS TO THE SCRIPT. $selfSecure = 1; $shellUser = "root"; $shellPswd = "myshell"; #$adminEmail is the email address to send warning notifications in case #someone tries to access the script and fails to provide correct user and #password. This only works if you have $selfSecure enabeled. $adminEmail = "youremail@yourserver.com"; #$fromEmail is the email address warning messages are sended from. #This is set for default to the server admin, but you can change #to any address you want i.e.: noreplay@yourdomain.com #This only works if you have $selfSecure enabeled. $fromEmail = $HTTP_SERVER_VARS["SERVER_ADMIN"]; #$dirLimit is the top directory allowed to change to using cd command #or the form selector. Any attempt to change to a directory up this #level bounces MyShell to this directory. i.e.: $dirLimit = "/home"; #It is a good practice to set it to $DOCUMENT_ROOT using: #$dirLimit = $DOCUMENT_ROOT; #If you want to have access to all server directories leave it blank. #WARNING: Althought a user won't be able to snoop on directories above #this level using MyShell, he/she will still be able to excecute #commands on any directory where Webserver has permisson, #i.e.: mkdir /tmp/mydir or cat /home/otheruser/.htaccess. $dirLimit = ""; #$autoErrorTrap Enable automatic error traping if command returns error. #Bear in mind that MyShell executes the command again in order to #trap the stderr. This shouldn't be a problem in most cases. #If you turn it off, you'll have to select to trap stderr or not for #every command you excecute. $autoErrorTrap = 1; #Cosmetic defaults. $termCols = 80; //Default width of the output text area $termRows = 20; //Default heght of the output text area $bgColor = "#000000"; //background color $bgInputColor = "#333333"; //color of the input field $outColor = "#00BB00"; //color of the text output from the server $textColor = "#009900"; //color of the hard texts of the terminal $linkColor = "#00FF00"; //color of the links /************** No customize needed from this point *************/ $MyShellVersion = "MyShell 1.0.5 build 20010910"; if($selfSecure){ if (($PHP_AUTH_USER!=$shellUser)||($PHP_AUTH_PW!=$shellPswd)) { Header('WWW-Authenticate: Basic realm="MyShell"'); Header('HTTP/1.0 401 Unauthorized'); echo "