Benign powershell Download

install.ps1

Invokes PowerShell HTTP request cmdletInvokes PowerShell REST request cmdlet
SHA-25667a8361fac8373623f529df7ffb98ce57853d2ae7fe5e4e5598dd777571eb583

Evidence

PowerShell script sets stop-on-error behavior lines 1–14
1[CmdletBinding()]
2param(
3 [string]$Release = $env:CODEX_RELEASE
4)
5
6Set-StrictMode -Version Latest
7$ErrorActionPreference = "Stop"
8$ProgressPreference = "SilentlyContinue"
9
10if ([string]::IsNullOrWhiteSpace($Release)) {
11 $Release = "latest"
12}
13
14$NonInteractive = $env:CODEX_NON_ …
HTTP URL string literal lines 19–33
19:37… S_OPENAI_COM -match "^(?i:1|true|yes)$"
20}
21$ReleasesBaseUri = "https://releases.openai.com/codex"
22$ReleasesMetadataTimeoutSec = 30
23$ReleasesAssetTimeoutSec = 300
24
25function Write-Step {
26 param(
27 [string]$Message
28 )
29
⋯4 lines
Interactive yes/no confirmation prompt text lines 50–61
50:58… putRedirected) {
51 return $false
52 }
53
54 $choice = Read-Host "$Prompt [y/N]"
55 return $choice -match "^(?i:y(?:es)?)$"
56}
⋯5 lines
Defines Assert helper raising on failure lines 65–88
65:6…
66
67 if ($RawVersion.StartsWith("rust-v")) {
68 return $RawVersion.Substring(6)
69 }
70
⋯5 lines
76}
77
78function Assert-ValidReleaseVersion {
79 param(
80 [string]$Version
81 )
82
83 if ($Version -cne "latest" -and $Version -cnotmatch "^[0-9]+\.[0-9]+\.[0-9]+(?:-alpha(?:\.[0-9]+){0,2}|-beta(?:\.[0-9]+)?)?$") {
84 throw "Invalid Codex release version: $Version. Expected latest or x.y.z[-alpha[.N[.M]]|-beta[.N]]."
85 }
86}
87
88function Find-Relea …
Invokes PowerShell HTTP request cmdlet lines 124–127
124:57… , [System.StringComparison]::OrdinalIgnoreCase)) {
125 Invoke-WebRequest -UseBasicParsing -Uri $Metadata.Url -OutFile $OutFile -TimeoutSec $ReleasesAssetTimeoutSec
126 } else {
127 Invoke-WebRequest -UseBasicParsing -Uri $Metadata. …

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.