Execute an atomic test remotely - Adam-Mashinchi/invoke-atomicredteam GitHub Wiki
Executing tests on remote machines.
You can test on a remote machine as long as the following prerequisites are met:
Local machine | Remote machine | Prerequisites |
---|---|---|
Windows | Windows | 1. Local machine must have Invoke-Atomic installed. 2. Remote machine must have PowerShell remoting enabled. |
Windows | Linux, macOS | 1. Local machine must have Invoke-Atomic installed. 2. Local machine must have PowerShell Core installed. 3. Remote machine must be configured for PowerShell remoting over SSH. |
Linux, macOS | Windows | 1. Local machine must have Invoke-Atomic installed. 2. Local machine must have PowerShell Core installed. 3. Remote machine must be configured for PowerShell remoting over SSH. |
If your local and remote machines are Windows, you need to enable PowerShell remoting on the remote machine. See Enable-PSRemoting.
If your client uses a public network profile, see the -SkipNetworkProfileCheck
flag.
By default, only users in the Administrators group on the remote machine can make a PowerShell remoting connection.
If your local or remote machine isn't Windows, you need to install PowerShell Core on the local machine. For installation instructions, see Installing various versions of PowerShell.
If your local or remote machine isn't Windows, you need to configure the remote machine for PowerShell remoting over SSH. See PowerShell remoting over SSH.
Before executing an atomic test on a remote machine, you must establish a
PowerShell session ($sess
).
To establish a session between two Windows machines, run the following from your local machine:
$sess = New-PSSession -ComputerName <local computer> -Credential <domain>\<username>
When prompted, enter the password of the user specified by <username>
.
To establish a session between a Windows and non-Windows machine, run the following from your local machine:
$sess = New-PSSession -HostName <local computer> -Username <username>
When prompted, enter the password of the user specified by <username>
.
You can use the -KeyFilePath
flag to specify a private key file.
Once you've established a PowerShell session, you can execute tests as on a local machine. See Execute an atomic test locally.