Invoke-AtomicRedTeam is a PowerShell module to execute tests as defined in the [atomics folder](https://github.com/redcanaryco/atomic-red-team/tree/master/atomics) of Red Canary's Atomic Red Team project.
MIT License
805
stars
190
forks
source link
Update Install-AtomicsFolder to support powershell 7.2+ #130
Powershell 7.2 and newer has deprecated WebClient (along with WebRequest, HttpWebRequest, and ServicePoint). This PR replaces the ExtendedWebClient object with HttpClient and uses the .Timeout option to specify the same 3 minute timeout as previously defined in the custom ExtendedWebClient class.
Errors as shown on various Linux distributions using pwsh 7.2 or 7.3
VERBOSE: Installing Atomics Folder
Add-Type:
Line |
166 | Add-Type -TypeDefinition $Source -Language CSharp
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| (14,5): error SYSLIB0014: 'WebClient.WebClient()' is obsolete: 'WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead.'
public ExtendedWebClient() {
^
Installation of AtomicRedTeam Failed.
Cannot add type. Compilation errors occurred.
I have tested this against pwsh 7.3 on Ubuntu 22.04 and have had no issues completing the installation of the atomics folder now.
Powershell 7.2 and newer has deprecated WebClient (along with WebRequest, HttpWebRequest, and ServicePoint). This PR replaces the ExtendedWebClient object with HttpClient and uses the .Timeout option to specify the same 3 minute timeout as previously defined in the custom ExtendedWebClient class.
Errors as shown on various Linux distributions using pwsh 7.2 or 7.3
I have tested this against pwsh 7.3 on Ubuntu 22.04 and have had no issues completing the installation of the atomics folder now.