/dev/null")); $results['pwsh'][$mod] = strpos($out, 'YES') !== false; } // System Tools $sysTools = [ 'pwsh' => 'which pwsh', 'python3' => 'which python3', 'pip3' => 'which pip3', 'google-chrome' => 'which google-chrome', 'chromium' => 'which chromium-browser', 'x11vnc' => 'which x11vnc', 'Xvfb' => 'which Xvfb', 'node' => 'which node', 'git' => 'which git', 'curl' => 'which curl', 'jq' => 'which jq', 'psql' => 'which psql', 'composer' => 'which composer', 'php' => 'which php' ]; foreach($sysTools as $name => $cmd) { $results['system'][$name] = trim(shell_exec($cmd)) !== ''; } // Python Packages $pipPkgs = ['selenium','playwright','requests','beautifulsoup4','pandas','openpyxl','python-dotenv','cloudflare','dnspython','psycopg2-binary','paramiko','msal','O365']; foreach($pipPkgs as $pkg) { $out = shell_exec("pip3 show $pkg 2>/dev/null | grep -c Name"); $results['pip'][$pkg] = intval(trim($out)) > 0; } // Playwright browsers $results['playwright']['chromium'] = file_exists(shell_exec('python3 -c "import playwright; print(playwright.__file__.replace(\"__init__.py\",\"\"))" 2>/dev/null').'driver/package/.local-browsers') || is_dir('/root/.cache/ms-playwright'); echo json_encode(['success'=>true,'results'=>$results]); exit; case 'install': $output = ''; $success = false; switch($tool) { // PowerShell Modules case 'AzureAD': case 'Az.Accounts': case 'Az.Resources': case 'ExchangeOnlineManagement': case 'MSOnline': case 'Microsoft.Graph': case 'Microsoft.Graph.Authentication': $output = shell_exec("pwsh -Command \"Install-Module -Name $tool -Force -AllowClobber -Scope CurrentUser\" 2>&1"); $check = shell_exec("pwsh -Command \"Get-InstalledModule -Name '$tool' -ErrorAction SilentlyContinue\" 2>/dev/null"); $success = strpos($check, $tool) !== false; break; // System Tools case 'jq': $output = shell_exec("apt-get update && apt-get install -y jq 2>&1"); $success = trim(shell_exec('which jq')) !== ''; break; case 'composer': $output = shell_exec("curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer 2>&1"); $success = trim(shell_exec('which composer')) !== ''; break; case 'node': $output = shell_exec("curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && apt-get install -y nodejs 2>&1"); $success = trim(shell_exec('which node')) !== ''; break; // Python Packages case 'selenium': case 'playwright': case 'requests': case 'beautifulsoup4': case 'pandas': case 'openpyxl': case 'python-dotenv': case 'cloudflare': case 'dnspython': case 'psycopg2-binary': case 'paramiko': case 'msal': case 'O365': $output = shell_exec("pip3 install $tool --break-system-packages 2>&1"); $check = shell_exec("pip3 show $tool 2>/dev/null | grep -c Name"); $success = intval(trim($check)) > 0; break; // Playwright browsers case 'playwright-browsers': $output = shell_exec("playwright install chromium 2>&1"); $success = true; break; } echo json_encode(['success'=>$success,'output'=>$output,'tool'=>$tool]); exit; case 'install_all_pwsh': $modules = ['AzureAD','Az.Accounts','Az.Resources','ExchangeOnlineManagement','MSOnline','Microsoft.Graph']; $output = ''; foreach($modules as $mod) { $output .= "Installing $mod...\n"; $output .= shell_exec("pwsh -Command \"Install-Module -Name $mod -Force -AllowClobber -Scope CurrentUser\" 2>&1"); $output .= "\n"; } echo json_encode(['success'=>true,'output'=>$output]); exit; case 'fix_all': $output = shell_exec('/opt/wevads/scripts/fix-dependencies.sh --force 2>&1'); echo json_encode(['success'=>true,'output'=>$output]); exit; case 'install_all_pip': $pkgs = ['selenium','playwright','requests','beautifulsoup4','pandas','openpyxl','python-dotenv','cloudflare','dnspython','psycopg2-binary','paramiko','msal','O365']; $output = shell_exec("pip3 install " . implode(' ', $pkgs) . " --break-system-packages 2>&1"); echo json_encode(['success'=>true,'output'=>$output]); exit; } exit; } ?> System Tools - WEVAL

System Tools & Dependencies

Retour

Total Outils

Installés

Manquants

—%

Complet

PowerShell Modules

Chargement...

System Tools

Chargement...

Python Packages

Chargement...

Console

[System] Cliquez sur "Vérifier Tout" pour scanner les outils