diff options
Diffstat (limited to 'src/tests')
11 files changed, 26 insertions, 60 deletions
diff --git a/src/tests/deny_writable/deny_writable_execution.phpt b/src/tests/deny_writable/deny_writable_execution.phpt index a629479..383ffa5 100644 --- a/src/tests/deny_writable/deny_writable_execution.phpt +++ b/src/tests/deny_writable/deny_writable_execution.phpt | |||
| @@ -21,6 +21,8 @@ sp.configuration_file={PWD}/config/config_disable_writable.ini | |||
| 21 | $dir = __DIR__; | 21 | $dir = __DIR__; |
| 22 | 22 | ||
| 23 | // just in case | 23 | // just in case |
| 24 | @chmod("$dir/non_writable_file.txt", 0777); | ||
| 25 | @chmod("$dir/writable_file.txt", 0777); | ||
| 24 | @unlink("$dir/non_writable_file.txt"); | 26 | @unlink("$dir/non_writable_file.txt"); |
| 25 | @unlink("$dir/writable_file.txt"); | 27 | @unlink("$dir/writable_file.txt"); |
| 26 | 28 | ||
| @@ -31,13 +33,5 @@ chmod("$dir/writable_file.txt", 0777); | |||
| 31 | include "$dir/non_writable_file.txt"; | 33 | include "$dir/non_writable_file.txt"; |
| 32 | include "$dir/writable_file.txt"; | 34 | include "$dir/writable_file.txt"; |
| 33 | ?> | 35 | ?> |
| 34 | --CLEAN-- | ||
| 35 | <?php | ||
| 36 | $dir = __DIR__; | ||
| 37 | chmod("$dir/non_writable_file.txt", 0777); | ||
| 38 | chmod("$dir/writable_file.txt", 0777); | ||
| 39 | unlink("$dir/non_writable_file.txt"); | ||
| 40 | unlink("$dir/writable_file.txt"); | ||
| 41 | ?> | ||
| 42 | --EXPECTF-- | 36 | --EXPECTF-- |
| 43 | Fatal error: [snuffleupagus][0.0.0.0][readonly_exec][drop] Attempted execution of a writable file (%a/deny_writable_execution.php) in %a/deny_writable_execution.php on line 2 | 37 | Fatal error: [snuffleupagus][0.0.0.0][readonly_exec][drop] Attempted execution of a writable file (%a/deny_writable_execution.php) in %a/deny_writable_execution.php on line 2 |
diff --git a/src/tests/deny_writable/deny_writable_execution_simulation.phpt b/src/tests/deny_writable/deny_writable_execution_simulation.phpt index d4e4801..39dab32 100644 --- a/src/tests/deny_writable/deny_writable_execution_simulation.phpt +++ b/src/tests/deny_writable/deny_writable_execution_simulation.phpt | |||
| @@ -22,6 +22,8 @@ sp.configuration_file={PWD}/config/config_disable_writable_simulation.ini | |||
| 22 | $dir = __DIR__; | 22 | $dir = __DIR__; |
| 23 | 23 | ||
| 24 | // just in case | 24 | // just in case |
| 25 | @chmod("$dir/non_writable_file.txt", 0777); | ||
| 26 | @chmod("$dir/writable_file.txt", 0777); | ||
| 25 | @unlink("$dir/non_writable_file.txt"); | 27 | @unlink("$dir/non_writable_file.txt"); |
| 26 | @unlink("$dir/writable_file.txt"); | 28 | @unlink("$dir/writable_file.txt"); |
| 27 | 29 | ||
| @@ -32,23 +34,15 @@ chmod("$dir/non_writable_file.txt", 0400); | |||
| 32 | include "$dir/writable_file.txt"; | 34 | include "$dir/writable_file.txt"; |
| 33 | include "$dir/non_writable_file.txt"; | 35 | include "$dir/non_writable_file.txt"; |
| 34 | ?> | 36 | ?> |
| 35 | --CLEAN-- | ||
| 36 | <?php | ||
| 37 | $dir = __DIR__; | ||
| 38 | chmod("$dir/non_writable_file.txt", 0777); | ||
| 39 | chmod("$dir/writable_file.txt", 0777); | ||
| 40 | unlink("$dir/non_writable_file.txt"); | ||
| 41 | unlink("$dir/writable_file.txt"); | ||
| 42 | ?> | ||
| 43 | --EXPECTF-- | 37 | --EXPECTF-- |
| 44 | Warning: [snuffleupagus][0.0.0.0][readonly_exec][simulation] Attempted execution of a writable file (%a/deny_writable_execution_simulation.php) in %a/deny_writable_execution_simulation.php on line 2 | 38 | Warning: [snuffleupagus][0.0.0.0][readonly_exec][simulation] Attempted execution of a writable file (%a/deny_writable_execution_simulation.php) in %a/deny_writable_execution_simulation.php on line %d |
| 45 | 39 | ||
| 46 | Warning: [snuffleupagus][0.0.0.0][readonly_exec][simulation] Attempted execution of a writable file (%a/writable_file.txt) in %a/deny_writable_execution_simulation.php on line 12 | 40 | Warning: [snuffleupagus][0.0.0.0][readonly_exec][simulation] Attempted execution of a writable file (%a/writable_file.txt) in %a/deny_writable_execution_simulation.php on line %d |
| 47 | 41 | ||
| 48 | Warning: [snuffleupagus][0.0.0.0][readonly_exec][simulation] Attempted execution of a writable file (%a/writable_file.txt) in %a/writable_file.txt on line 1 | 42 | Warning: [snuffleupagus][0.0.0.0][readonly_exec][simulation] Attempted execution of a writable file (%a/writable_file.txt) in %a/writable_file.txt on line %d |
| 49 | Code execution within a writable file. | 43 | Code execution within a writable file. |
| 50 | 44 | ||
| 51 | Warning: [snuffleupagus][0.0.0.0][readonly_exec][simulation] Attempted execution of a file owned by the PHP process (%s/tests/deny_writable/non_writable_file.txt) in %s/tests/deny_writable/deny_writable_execution_simulation.php on line 13 | 45 | Warning: [snuffleupagus][0.0.0.0][readonly_exec][simulation] Attempted execution of a file owned by the PHP process (%s/tests/deny_writable/non_writable_file.txt) in %s/tests/deny_writable/deny_writable_execution_simulation.php on line %d |
| 52 | 46 | ||
| 53 | Warning: [snuffleupagus][0.0.0.0][readonly_exec][simulation] Attempted execution of a file owned by the PHP process (%s/tests/deny_writable/non_writable_file.txt) in %src/tests/deny_writable/non_writable_file.txt on line 1 | 47 | Warning: [snuffleupagus][0.0.0.0][readonly_exec][simulation] Attempted execution of a file owned by the PHP process (%s/tests/deny_writable/non_writable_file.txt) in %src/tests/deny_writable/non_writable_file.txt on line %d |
| 54 | Code execution within a non-writable file. | 48 | Code execution within a non-writable file. |
diff --git a/src/tests/deny_writable/dump_deny_writable_execution.phpt b/src/tests/deny_writable/dump_deny_writable_execution.phpt index c6dd6cd..2e6bca5 100644 --- a/src/tests/deny_writable/dump_deny_writable_execution.phpt +++ b/src/tests/deny_writable/dump_deny_writable_execution.phpt | |||
| @@ -32,6 +32,8 @@ foreach (glob("/tmp/dump_result/sp_dump.*") as $dump) { | |||
| 32 | $dir = __DIR__; | 32 | $dir = __DIR__; |
| 33 | 33 | ||
| 34 | // just in case | 34 | // just in case |
| 35 | @chmod("$dir/non_writable_file.txt", 0777); | ||
| 36 | @chmod("$dir/writable_file.txt", 0777); | ||
| 35 | @unlink("$dir/non_writable_file.txt"); | 37 | @unlink("$dir/non_writable_file.txt"); |
| 36 | @unlink("$dir/writable_file.txt"); | 38 | @unlink("$dir/writable_file.txt"); |
| 37 | 39 | ||
| @@ -57,11 +59,3 @@ if ($res[2] != "GET:get_a='data_get_a_readonly' get_b='data_get_b_readonly' \n") | |||
| 57 | --EXPECTF-- | 59 | --EXPECTF-- |
| 58 | %a | 60 | %a |
| 59 | WIN | 61 | WIN |
| 60 | --CLEAN-- | ||
| 61 | <?php | ||
| 62 | $dir = __DIR__; | ||
| 63 | chmod("$dir/non_writable_file.txt", 0777); | ||
| 64 | chmod("$dir/writable_file.txt", 0777); | ||
| 65 | unlink("$dir/non_writable_file.txt"); | ||
| 66 | unlink("$dir/writable_file.txt"); | ||
| 67 | ?> | ||
diff --git a/src/tests/disable_function/disabled_function_echo.phpt b/src/tests/disable_function/disabled_function_echo.phpt index 12aaff4..b1da0dc 100644 --- a/src/tests/disable_function/disabled_function_echo.phpt +++ b/src/tests/disable_function/disabled_function_echo.phpt | |||
| @@ -13,7 +13,6 @@ echo "qwe"; | |||
| 13 | test("rty"); | 13 | test("rty"); |
| 14 | test("oops"); | 14 | test("oops"); |
| 15 | ?> | 15 | ?> |
| 16 | --CLEAN-- | ||
| 17 | --EXPECTF-- | 16 | --EXPECTF-- |
| 18 | qwerty | 17 | qwerty |
| 19 | Fatal error: [snuffleupagus][0.0.0.0][disabled_function][drop] Aborted execution on call of the function 'echo' in %a/disabled_function_echo.php on line 3 | 18 | Fatal error: [snuffleupagus][0.0.0.0][disabled_function][drop] Aborted execution on call of the function 'echo' in %a/disabled_function_echo.php on line 3 |
diff --git a/src/tests/disable_function/disabled_function_echo_2.phpt b/src/tests/disable_function/disabled_function_echo_2.phpt index 82a2fa1..c1d9817 100644 --- a/src/tests/disable_function/disabled_function_echo_2.phpt +++ b/src/tests/disable_function/disabled_function_echo_2.phpt | |||
| @@ -9,7 +9,6 @@ sp.configuration_file={PWD}/config/disabled_function_echo.ini | |||
| 9 | echo "qwe"; | 9 | echo "qwe"; |
| 10 | echo "1", "oops"; | 10 | echo "1", "oops"; |
| 11 | ?> | 11 | ?> |
| 12 | --CLEAN-- | ||
| 13 | --EXPECTF-- | 12 | --EXPECTF-- |
| 14 | qwe1 | 13 | qwe1 |
| 15 | Fatal error: [snuffleupagus][0.0.0.0][disabled_function][drop] Aborted execution on call of the function 'echo' in %a/disabled_function_echo_2.php on line 3 | 14 | Fatal error: [snuffleupagus][0.0.0.0][disabled_function][drop] Aborted execution on call of the function 'echo' in %a/disabled_function_echo_2.php on line 3 |
diff --git a/src/tests/disable_function/disabled_function_echo_local_var.phpt b/src/tests/disable_function/disabled_function_echo_local_var.phpt index ee1be1f..52d1f48 100644 --- a/src/tests/disable_function/disabled_function_echo_local_var.phpt +++ b/src/tests/disable_function/disabled_function_echo_local_var.phpt | |||
| @@ -14,7 +14,6 @@ test(); | |||
| 14 | $abc = 123; | 14 | $abc = 123; |
| 15 | test(); | 15 | test(); |
| 16 | ?> | 16 | ?> |
| 17 | --CLEAN-- | ||
| 18 | --EXPECTF-- | 17 | --EXPECTF-- |
| 19 | 3 | 18 | 3 |
| 20 | 19 | ||
diff --git a/src/tests/disable_function/disabled_function_print.phpt b/src/tests/disable_function/disabled_function_print.phpt index ec1b04f..9600854 100644 --- a/src/tests/disable_function/disabled_function_print.phpt +++ b/src/tests/disable_function/disabled_function_print.phpt | |||
| @@ -13,7 +13,6 @@ print "qwe"; | |||
| 13 | test("rty"); | 13 | test("rty"); |
| 14 | test("oops"); | 14 | test("oops"); |
| 15 | ?> | 15 | ?> |
| 16 | --CLEAN-- | ||
| 17 | --EXPECTF-- | 16 | --EXPECTF-- |
| 18 | qwerty | 17 | qwerty |
| 19 | Fatal error: [snuffleupagus][0.0.0.0][disabled_function][drop] Aborted execution on call of the function 'echo' in %a/disabled_function_print.php on line 3 \ No newline at end of file | 18 | Fatal error: [snuffleupagus][0.0.0.0][disabled_function][drop] Aborted execution on call of the function 'echo' in %a/disabled_function_print.php on line 3 |
diff --git a/src/tests/xxe/disable_xxe_dom_disabled.phpt b/src/tests/xxe/disable_xxe_dom_disabled.phpt index 4a888ed..20399ec 100644 --- a/src/tests/xxe/disable_xxe_dom_disabled.phpt +++ b/src/tests/xxe/disable_xxe_dom_disabled.phpt | |||
| @@ -10,6 +10,9 @@ dom | |||
| 10 | --FILE-- | 10 | --FILE-- |
| 11 | <?php | 11 | <?php |
| 12 | $dir = __DIR__; | 12 | $dir = __DIR__; |
| 13 | @unlink($dir . "/content.xml"); | ||
| 14 | @unlink($dir . "/content.txt"); | ||
| 15 | |||
| 13 | $content = '<content>WARNING, external entity loaded!</content>'; | 16 | $content = '<content>WARNING, external entity loaded!</content>'; |
| 14 | file_put_contents($dir . '/content.txt', $content); | 17 | file_put_contents($dir . '/content.txt', $content); |
| 15 | 18 | ||
| @@ -52,9 +55,3 @@ libxml_disable_entity to false: WARNING, external entity loaded! | |||
| 52 | 55 | ||
| 53 | Warning: [snuffleupagus][0.0.0.0][xxe][log] A call to libxml_disable_entity_loader was tried and nopped in %s/tests/xxe/disable_xxe_dom_disabled.php on line %d | 56 | Warning: [snuffleupagus][0.0.0.0][xxe][log] A call to libxml_disable_entity_loader was tried and nopped in %s/tests/xxe/disable_xxe_dom_disabled.php on line %d |
| 54 | without xxe: foo | 57 | without xxe: foo |
| 55 | --CLEAN-- | ||
| 56 | <?php | ||
| 57 | $dir = __DIR__; | ||
| 58 | unlink($dir . "/content.xml"); | ||
| 59 | unlink($dir . "/content.txt"); | ||
| 60 | ?> | ||
diff --git a/src/tests/xxe/disable_xxe_simplexml.phpt b/src/tests/xxe/disable_xxe_simplexml.phpt index 9560156..8a4f033 100644 --- a/src/tests/xxe/disable_xxe_simplexml.phpt +++ b/src/tests/xxe/disable_xxe_simplexml.phpt | |||
| @@ -11,6 +11,9 @@ simplexml | |||
| 11 | --FILE-- | 11 | --FILE-- |
| 12 | <?php | 12 | <?php |
| 13 | $dir = __DIR__; | 13 | $dir = __DIR__; |
| 14 | @unlink($dir . "/content.xml"); | ||
| 15 | @unlink($dir . "/content.txt"); | ||
| 16 | |||
| 14 | $content = 'WARNING, external entity loaded!'; | 17 | $content = 'WARNING, external entity loaded!'; |
| 15 | file_put_contents('content.txt', $content); | 18 | file_put_contents('content.txt', $content); |
| 16 | 19 | ||
| @@ -44,9 +47,3 @@ printf("without xxe: %s", $doc->testing); | |||
| 44 | libxml_disable_entity to true: | 47 | libxml_disable_entity to true: |
| 45 | libxml_disable_entity to false: | 48 | libxml_disable_entity to false: |
| 46 | without xxe: foo | 49 | without xxe: foo |
| 47 | --CLEAN-- | ||
| 48 | <?php | ||
| 49 | $dir = __DIR__; | ||
| 50 | unlink($dir . "/content.xml"); | ||
| 51 | unlink($dir . "/content.txt"); | ||
| 52 | ?> | ||
diff --git a/src/tests/xxe/disable_xxe_simplexml_oop.phpt b/src/tests/xxe/disable_xxe_simplexml_oop.phpt index 1b2c4ca..c28c364 100644 --- a/src/tests/xxe/disable_xxe_simplexml_oop.phpt +++ b/src/tests/xxe/disable_xxe_simplexml_oop.phpt | |||
| @@ -11,6 +11,9 @@ simplexml | |||
| 11 | --FILE-- | 11 | --FILE-- |
| 12 | <?php | 12 | <?php |
| 13 | $dir = __DIR__; | 13 | $dir = __DIR__; |
| 14 | @unlink($dir . "/content.xml"); | ||
| 15 | @unlink($dir . "/content.txt"); | ||
| 16 | |||
| 14 | $content = 'WARNING, external entity loaded!'; | 17 | $content = 'WARNING, external entity loaded!'; |
| 15 | file_put_contents('content.txt', $content); | 18 | file_put_contents('content.txt', $content); |
| 16 | 19 | ||
| @@ -44,9 +47,3 @@ printf("without xxe: %s", $doc->testing); | |||
| 44 | libxml_disable_entity to true: | 47 | libxml_disable_entity to true: |
| 45 | libxml_disable_entity to false: | 48 | libxml_disable_entity to false: |
| 46 | without xxe: foo | 49 | without xxe: foo |
| 47 | --CLEAN-- | ||
| 48 | <?php | ||
| 49 | $dir = __DIR__; | ||
| 50 | unlink($dir . "/content.xml"); | ||
| 51 | unlink($dir . "/content.txt"); | ||
| 52 | ?> | ||
diff --git a/src/tests/xxe/disable_xxe_xml_parse.phpt b/src/tests/xxe/disable_xxe_xml_parse.phpt index bc7e338..4a8292d 100644 --- a/src/tests/xxe/disable_xxe_xml_parse.phpt +++ b/src/tests/xxe/disable_xxe_xml_parse.phpt | |||
| @@ -16,6 +16,9 @@ sp.configuration_file={PWD}/config/disable_xxe.ini | |||
| 16 | --FILE-- | 16 | --FILE-- |
| 17 | <?php | 17 | <?php |
| 18 | $dir = __DIR__; | 18 | $dir = __DIR__; |
| 19 | @unlink($dir . "/content.xml"); | ||
| 20 | @unlink($dir . "/content.txt"); | ||
| 21 | |||
| 19 | $content = 'WARNING, external entity loaded!'; | 22 | $content = 'WARNING, external entity loaded!'; |
| 20 | file_put_contents('content.txt', $content); | 23 | file_put_contents('content.txt', $content); |
| 21 | 24 | ||
| @@ -71,7 +74,7 @@ $doc = xml_parse($parser, $xml, true); | |||
| 71 | xml_parser_free($parser); | 74 | xml_parser_free($parser); |
| 72 | 75 | ||
| 73 | --EXPECTF-- | 76 | --EXPECTF-- |
| 74 | Warning: [snuffleupagus][0.0.0.0][xxe][log] A call to libxml_disable_entity_loader was tried and nopped in %a.php on line 41 | 77 | Warning: [snuffleupagus][0.0.0.0][xxe][log] A call to libxml_disable_entity_loader was tried and nopped in %a.php on line %d |
| 75 | string(4) "TEST" | 78 | string(4) "TEST" |
| 76 | 79 | ||
| 77 | array(0) { | 80 | array(0) { |
| @@ -83,7 +86,7 @@ array(0) { | |||
| 83 | string(7) "TESTING" | 86 | string(7) "TESTING" |
| 84 | string(4) "TEST" | 87 | string(4) "TEST" |
| 85 | 88 | ||
| 86 | Warning: [snuffleupagus][0.0.0.0][xxe][log] A call to libxml_disable_entity_loader was tried and nopped in %a.php on line 46 | 89 | Warning: [snuffleupagus][0.0.0.0][xxe][log] A call to libxml_disable_entity_loader was tried and nopped in %a.php on line %d |
| 87 | string(4) "TEST" | 90 | string(4) "TEST" |
| 88 | 91 | ||
| 89 | array(0) { | 92 | array(0) { |
| @@ -104,9 +107,3 @@ array(0) { | |||
| 104 | } | 107 | } |
| 105 | textfoostring(7) "TESTING" | 108 | textfoostring(7) "TESTING" |
| 106 | string(4) "TEST" | 109 | string(4) "TEST" |
| 107 | --CLEAN-- | ||
| 108 | <?php | ||
| 109 | $dir = __DIR__; | ||
| 110 | unlink($dir . "/content.xml"); | ||
| 111 | unlink($dir . "/content.txt"); | ||
| 112 | ?> | ||
