# LeetINT PC check loader. Pairs this PC with a check someone asked for, shows who # asked, and runs the checker only after you type Y. $ErrorActionPreference = 'Stop' $api = 'https://go.leetint.lol' function Line { param($t, $c = 'Gray') Write-Host $t -ForegroundColor $c } try { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 } catch {} Line '' Line ' LeetINT PC check' 'Cyan' $code = (Read-Host ' Code').Trim() if (-not $code) { Line ' No code. Nothing was run.' 'Yellow'; return } try { $claim = Invoke-RestMethod -Uri "$api/api/autoscan/claim" -Method Post -TimeoutSec 30 ` -ContentType 'application/json' ` -Body (@{ code = $code; machine = $env:COMPUTERNAME } | ConvertTo-Json -Compress) } catch { $msg = 'That code could not be used. Ask for a new one with /autoscan.' try { $msg = ($_.ErrorDetails.Message | ConvertFrom-Json).message } catch {} Line " $msg" 'Red' return } Line " Requested by $($claim.requester). Scans this PC as admin and sends them the findings." 'White' $ok = Read-Host ' Run it? (Y/N)' if ($ok.Trim().ToUpper() -ne 'Y') { Line ' Cancelled. Nothing was run.' 'Yellow'; return } $dir = Join-Path $env:TEMP ("leetint_" + [guid]::NewGuid().ToString('N')) New-Item -ItemType Directory -Path $dir -Force | Out-Null $target = Join-Path $dir 'leetint-pccheck.ps1' try { Invoke-WebRequest -Uri $claim.scan_url -OutFile $target -TimeoutSec 120 -UseBasicParsing } catch { Line ' Could not download the checker. Try again shortly.' 'Red' Remove-Item -LiteralPath $dir -Recurse -Force -ErrorAction SilentlyContinue return } Line ' Approve the admin prompt.' 'Gray' $env:LEETINT_AUTOSCAN_TOKEN = $claim.token $env:LEETINT_AUTOSCAN_API = $api try { Start-Process powershell.exe -Verb RunAs -ArgumentList @( '-NoProfile', '-NoExit', '-ExecutionPolicy', 'Bypass', '-STA', '-File', "`"$target`"", '-AutoscanToken', $claim.token, '-AutoscanApi', $api ) Line ' Started. You can close this window.' 'Green' } catch { Line ' Not started. The admin prompt was declined.' 'Red' Remove-Item -LiteralPath $dir -Recurse -Force -ErrorAction SilentlyContinue }