Skip to main content

Overview

PowerShell is the most powerful built-in tool available to Windows penetration testers. It provides rich .NET integration, remote execution capabilities, and access to every Windows API. This page covers the most useful PowerShell techniques for offensive security work.
This content is for authorized penetration testing and red team operations only.

PowerShell Locations

Basic Commands Reference

Download and Execute Payloads

Base64 Encoded Commands

Download Methods

AMSI Bypass Techniques

AMSI inspects scripts before execution. Bypassing it is necessary for running offensive PowerShell tools.
AMSI bypass generators:

Disable Windows Defender

Enable WinRM for Remote PowerShell

System Enumeration

PowerShell History

Credential Handling

Network Enumeration

File and Permission Operations

Recycle Bin

SUDO Equivalent (Run as Another User)

SDDL to Readable Format

PS Logging Bypass

References