#Requires -Version 5 # ABIS Security Audit - Launcher Windows # Verifie/installe Python, telecharge l'agent, lance l'audit # Usage: double-clic ou clic-droit > Executer avec PowerShell $ErrorActionPreference = "Stop" $AgentUrl = "https://api.abisinfo.net/audit/download" $AgentFile = "$env:TEMP\abis_audit.py" $Version = "1.0.0" function Write-Banner { Clear-Host Write-Host "================================================" -ForegroundColor Cyan Write-Host " ABIS Security Audit - Launcher v$Version" -ForegroundColor Cyan Write-Host "================================================" -ForegroundColor Cyan Write-Host "" } function Test-PythonInstalled { try { $ver = & python --version 2>&1 if ($ver -match "Python (\d+\.\d+)") { return $true } } catch {} try { $ver = & python3 --version 2>&1 if ($ver -match "Python (\d+\.\d+)") { return $true } } catch {} return $false } function Install-Python { Write-Host "[*] Python non detecte - installation en cours..." -ForegroundColor Yellow Write-Host " (winget install Python.Python.3)" -ForegroundColor Gray # Verifier que winget est disponible try { $null = Get-Command winget -ErrorAction Stop } catch { Write-Host "" Write-Host "[!] winget non disponible sur ce systeme." -ForegroundColor Red Write-Host " Installez Python manuellement depuis : https://python.org/downloads" -ForegroundColor Yellow Write-Host " Puis relancez ce script." -ForegroundColor Yellow Read-Host "`nAppuyez sur Entree pour fermer" exit 1 } try { Write-Host "" winget install --id Python.Python.3 --silent --accept-package-agreements --accept-source-agreements Write-Host "" Write-Host "[+] Python installe avec succes." -ForegroundColor Green # Recharger le PATH $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") } catch { Write-Host "[!] Echec installation Python : $_" -ForegroundColor Red Write-Host " Installez Python manuellement : https://python.org/downloads" -ForegroundColor Yellow Read-Host "`nAppuyez sur Entree pour fermer" exit 1 } } function Download-Agent { Write-Host "[*] Telechargement de l'agent ABIS..." -ForegroundColor Cyan try { $wc = New-Object System.Net.WebClient $wc.DownloadFile($AgentUrl, $AgentFile) Write-Host "[+] Agent telecharge : $AgentFile" -ForegroundColor Green } catch { Write-Host "[!] Echec telechargement : $_" -ForegroundColor Red Write-Host " Verifiez votre connexion internet." -ForegroundColor Yellow Read-Host "`nAppuyez sur Entree pour fermer" exit 1 } } function Run-Audit { Write-Host "" Write-Host "[*] Lancement de l'audit de securite..." -ForegroundColor Cyan Write-Host " (cela peut prendre 1-2 minutes)" -ForegroundColor Gray Write-Host "" $pythonCmd = if (Get-Command python -ErrorAction SilentlyContinue) { "python" } else { "python3" } try { & $pythonCmd $AgentFile --once } catch { Write-Host "[!] Erreur lors de l'audit : $_" -ForegroundColor Red } } # ---- Main ---- Write-Banner # 1. Verifier Python if (-not (Test-PythonInstalled)) { Install-Python # Re-verifier apres installation if (-not (Test-PythonInstalled)) { Write-Host "[!] Python toujours introuvable apres installation." -ForegroundColor Red Write-Host " Redemarrez votre PC puis relancez ce script." -ForegroundColor Yellow Read-Host "`nAppuyez sur Entree pour fermer" exit 1 } } else { $ver = & python --version 2>&1 Write-Host "[+] $ver detecte." -ForegroundColor Green } # 2. Telecharger l'agent Download-Agent # 3. Lancer l'audit Run-Audit Write-Host "" Write-Host "================================================" -ForegroundColor Cyan Write-Host " Audit termine. Rapport envoye a ABIS." -ForegroundColor Cyan Write-Host "================================================" -ForegroundColor Cyan Write-Host "" Read-Host "Appuyez sur Entree pour fermer"