Summery

PS Session access allows you to enter an interactive session with the target computer. It generally uses WinRM to work so it’s ports have to be enabled.

Usage

  1. First create a PSCredential object.
    $SecPassword = ConvertTo-SecureString 'Jenni_Luvs_Magic23' -AsPlainText -Force - Convert the plaintext password into a PowerShell SecureString.
    $Cred = New-Object System.Management.Automation.PSCredential('frizz.htb\f.frizzle', $SecPassword) - Create a credential object containing the username and password.

  2. Then use the New-PSSession command with the credential we just created.
    $session = New-PSSession -ComputerName FRIZZDC.FRIZZ.HTB -Credential $Cred - Create a remote PowerShell session to the target using those credentials.

  3. You can then run a command on the system using the Invoke-Command cmdlet and the session you just created.
    Invoke-Command -Session $session -ScriptBlock {Start-Process cmd}

Or enter the remote session interactively.
Enter-PSSession $session