WinRM PSRemoting

8 May 2022, 11:28 a.m.
00:29 minutes

PowerShell Remoting is the recommended way to manage Windows systems. PowerShell Remoting uses Windows Remote Management (WinRM), the Microsoft implementation of the Web Services for Management (WS-Management) protocol, to allow users to run PowerShell commands on remote computers. By default, PowerShell Remoting only allows connections from members of the Administrators group. This article explores using WinRm PSRemoting.

    WinRM PSRemoting

    The system needs to have WinRM enabled before you can use it:

    Test if the service is listening:

    Test-WSMan -ComputerName TargetPC
    

    Enable via PSexec

    psexec \\target -u PoorSysAdmin -p Passw0rd -h -d powershell.exe "enable-psremoting -force"
    

    Insert your stager here

    Invoke-Command -ComputerName TargetPC -ScriptBlock { BlahBlah } -credential jdoe
    

    Get an interactive PSRemote Shell.

    $cred = Get-Credential
    Enter-PSSession -ComputerName TargetPC -Credential $cred
    

    Captcha: What's the standard TCP port of the following service?

    captcha

    0 comments