powershell-cheatsheet

Powershell

Powershell Downgrade Attack

  • Logging in Powershell past v2.0 is insane. To limit this logging perform a version switch to 2.0

powershell.exe -Version 2.0 -NoLogo -NoProfile
  • Verify with

Resources

  • https://learnxinyminutes.com/docs/powershell/

Basic Enumeration

Hotfixes

Creating Objects From Previous cmdlets

Zdxicjj
  • You can also use the following flags to select particular information:

  • first - gets the first x object

  • last - gets the last x object

  • unique - shows the unique objects

  • skip - skips x objects

Checking the Stopped Processes

Sort Object

Find File Recursive

  • image

  • Hash File

  • Will default to SHA-256

See all Cmdlets Installed

Users

  • See users on the sytem

  • image

  • See what user a SID belongs to

  • Pull value from users

Groups

  • See Groups

IP Address Information / TCP/UDP Connections

  • View all TCP ports Listen

Base64 Powershell Decode

Find backup Files

  • image

Find specific string inside a file

Services and Processes

Scheduled Tasks

See Owner and Access

  • image

Scanners

  • Localhost port scanner

  • PowerShell port scanner:

  • Test-Netconnection scan a range of IPs for a single port:

  • PS IP range & port range scanner:

  • PS test egress filtering:

Last updated