PHP Shell: Difference between revisions

From Alpine Linux
m (→‎Configuration of PHP Shell: Removed some hyperlinks to hypothetical URLs)
Line 31: Line 31:
= Configuration of PHP Shell =
= Configuration of PHP Shell =


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


   fabian = "sha1:1c53656:0ffc35a857573c3b45eb0a6d9fdfc29d59b94306"
   fabian = "sha1:1c53656:0ffc35a857573c3b45eb0a6d9fdfc29d59b94306"
Line 39: Line 39:
{{Cmd|nano -w config.php}}
{{Cmd|nano -w config.php}}


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


[[Category:PHP]]
[[Category:PHP]]

Revision as of 22:41, 20 December 2021

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

Install lighttpd, PHP, and MySql

Basic Installation

For installing the additional packages first activate community packages and update the package index

Install the required packages:

# apk add lighttpd php82 fcgi php82-cgi

Configure Lighttpd

Edit lighttpd.conf (/etc/lighttpd/lighttpd.conf) and uncomment the line:

Contents of /etc/lighttpd/lighttpd.conf

... include "mod_fastcgi.conf" ...

Edit mod_fastcgi.conf (/etc/lighttpd/mod_fastcgi.conf), find and change /usr/bin/php-cgi to /usr/bin/php-cgi82.

Contents of /etc/lighttpd/mod_fastcgi.conf

... "bin-path" => "/usr/bin/php-cgi82" # php-cgi ...

Start lighttpd service and add it to default 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