Accessing files on other virtual hosts (RE: [PHP-DEV] Reading memory "before" a variable)

From: Date: Mon, 05 Feb 2001 15:55:08 +0000
Subject: Accessing files on other virtual hosts (RE: [PHP-DEV] Reading memory "before" a variable)
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-45784@lists.php.net to get a copy of this message
Tried my snippet on a Linux box runnig PHP 4.0.4pl1 with an interesting result; it displayed the source code for both PHP and HTML files from other virtual hosts on the machine! Surly this should not be possible. -Mårten. Icq# 38863127 -----Original Message----- From: Mårten Gustafsson [mailto:marten@ditt.as] Sent: Monday, February 05, 2001 4:12 PM To: php-dev@lists.php.net Subject: [PHP-DEV] Reading memory "before" a variable Using PHP 4.0.4 for Windows it is possible to access memory "before" a variable using a negative index on a string variable. Executing the snippet below outputs a lot of trash but alos the entire source code of a file that is auto prepended. <?php $str = ''; $hello = 'Hello'; for($i = 0; $i > -10000; $i--) { $str .= $hello[$i]; } echo strrev($str); ?> -Mårten. Icq# 38863127 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net For additional commands, e-mail: php-dev-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.dev (#45784) next »