summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAve2024-08-15 03:25:42 +0000
committerAve2024-08-15 03:25:42 +0000
commit1baed6cf244dc24aa23351b45b0c9aefd9928303 (patch)
tree53b4b0b66fd91630d67aac54013fe2f6a5ec284e
parent86075abe20b5b89140a3fed0fe034c9ce6e3b6c0 (diff)
downloadmassgravel.github.io-1baed6cf244dc24aa23351b45b0c9aefd9928303.zip
avoid trusting the git hosters
-rw-r--r--get14
1 files changed, 14 insertions, 0 deletions
diff --git a/get b/get
index b947e1f..91ba83a 100644
--- a/get
+++ b/get
@@ -18,6 +18,20 @@ catch {
$response = Invoke-WebRequest -Uri $RandomURL2 -UseBasicParsing
}
+# Verify script integrity
+$releaseHash = 'D666A4C7810B9D3FE9749F2D4E15C5A65D4AC0D7F0B14A144D6631CE61CC5DF3'
+$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://massgrave.dev/troubleshoot"
+ $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\MAS_$rand.cmd" } else { "$env:TEMP\MAS_$rand.cmd" }