# TCP 5985: WinRM

> WinRM is Microsoft's implementation of WS-Management in Windows which allows systems to access or exchange management information across a common network.
>
> \-- [*Wikipedia*](https://en.wikipedia.org/wiki/Windows_Remote_Management)

## PSSession

```powershell
Enter-PSSession -ComputerName <hostname> -Credential <username>
```

## Evil-WinRM

> The ultimate WinRM shell for hacking/pentesting\
> [GitHub - Hackplayers/evil-winrm](https://github.com/Hackplayers/evil-winrm)

Password

```bash
evil-winrm -i <ip> -u <user> -p <pw> -s <script-path> -e <binary-path>
```

PtH

```bash
evil-winrm -i <ip> -u <user> -H <nt-hash> -s <script-path> -e <binary-path>
```

### Using mimikatz

As mimikatz is not working fully interactively in this environment, we can just issue single commands.

```powershell
./mimikatz.exe "<command>" "exit"
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://d4rk1337.gitbook.io/the-pentesters-cheat-sheet/services/tcp/tcp-5985-winrm.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
