Getting PHP-variables?

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
cmxflash
-


Joined: 11 Dec 2004
Posts: 872

PostPosted: Sun Aug 07, 2005 7:56 pm    Post subject: Getting PHP-variables? Reply with quote

So, I have PHP5 installed on my server, and it works fine.

Lets say I have a file called test.php:
Code:

<?
$variable = "var1";
$variable2 = "var2";

...the rest of the code.

?>


Is it possible for an intruder to get the valute of the variables $variable1 and 2? Without having access to my harddrives, just by some exploit or something like that?
Back to top View user's profile Send private message
MonkeyNation
-


Joined: 05 Feb 2005
Posts: 921
Location: Cardiff

PostPosted: Sun Aug 07, 2005 8:05 pm    Post subject: Re: Getting PHP-variables? Reply with quote

cmxflash wrote:
So, I have PHP5 installed on my server, and it works fine.

Lets say I have a file called test.php:
Code:

<?
$variable = "var1";
$variable2 = "var2";

...the rest of the code.

?>


Is it possible for an intruder to get the valute of the variables $variable1 and 2? Without having access to my harddrives, just by some exploit or something like that?


Not while the files are parsed by the php inturpretter.
A bug may be discovered obviously, but no one can predict that.
_________________
Back to top View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger ICQ Number
k1ll3rdr4g0n
-


Joined: 04 Jul 2004
Posts: 609

PostPosted: Sun Aug 07, 2005 9:44 pm    Post subject: Re: Getting PHP-variables? Reply with quote

cmxflash wrote:
So, I have PHP5 installed on my server, and it works fine.

Lets say I have a file called test.php:
Code:

<?
$variable = "var1";
$variable2 = "var2";

...the rest of the code.

?>


Is it possible for an intruder to get the valute of the variables $variable1 and 2? Without having access to my harddrives, just by some exploit or something like that?


No, because while its interputed by php (like MonkeyNation said) the variables are just stored and not outputed unless you tell it to.

This a very unlikly senerio but its possible, you give someone hosting. They know where your installtion of [insert some php script here] is. They could technically write a script to where itll include the config file and get your config options. like this:

Code:

<?
include '../../../config.php';
echo $db['server'];
echo $db['user'];
echo $db['pass'];
?>


PHP in safe mode prevents against that. But what you can also help prevent that is put your hosted in a completly different folder like c:\www\hosted.

And make sure they don't install any file managers.

But I think if you run linux you can set permissions.
_________________
Back to top View user's profile Send private message AIM Address
cmxflash
-


Joined: 11 Dec 2004
Posts: 872

PostPosted: Sun Aug 07, 2005 10:23 pm    Post subject: Reply with quote

No need, I don't allow PHP to the persons I host on my server.
Back to top View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group