Powersploit Cheat Sheet: Getting Started
Powersploit Cheat Sheet: Getting Started
Version 1.1 - Created by Will Schroeder (@harmj0y) and released under the Creative Commons v3 "Attribution" License.
Invoke-TokenManipulation manipulates tokens and is Switch, use a userland -ScheduledTask Recon
roughly equivalent to Incognito. scheduled task Invoke-Portscan is a simple threaded port scanner that
Switch. Enumerate unique -Enumerate Run the schtask after one -OnIdle mimics nmap’s options.
usable tokens minute of idling Hosts to scan, in hostname, -Hosts host1,host2,…
Displays current credentials for -WhoAmI Run the schtask hourly -Daily IP, or CIDR format -Hosts 192.168.1.0/24
the powershell.exe process Run the schtask hourly -Hourly File with host specifications -HostFile .\hosts.txt
Switch. Revert to original token -RevToSelf Run the schtask at the -At HH:MM Comma-separated list of -ExcludeHosts host3,
context specified time hosts to exclude host4
Switch. Show ALL tokens -ShowAll New-ElevatedPersistenceOption builds an elevated Ports to scan -Ports 21,80-100
Create an alternate process with -CreateProcess option set usable by Add-Persistence Scan the X most common -TopPorts <50-1000>
a given token- use with "cmd.exe" Switch, persist via the -Registry ports
Username/ ProcessId/ThreadId CurrentVersion\Run key Exclude ports from scan -ExcludedPorts X,Y
Specify the token to -Username <X> Switch, use a SYSTEM -ScheduledTask
impersonate by username Treat all hosts as online -SkipDiscovery
scheduled task
Specify the token to -ProcessId <Y> Ping scan only (disable port -PingOnly
Switch, use a permanent -PermanentWMI scan)
impersonate by process ID WMI subscription
Specify the token to -ThreadId <Z> Number of threads to use, -Threads <X>
Run the schtask after one -OnIdle defaults to 100
impersonate by thread ID minute of idling
Switch, use if created process -NoUI Timeout (in milliseconds) -Timeout <Y>
Run the schtask hourly -Hourly for each port check
doesn’t need a UI
Run the schtask/registry -AtLogon Number of hosts to -nHosts <Z>
Out-Minidump generates a full-memory minidump of a payload on any user logon
process, similar to procdump.exe with the ‘-ma’ switch. concurrently scan
Run the schtask/WMI sub -Daily Performance options, -T [1-5]
Example: dump memory of all processes to C:\Temp: daily
Get-Process | Out-Minidump -DumpFilePath C:\Temp higher is more aggressive
Run the schtask/WMI sub -At HH:MM Greppable output -GrepOut <file>
The process object to -Process (Get-Process -Id at the specified time
dump memory for, 4293) XML output -XMLOut <file>
passable on the pipeline Run the WMI sub within 5 -AtStartup
min of system boot Readable output -ReadableOut <file>
Path to save the memory -DumpFilePath .\file.dmp All output formats -AllformatsOut <file>
dump to, defaults to Run the schtask at the -At HH:MM
.\processname_id.dmp specified time Suppress console output, -quiet
Add-Persistence adds persistence capabilities to a script. useful for large scans
Persistence
Payload script block -ScriptBlock {…} More Information
New-UserPersistenceOption builds a user-land option
set usable by Add-Persistence Payload file -FilePath .\file.ps1 https://github.com/PowerShellMafia/PowerSploit
Version 1.1 - Created by Will Schroeder (@harmj0y) and released under the Creative Commons v3 "Attribution" License.