• Categories
    Category
  • Categories
    Category
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial Comments FAQ Related Articles

How To Explore Linux Shell Remotely Using PHP Shell

613

To Explore Linux Shell Remotely Using PHP Shell

PHP Shell is a script which is written in PHP that provides Linux Terminal in the Browser. It helps to execute most of the shell commands in browser with limitations. Steps to explore Linux Shell remotely using PHP Shell is summarized in this article.

To Download the PHP Shell

Download the PHP Shell from the following link.

http://sourceforge.net/projects/phpshell/?source=dlp

Steps to Install PHP Shell

Before installing the Apache and PHP, update the repositories.

root@linuxhelp:~# apt-get update
Hit http://in.archive.ubuntu.com wily InRelease
Hit http://security.ubuntu.com wily-security InRelease                
Hit http://in.archive.ubuntu.com wily-updates InRelease               
Hit http://in.archive.ubuntu.com wily-backports InRelease              
Hit http://security.ubuntu.com wily-security/main Sources              
Hit http://in.archive.ubuntu.com wily/main Sources
.
.
.
Hit http://in.archive.ubuntu.com wily-backports/main Translation-en            
Hit http://in.archive.ubuntu.com wily-backports/multiverse Translation-en      
Hit http://in.archive.ubuntu.com wily-backports/restricted Translation-en      
Hit http://in.archive.ubuntu.com wily-backports/universe Translation-en        
Reading package lists... Done

To Install Apache and PHP

For Red Hat System

[root@linuxhelp ~]# yum install httpd php php-mysql 
[root@linuxhelp ~]# service httpd start


For Debian System

root@linuxhelp:~# apt-get install apache2 php5 php5-mysql
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libavahi-client-dev libavahi-common-dev libavahi-compat-libdnssd1
  libdbus-1-dev libjs-jquery libruby2.1 libyaml-0-2 ruby2.1
.
.
.
apache2_invoke: Enable module php5
Setting up php5 (5.6.11+dfsg-1ubuntu3.3) ...
Processing triggers for libc-bin (2.21-0ubuntu4) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for systemd (225-1ubuntu9) ...
root@linuxhelp:~# service apache2 start


Default working directory for Apache are as follows.

For Debian based distributions: /var/www

For RedHat based distributions: /var/www/html

Important: For security reason, it can be changed to any other folder.

Downloaded PHP Shell archive file should be moved to Apache working directory.

Now download the php shell in your browser.

1

Now unzip the package from the downloaded location

root@linuxhelp:~# cd Downloads/
root@linuxhelp:~/Downloads# ls
phpshell-2.4.zip
root@linuxhelp:~/Downloads# unzip phpshell-2.4.zip 
Archive:  phpshell-2.4.zip
   creating: phpshell-2.4/
  inflating: phpshell-2.4/ChangeLog  
  inflating: phpshell-2.4/INSTALL    
  inflating: phpshell-2.4/AUTHORS    
  inflating: phpshell-2.4/phpshell.php  
  inflating: phpshell-2.4/style.css  
  inflating: phpshell-2.4/pwhash.php  
  inflating: phpshell-2.4/COPYING    
  inflating: phpshell-2.4/config.php  
  inflating: phpshell-2.4/phpshell.ico  
  inflating: phpshell-2.4/SECURITY   
  inflating: phpshell-2.4/README     
root@linuxhelp:~/Downloads# ls
phpshell-2.4  phpshell-2.4.zip


Now copy the extracted PHPshell directory into your default document root directory.

root@linuxhelp:~/Downloads# cp -r phpshell-2.4 /var/www/html
root@linuxhelp:~/Downloads# cd /var/www/html
root@linuxhelp:/var/www/html# ls
index.html  phpshell-2.4


Now rename the directory as PHPshell.

root@linuxhelp:/var/www/html# mv phpshell-2.4 phpshell
root@linuxhelp:/var/www/html# ls
index.html  phpshell


Now rename the phpshell.php as index.php, which is located under phpshell directory.

