<?php
// FILE: avoid_misconfig_disable_functions.php
// to make these settings permanent, set in the "php.ini" file
// disable_functions and disable_classes can *only* be set in the php.ini file
// use this directive if you allow users to run their own PHP programs
// you can limit which functions they are allowed to use
// this affects *all* PHP programs running on this server!!

date_default_timezone_set('Europe/London');
ini_set('display_errors', 1);

// test "disable_functions"
// to do: open the "php.ini" file and enter the following:
// disable_functions = system,exec
// then restart PHP and re-run this file

// show contents of sensitive folder
$cmd = 'dir c:/Windows/System32/drivers/etc/*.*';	// Windows
//$cmd = 'ls -l /etc';								// Linux / Mac
echo '<pre>';
echo system($cmd);
echo '</pre>';
