Pages

Wednesday, June 28, 2017

Exploring Linux Shell (Terminal) Remotely Using PHP Shell

PHP Shell or Shell PHP is a program or script written in PHP (Php Hypertext Preprocessor) which provides Linux Terminal (Shell is a much broader concept) in Browser. PHP Shell lets you to execute most of the shell commands in browser, but not all due to its limitations.
Update: Recently, I’ve found a very promising tool called ‘Wetty (Web + tty)’, which provides a complete Linux terminal access over a HTTP or HTTPS protocol and enables you to execute all Linux commands and programs as if you were sitting in front of a real or virtual terminal.
For more information regarding installation and usage of Wetty visit: How to Install Wetty to Access Linux Terminal Over Web Browser

Linux Shell Acess on Browser
Linux Shell Acess on Browser
PHP Shell is very much useful in executing Shell commands on remote web-server, similar to Telnet and SSH. It can be useful in moving, unzipping and handling larger files or bulk files on Web-Server. Administrating and Maintaining a webserver using PHP Shell is very much easier, provided the user has working knowledge of Shell Programs.
When there was Telnet and SSH already, what is the need of phpshell, is a question which may come to the mind of yours. The answer is – in many cases, the firewall is so restrictive that nothing, apart from HTTP(S), gets through, in that case phpshell lets you gain the shell access on a remote server.
However you can not execute a GUI program or an interactive script/program using PHP Shell, It could be it’s limitation but this limitation is a boon, as GUI disabling means higher security.

Download PHP Shell

The latest version can be downloaded from here:
  1. http://sourceforge.net/projects/phpshell/?source=dlp

How to Install PHP Shell

As stated above PHP Shell is written in PHP so you don’t need to install it, just move the archived file to your working apache/httpd directory, and of course you must have Apache and PHP installed.
Install Apache and PHP
Install on Debian based systems using apt-get command.
# apt-get install apache2 
# apt-get install php5 libapache2-mod-auth-mysql php5-mysql
# service apache2 start
Install on Red Hat based systems using yum command.
# yum install httpd 
# yum install php php-mysql
# service httpd start
By default working directory of apache/http is:
on Debian based distro /var/www
on Red Hat based distro /var/www/html
Note: It can be changed to any other folder, and it is recommended as a security measure.
Move the downloaded PHP Shell archive file to Apache working directory. Here I am using Debian system, so my Apache working directory is.
# mv phpshell-2.4.tar.gz /var/www/
Unzip php shell
# tar -zxvf phpshell-2.4.tar.gz
Remove the compressed file.
# rm -rf phpshell-2.4.tar.gz
Rename the php shell folder to anything hard to guess, as a security measure. For example, I move to the phpshell (now tecmint-nix) folder and rename phpshell.php to index.php so that you are redirected directly to the index page and not the contents of the folder.
      ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
                                                    ► Read more: http://adf.ly/1nBRVB
      ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

No comments:

Post a Comment