PHP Shell: Difference between revisions
(use https links) |
|||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
[ | [https://sourceforge.net/projects/phpshell PHP Shell] is an interface to execute shell-commands or browse the filesystem on your remote web server. | ||
= Install lighttpd, PHP, and MySql = | = Install lighttpd, PHP, and MySql = | ||
Line 13: | Line 13: | ||
{{Cmd|cd /usr/share/webapps/ | {{Cmd|cd /usr/share/webapps/ | ||
wget | wget <nowiki>https://downloads.sourceforge.net/project/phpshell/phpshell/2.4/phpshell-2.4.zip</nowiki>}} | ||
Unpack the archive, rename the created folder, and remove it afterwards | Unpack the archive, rename the created folder, and remove it afterwards | ||
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]] |
Latest revision as of 02:58, 25 August 2023
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
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
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 https://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