Suspicious 85% powershell Download

install.ps1

Invokes PowerShell HTTP request cmdletPowerShell calls .NET File.OpenRead
SHA-256d52e33ff90613ef3d467427a345346f296427be49bdd4f7d33b3344963047553

Evidence

HTTP URL string literal lines 2–48
2:4… uto-injected by server
3$env:INSTALL_NONCE = ''
4$env:API_BASE = 'https://usegitai.com'
5$env:API_KEY = ''
6
7$ErrorActionPreference = 'Stop'
8Set-StrictMode -Version Latest
9
10function Start-DaemonIfRequested {
11 if ($env:GIT_AI_RESTART_DAEMON_AFTER_INSTALL -ne '1') {
12 return
13 }
14
15 $daemonExe = Join-Path $HOME '.git-ai\bin\git-ai.exe'
16 if (-not (Test-Path $daemonExe)) {
17 Write-Warning 'Warning: Failed to locate git-ai.exe for daemon restart after install.'
18 return
19 }
⋯10 lines
30 [Parameter(Mandatory = $true)][string]$Message
31 )
32 Write-Host "Error: $Message" -ForegroundColor Red
33 Start-DaemonIfRequested
34 exit 1
⋯4 lines
39 [Parameter(Mandatory = $true)][string]$Message
40 )
41 Write-Host $Message -ForegroundColor Green
42}
43
⋯5 lines
Opens a file stream via .NET File::Open lines 65–77
65:24… atory = $true)][string]$Path
66 )
67
68 try {
69 $stream = [System.IO.File]::Open($Path, 'Open', 'Write', 'None')
70 $stream.Close()
71 return $true
⋯6 lines
PowerShell dynamically invokes a variable lines 87–100
87:28… wn')
88 if ($Hard) {
89 $args += '--hard'
90 }
91
⋯9 lines
PowerShell joins path to executable filename lines 102–113
102:55… Dir
103 )
104
105 $targetPaths = @(
106 (Normalize-PathString (Join-Path $InstallDir 'git-ai.exe')),
107 (Normalize-PathString (Join-Path $InstallDir 'git.exe'))
108 )
109
110 $processes = @(Get-CimInstance Win32_Process -ErrorAction SilentlyContinue | Where-Object {
111 $_.ProcessId -ne $PID -and
112 $_.ExecutablePath -and
113 ($targetPaths -contains (Normalize-PathString $_ …
PowerShell Stop-Process command reference lines 130–143
130:41… it-ai processes: {0}" -f ($pids -join ', '))
131
132 foreach ($managedPid in $pids) {
133 try {
134 Stop-Process -Id $managedPid -Force -ErrorAction Stop
135 } catch { }
136 }
⋯7 lines

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.