PHP Shell

From Alpine Linux
Jump to: navigation, search

PHP Shell is an interface to execute shell-commands or browse the filesystem on your remote web server.

Install lighttpd, PHP, and MySql

Install the additional packages:

apk add lighttpd php5-common php5-iconv php5-json php5-gd php5-curl php5-xml php5-pgsql php5-imap php5-cgi fcgi

apk add php5-pdo php5-pdo_pgsql php5-soap php5-xmlrpc php5-posix php5-mcrypt php5-gettext php5-ldap php5-ctype php5-dom

Configure Lighttpd

vi /etc/lighttpd/lighttpd.conf

Uncomment line:

include "mod_fastcgi.conf"

Start lighttpd service and add to needed runlevel

rc-service lighttpd start && rc-update add lighttpd default

Installing and configuring PHP Shell

Create the a folder named webapps

mkdir -p /usr/share/webapps/

Download the source code

cd /usr/share/webapps/ wget http://downloads.sourceforge.net/project/phpshell/phpshell/2.4/phpshell-2.4.zip

Unpack the archive, rename the created folder, and remove it afterwards

unzip phpshell-2.4.zip mv phpshell-2.4/ phpshell rm phpshell-2.4.zip

Change the folder permissions

chmod -R 777 /usr/share/webapps/

Make a symlinks to the phpshell folder

ln -s /usr/share/webapps/phpshell/ /var/www/localhost/htdocs/phpshell

Configuration of PHP Shell

Browse to http://WEBSERVER_IP_ADDRESS/phpshell/pwhash.php and generate a hashed password for your username.

 fabian = "sha1:1c53656:0ffc35a857573c3b45eb0a6d9fdfc29d59b94306"

Add this to the config.php

nano -w config.php

Now you should be able to login at http://WEBSERVER_IP_ADDRESS/phpshell/phpshell.php