Benign powershell Download

install.ps1

Checks an Authenticode signatureCode embeds unconditional PowerShell loop

Evidence

PowerShell script sets stop-on-error behavior lines 1–14
1#!/usr/bin/env pwsh
2#Requires -Version 5.1
3
4# Stop on errors
5$ErrorActionPreference = "Stop"
6
7# Colors for output
8$RED = "Red"
9$GREEN = "Green"
⋯5 lines
Mutates params dictionary or map entries lines 14–38
14:21… ream"
15$UPSTREAM_DIR = Join-Path $HOME ".upstream"
16
17function Write-ColorOutput {
18 param(
19 [string]$Message,
20 [string]$Color = "",
21 [switch]$NoNewline
22 )
23
24 $params = @{}
25 if ($Color) {
26 $params["ForegroundColor"] = $Color
27 }
28 if ($NoNewline) {
29 $params["NoNewline"] = $true
30 }
31
⋯7 lines
Get-CimInstance cmdlet reference lines 58–65
58:11… RM64" { return "aarch64" }
59 }
60
61 try {
62 $wmiArch = (Get-CimInstance -ClassName Win32_Processor | Select-Object -First 1).Architecture
63 switch ($wmiArch) {
64 9 { return "x86_64" } # x64
65 12 { r …
Get-WmiObject or Gwmi cmdlet reference lines 65–71
65:43… 4
66 }
67 } catch {
68 try {
69 $wmiArch = (Get-WmiObject -Class Win32_Processor | Select-Object -First 1).Architecture
70 switch ($wmiArch) {
71 9 { return "x86_ …
URL references EXE/SCR/MSI/BAT file lines 128–136
128:45… imeArchitecture -Architecture $Architecture
129 $downloadUrl = "https://aka.ms/vc14/vc_redist.$runtimeArchitecture.exe"
130 $tempDirectory = $null
131
132 Write-ColorOutput "Microsoft Visual C++ Redistributable ($runtimeArchitecture) is missing. Downloading it from Microsoft..." $YELLOW
133 Write-Host "Windows will ask for administrator approval to install this prerequisite. Upstream itself will stay in your user account."
134
135 try {
136 $tempDirector …

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.