#Requires -RunAsAdministrator $ErrorActionPreference = "Stop" <# * Copyright(c) 2006-2018 ThreatSTOP, Inc. All Rights Reserved * NOTICE: All information contained herein is, and remains the property of ThreatSTOP, Inc. and its suppliers, if any. The intellectual and * technical concepts contained herein are proprietary to ThreatSTOP, Inc. and its suppliers and certain aspects thereof are protected by United * States Patent No. 8,533,822 and United States Patent No. 8,869,237, and are protected by trade secret or copyright law. * US Government Entities: The ThreatSTOP service, software and documentation, as applicable, are "commercial computer software" and * "commercial computer software documentation" developed exclusively at private expense by Threatstop, Inc. ("Threatstop"). Pursuant to FAR * 12.212 or DFARS 227 7202 and their successors, as applicable, use, reproduction and disclosure of the software and documentation is * governed by the terms of Threatstop's commercial agreement. #> # Run this script to download, extract, and install/update ThreatSTOP. You will be prompted for the public ip address of your DNS server. $version = '1.0.3' # Oct 2018 $package = 'ftp://ftp.threatstop.com/win2016/ThreatSTOP_W16.1.0.3.zip' $FilePath = "$env:systemdrive\ThreatStop\ThreatSTOP.ini";$upgrade=$false; if (Test-Path $FilePath){ Write-Host("ThreatSTOP already installed. Run $env:systemdrive\ThreatSTOP\Setup.ps1 if you need to apply a new configuration."); $upgrade = (Read-Host -Prompt 'Update your existing installation? Y/N ') -eq 'y'; if ($upgrade){ Write-Host -ForegroundColor Green "Backing up configuration...";Move-Item $FilePath "$env:TEMP\ThreatSTOP.ini" -Force }else{Write-Host('Exiting.');break;} } wget $package -OutFile ThreatSTOP.zip Write-Host ("Extracting files..."); Expand-Archive ThreatSTOP.zip -dest "$env:systemdrive\" -Force if ($upgrade){ Write-Host -ForegroundColor Green 'Restoring configuration...';Move-Item "$env:TEMP\ThreatSTOP.ini" $FilePath -Force } else{ $IP = Read-Host -Prompt 'Enter your Public IP Address' (Get-Content ($FilePath)) | Foreach-Object {$_ -replace 'MyPublicIP.*', ("MyPublicIP=" + $IP)} | Set-Content ($Filepath) $TDID = Read-Host -Prompt 'Enter your TDID' (Get-Content ($FilePath)) | Foreach-Object {$_ -replace 'TDID.*', ("TDID=" + $TDID)} | Set-Content ($Filepath) } #run setup &$env:systemdrive\ThreatStop\Setup.ps1 Write-Host ("ThreatSTOP $version")