This guide walks you through setting up PowerShell Remoting between two Windows machines (attacker and target) in a non-domain (workgroup) environment. It covers user creation, enabling remoting, setting TrustedHosts, and allowing unencrypted traffic — ideal for labs.

net user attackerUser Str0ngP@ssword! /add
net localgroup "Remote Management Users" attackerUser /add
Enable-PSRemoting -Force
Set-Item WSMan:\localhost\Service\AllowUnencrypted -Value $true
Set-Item WSMan:\localhost\Service\Auth\Basic -Value $true
Enable-NetFirewallRule -Name "WINRM-HTTP-In-TCP"
winrm enumerate winrm/config/listener

If no listener is configured:

winrm quickconfig
Enable-PSRemoting -Force
Set-Item WSMan:\localhost\Client\TrustedHosts -Value "*" -Force
Set-Item WSMan:\localhost\Client\AllowUnencrypted -Value $true
Get-Item WSMan:\localhost\Client\TrustedHosts
$cred = Get-Credential

Enter attackerUser and Str0ngP@ssword!

Enter-PSSession -ComputerName 10.4.31.39 -Credential $cred
Enter-PSSession -ComputerName 10.4.31.39 -Credential $cred -Authentication Negotiate
Invoke-Command -ComputerName 10.4.31.39 -Credential $cred -ScriptBlock { whoami }

If you’re getting blocked, it’s likely due to one or more of the following:

  • You’re using Basic or NTLM authentication over HTTP.
  • Kerberos can’t be used since the machines aren’t domain-joined.
  • PowerShell remoting requires TrustedHosts to be set or HTTPS to be used.
  • You’re trying to use encrypted traffic without HTTPS configured.
Scroll to Top