Powershell.exe

Powershell.exe is a a task-based command-line shell built on .NET.

Paths

  • C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe
  • C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe

Commands

Execute

Set the execution policy to bypass and execute a PowerShell script without warning

Use case: Execute PowerShell cmdlets, .NET code, and just about anything else your heart desires

Privileges: User

powershell.exe -ep bypass -file c:\path\to\a\script.ps1

Execute

Set the execution policy to bypass and execute a PowerShell command

Use case: Execute PowerShell cmdlets, .NET code, and just about anything else your heart desires

Privileges: User

powershell.exe -ep bypass -command "Invoke-AllTheThings..."

Execute

Set the execution policy to bypass and execute a very malicious PowerShell encoded command

Use case: Execute PowerShell cmdlets, .NET code, and just about anything else your heart desires

Privileges: User

powershell.exe -ep bypass -ec IgBXAGUAIAA8ADMAIABMAE8ATABCAEEAUwAiAA==

Detection

Resources