suPHP
21 mars 2014
suPHP är ett sätt att få PHP att exekvera script su’at till ägaren av filen. Detta gör att samtliga PHP-filer kan ha rättigheterna 400. Faktum är att man till och med kan ställa in så att andra rättigheter inte fungerar, inte heller användare vars UID < visst värde.
Installation
- apt-get install libapache2-mod-suphp
- /etc/init.d/apache2 restart
- Testa med ett script innehållade <?php system(’id’); ?>
Tweaks
;User Apache is running as
webserver_user=www-data
;Path all scripts have to be in
docroot=/var/www:${HOME}/public_html
; Security options
allow_file_group_writeable=false
allow_file_others_writeable=false
allow_directory_group_writeable=false
allow_directory_others_writeable=false
;Check wheter script is within DOCUMENT_ROOT
check_vhost_docroot=false
;Send minor error messages to browser
errors_to_browser=true
;Umask to set, specify in octal notation
umask=0022
; Minimum UID
min_uid=100
; Minimum GID
min_gid=100