root@linuxhelp:/var/www/html# cd phpshell/
root@linuxhelp:/var/www/html/phpshell# ls
AUTHORS    config.php  INSTALL       phpshell.php  README    style.css
ChangeLog  COPYING     phpshell.ico  pwhash.php    SECURITY
root@linuxhelp:/var/www/html/phpshell# mv phpshell.php index.php
root@linuxhelp:/var/www/html/phpshell# ls
AUTHORS    config.php  index.php  phpshell.ico  README    style.css
ChangeLog  COPYING     INSTALL    pwhash.php    SECURITY


Now navigate to “ http://127.0.0.1/phpshell“ in the web browser.

2

To create user

Click the pwhash.php script, to create a user name and password.

3

In the above php page enter the Username, password and click ' Update' .

4

Add the sha line into config.php in the [user] section.

5

Now open the config.php file.


root@linuxhelp:/var/www/html/phpshell# vim config.php


Add the line in username section.

linuxhelp = " sha1:6939c784:c8732ccba93b751775b0db3bc0c829700c8955a4"
According to the username and password, sha1 will be unique.

Save and exit the config.php file.

Visit http://127.0.0.1/phpshell. Login using your ‘ User Name‘ and ‘ Password‘ .

6

Now you have logged into the php shell, you can able to execute the shell commands in the browser.

7

Disadvantages of PHP Shell

  • Additional input were not support.
  • At a certain time, all the webserver is configured to timeout.
  • One line command is used in the PHPshell.

Tags:
caden
Author: 

Comments ( 0 )

No comments available

Add a comment

Frequently asked questions ( 5 )

Q

What are all the package to install by configuring php?

A

You can install package of php by using following command
yum install httpd php php-mysql

Q

How to install php on suse Linux?

A

Install php on Suse Linux by using following command
zypper install php

Q

What are all the advantages of using the php in Linux?

A

PHP Shell is a script which is written in PHP that provides Linux Terminal in the Browser.
It helps to execute most of the shell commands in a browser with limitations.

Q

Which link to get the archive file of php shell?

A

you can get archive file of php shell by using following link
http://sourceforge.net/projects/phpshell/?source=dlp

Q

what are all the disadvantages of php shell in linux?

A

Disadvantages of php shell in linux are

Additional input were not support.
At a certain time, all the webserver is configured to timeout.
One line command is used in the PHPshell.

Related Tutorials in How To Explore Linux Shell Remotely Using PHP Shell

Related Tutorials in How To Explore Linux Shell Remotely Using PHP Shell

How to create Shell Script on Debian 12
How to create Shell Script on Debian 12
Sep 29, 2023
How To Explore Linux Shell Remotely Using PHP Shell
How To Explore Linux Shell Remotely Using PHP Shell
May 13, 2016
How to create a Shell and Subshell on Rocky Linux 9.2
How to create a Shell and Subshell on Rocky Linux 9.2
Oct 9, 2023
What is Shell and Sub Shell in Bash Script
What is Shell and Sub Shell in Bash Script
Nov 3, 2023
How to Create a Shell and Subshell on Oracle Linux 9.2
How to Create a Shell and Subshell on Oracle Linux 9.2
Sep 16, 2023

Related Forums in How To Explore Linux Shell Remotely Using PHP Shell

Related Forums in How To Explore Linux Shell Remotely Using PHP Shell

FreeNAS
AadrikaAnshu class=
How to change the default shell zsh to bash in freenas 11.02
Jul 6, 2019
Shell
jackbrookes class=
Adduser without login
Jan 30, 2018
Shell Script
gibbson class=
How to pass and get variables to user account from root account using shell script
Oct 26, 2017
Shell
caleb class=
how to know which shell i am using
Feb 4, 2017
Shell
jacob class=
How to get a domain list from using a command
Nov 4, 2019
Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help Elijah ?
Remote Desktop Connection Has Stopped Working

When accessing my remote machine server using remote desktop on a windows machine I am getting this error

forum (1)

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.