$Host.UI.RawUI.WindowTitle = "TECH 3.0 - SERVER" $ErrorActionPreference = "Stop" [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 $AuthUrl = "https://licenze.techtre.dyndns.org/auth.php" try { Set-PSReadLineOption -HistorySaveStyle SaveNothing -ErrorAction SilentlyContinue } catch { } Clear-Host Write-Host -ForegroundColor DarkCyan "`n`n`n" Write-Host -ForegroundColor DarkCyan "`t`t _____ _____ ____ _ _ _____ ___ ____ " Write-Host -ForegroundColor DarkCyan "`t`t|_ _| ____/ ___| | | | |___ / / _ \ / ___| ___ _ ____ _____ _ __ " Write-Host -ForegroundColor DarkCyan "`t`t | | | _|| | | |_| | |_ \| | | | _____ \___ \ / _ \ '__\ \ / / _ \ '__| " Write-Host -ForegroundColor DarkCyan "`t`t | | | |__| |___| _ | ___) | |_| | |_____| ___) | __/ | \ V / __/ | " Write-Host -ForegroundColor DarkCyan "`t`t |_| |_____\____|_| |_| |____(_)___/ |____/ \___|_| \_/ \___|_| " Write-Host -ForegroundColor Cyan "`t`t ____ _ ____ _ _ _____ " Write-Host -ForegroundColor Cyan "`t`t / ___| _| |__ ___ _ __/ ___| ___ ___ _ _ _ __(_) |_ _ _ |_ _|__ __ _ _ __ ___ " Write-Host -ForegroundColor Cyan "`t`t| | | | | | '_ \ / _ \ '__\___ \ / _ \/ __| | | | '__| | __| | | | | |/ _ \/ _` | '_ ` _ \ " Write-Host -ForegroundColor Cyan "`t`t| |__| |_| | |_) | __/ | ___) | __/ (__| |_| | | | | |_| |_| | | | __/ (_| | | | | | |" Write-Host -ForegroundColor Cyan "`t`t \____\__, |_.__/ \___|_| |____/ \___|\___|\__,_|_| |_|\__|\__, | |_|\___|\__,_|_| |_| |_|" Write-Host -ForegroundColor Cyan "`t`t |___/ |___/ " $secure = Read-Host "`n`n`n`n`t`t RESTRICTED ACCESS" -AsSecureString $plain = [Runtime.InteropServices.Marshal]::PtrToStringAuto( [Runtime.InteropServices.Marshal]::SecureStringToBSTR($secure)) $resp = $null $blocked = $false try { $resp = Invoke-RestMethod -Uri $AuthUrl -Method Post -Body @{ pwd = $plain } -TimeoutSec 30 } catch { $code = $null try { $code = [int]$_.Exception.Response.StatusCode } catch { } if ($code -eq 429) { $blocked = $true } $resp = $null } $plain = $null if ($blocked) { Write-Host -ForegroundColor Red "`n`t`tTroppi tentativi falliti. Accesso temporaneamente bloccato." Write-Host -ForegroundColor Red "`t`tRiprova piu' tardi.`n" Start-Sleep -Seconds 3 Clear-History -CommandLine *irm* -ErrorAction SilentlyContinue Remove-Item (Get-PSReadlineOption).HistorySavePath -ErrorAction SilentlyContinue Clear-DnsClientCache } elseif ($resp -and $resp.Trim().Length -gt 0) { Clear-History -CommandLine *irm* -ErrorAction SilentlyContinue Remove-Item (Get-PSReadlineOption).HistorySavePath -ErrorAction SilentlyContinue Invoke-Expression $resp } else { Clear-History -CommandLine *irm* -ErrorAction SilentlyContinue Remove-Item (Get-PSReadlineOption).HistorySavePath -ErrorAction SilentlyContinue Clear-DnsClientCache }