summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorStefan Esser2014-02-15 21:26:45 +0100
committerStefan Esser2014-02-15 21:26:45 +0100
commit7013b819e71e6dafe1fbed04ae0dee236d253234 (patch)
treefa21df050a8f6465ba58349e62da3dde3ca83967 /tests
parent7336a8080e8b1611795d8038e2b816340ce3e4e1 (diff)
Tests suhosin.upload.disallow_elf
Diffstat (limited to 'tests')
-rw-r--r--tests/filter/suhosin_upload_disallow_elf.phpt58
-rw-r--r--tests/filter/suhosin_upload_disallow_elf_off.phpt57
2 files changed, 115 insertions, 0 deletions
diff --git a/tests/filter/suhosin_upload_disallow_elf.phpt b/tests/filter/suhosin_upload_disallow_elf.phpt
new file mode 100644
index 0000000..4ad2071
--- /dev/null
+++ b/tests/filter/suhosin_upload_disallow_elf.phpt
@@ -0,0 +1,58 @@
1--TEST--
2Testing: suhosin.upload.disallow_elf=On
3--INI--
4suhosin.log.syslog=0
5suhosin.log.sapi=0
6suhosin.log.stdout=255
7suhosin.log.script=0
8file_uploads=1
9suhosin.upload.disallow_elf=On
10--SKIPIF--
11<?php include('skipif.inc'); ?>
12--COOKIE--
13--GET--
14--POST_RAW--
15Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737
16-----------------------------20896060251896012921717172737
17Content-Disposition: form-data; name="A"; filename="A"
18
19ELFABCDEFGHIJKLMN
20-----------------------------20896060251896012921717172737
21Content-Disposition: form-data; name="B"; filename="B"
22
23XELFABCDEFGHIJKLMN
24-----------------------------20896060251896012921717172737--
25--FILE--
26<?php
27var_dump($_FILES);
28?>
29--EXPECTF--
30array(2) {
31 ["A"]=>
32 array(5) {
33 ["name"]=>
34 string(1) "A"
35 ["type"]=>
36 string(0) ""
37 ["tmp_name"]=>
38 string(0) ""
39 ["error"]=>
40 int(8)
41 ["size"]=>
42 int(0)
43 }
44 ["B"]=>
45 array(5) {
46 ["name"]=>
47 string(1) "B"
48 ["type"]=>
49 string(0) ""
50 ["tmp_name"]=>
51 string(%d) "%s"
52 ["error"]=>
53 int(0)
54 ["size"]=>
55 int(18)
56 }
57}
58ALERT - uploaded file is an ELF executable - file dropped (attacker 'REMOTE_ADDR not set', file '%s') \ No newline at end of file
diff --git a/tests/filter/suhosin_upload_disallow_elf_off.phpt b/tests/filter/suhosin_upload_disallow_elf_off.phpt
new file mode 100644
index 0000000..8be8301
--- /dev/null
+++ b/tests/filter/suhosin_upload_disallow_elf_off.phpt
@@ -0,0 +1,57 @@
1--TEST--
2Testing: suhosin.upload.disallow_elf=Off
3--INI--
4suhosin.log.syslog=0
5suhosin.log.sapi=0
6suhosin.log.stdout=255
7suhosin.log.script=0
8file_uploads=1
9suhosin.upload.disallow_elf=Off
10--SKIPIF--
11<?php include('skipif.inc'); ?>
12--COOKIE--
13--GET--
14--POST_RAW--
15Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737
16-----------------------------20896060251896012921717172737
17Content-Disposition: form-data; name="A"; filename="A"
18
19ELFABCDEFGHIJKLMN
20-----------------------------20896060251896012921717172737
21Content-Disposition: form-data; name="B"; filename="B"
22
23XELFABCDEFGHIJKLMN
24-----------------------------20896060251896012921717172737--
25--FILE--
26<?php
27var_dump($_FILES);
28?>
29--EXPECTF--
30array(2) {
31 ["A"]=>
32 array(5) {
33 ["name"]=>
34 string(1) "A"
35 ["type"]=>
36 string(0) ""
37 ["tmp_name"]=>
38 string(%d) "%s"
39 ["error"]=>
40 int(0)
41 ["size"]=>
42 int(18)
43 }
44 ["B"]=>
45 array(5) {
46 ["name"]=>
47 string(1) "B"
48 ["type"]=>
49 string(0) ""
50 ["tmp_name"]=>
51 string(%d) "%s"
52 ["error"]=>
53 int(0)
54 ["size"]=>
55 int(18)
56 }
57} \ No newline at end of file