diff options
| author | Stefan Esser | 2014-05-15 14:09:27 +0200 |
|---|---|---|
| committer | Stefan Esser | 2014-05-15 14:09:27 +0200 |
| commit | 7c208bb39a6440f7fc2d6f0913a7ab3e3249a221 (patch) | |
| tree | d3ecb224f324c7ddbb883196c5b7b0d0ba6b1d64 | |
| parent | 9ec6eb401c5c9dec126826f22ab1a71322758ad0 (diff) | |
Adding some tests for logging shellscripts
| -rw-r--r-- | tests/logging/logscript_executable.phpt | 17 | ||||
| -rw-r--r-- | tests/logging/logscript_nonexecutable.phpt | 19 | ||||
| -rw-r--r-- | tests/logging/logscript_nonexistant.phpt | 19 |
3 files changed, 55 insertions, 0 deletions
diff --git a/tests/logging/logscript_executable.phpt b/tests/logging/logscript_executable.phpt new file mode 100644 index 0000000..f6d535c --- /dev/null +++ b/tests/logging/logscript_executable.phpt | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | --TEST-- | ||
| 2 | Testing: suhosin.log.script.name=EXECUTABLE | ||
| 3 | --SKIPIF-- | ||
| 4 | <?php include "../skipifnotcli.inc"; ?> | ||
| 5 | --INI-- | ||
| 6 | suhosin.log.sapi=0 | ||
| 7 | suhosin.log.stdout=0 | ||
| 8 | suhosin.log.script=255 | ||
| 9 | suhosin.log.script.name=/bin/echo | ||
| 10 | suhosin.log.syslog=0 | ||
| 11 | suhosin.executor.func.blacklist=max | ||
| 12 | --FILE-- | ||
| 13 | <?php | ||
| 14 | max(1,2); | ||
| 15 | ?> | ||
| 16 | --EXPECTF-- | ||
| 17 | Warning: max() has been disabled for security reasons in %s on line 2 \ No newline at end of file | ||
diff --git a/tests/logging/logscript_nonexecutable.phpt b/tests/logging/logscript_nonexecutable.phpt new file mode 100644 index 0000000..c83fd7b --- /dev/null +++ b/tests/logging/logscript_nonexecutable.phpt | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | --TEST-- | ||
| 2 | Testing: suhosin.log.script.name=NON-EXECUTABLE | ||
| 3 | --SKIPIF-- | ||
| 4 | <?php include "../skipifnotcli.inc"; ?> | ||
| 5 | --INI-- | ||
| 6 | suhosin.log.sapi=0 | ||
| 7 | suhosin.log.stdout=0 | ||
| 8 | suhosin.log.script=255 | ||
| 9 | suhosin.log.script.name=/etc/passwd | ||
| 10 | suhosin.log.syslog=0 | ||
| 11 | suhosin.executor.func.blacklist=max | ||
| 12 | --FILE-- | ||
| 13 | <?php | ||
| 14 | max(1,2); | ||
| 15 | ?> | ||
| 16 | --EXPECTF-- | ||
| 17 | ALERT - logging shell script /etc/passwd is not executable - file dropped (attacker 'REMOTE_ADDR not set', file '%s', line 2) | ||
| 18 | |||
| 19 | Warning: max() has been disabled for security reasons in %s on line 2 \ No newline at end of file | ||
diff --git a/tests/logging/logscript_nonexistant.phpt b/tests/logging/logscript_nonexistant.phpt new file mode 100644 index 0000000..4d501be --- /dev/null +++ b/tests/logging/logscript_nonexistant.phpt | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | --TEST-- | ||
| 2 | Testing: suhosin.log.script.name=NON-EXISTANT | ||
| 3 | --SKIPIF-- | ||
| 4 | <?php include "../skipifnotcli.inc"; ?> | ||
| 5 | --INI-- | ||
| 6 | suhosin.log.sapi=0 | ||
| 7 | suhosin.log.stdout=0 | ||
| 8 | suhosin.log.script=255 | ||
| 9 | suhosin.log.script.name=/php/non-existant-script-really-really-really | ||
| 10 | suhosin.log.syslog=0 | ||
| 11 | suhosin.executor.func.blacklist=max | ||
| 12 | --FILE-- | ||
| 13 | <?php | ||
| 14 | max(1,2); | ||
| 15 | ?> | ||
| 16 | --EXPECTF-- | ||
| 17 | ALERT - unable to find logging shell script /php/non-existant-script-really-really-really - file dropped (attacker 'REMOTE_ADDR not set', file '%s', line 2) | ||
| 18 | |||
| 19 | Warning: max() has been disabled for security reasons in %s on line 2 \ No newline at end of file | ||
