63header("X-Content-Type-Options: nosniff"); // With the nosniff option, if the server says the content is text/html, the browser will render it as text/html (note that most browsers now force this option to on)
64header("X-Frame-Options: SAMEORIGIN"); // Frames allowed only if on same domain (stop some XSS attacks)
65
66print "*** TEST READ OF /tmp/test.txt FILE (Example: if file exists and owned by apache process owner + PrivateTmp is false + apparmor rules allows read of owned files in /tmp/, then you should see the file)<br>\n";
67
68$out='';
69$ret=0;
70
71$file = '/tmp/test.txt';
72$f=fopen($file, 'r');
73if ($f) {
74 $s=fread($f, 4096);
75 print $s;
76 fclose($f);
77} else {
78 print "Failed to open file ".$file."<br>\n";
79}
80
81print '<br><br>'."\n";
82
83
84print "*** TEST READ OF /test.txt FILE AND LS /dev/std*<br>\n";
85
86exec('cat /test.txt; ls /dev/std*; sleep 1;', $out, $ret);