# WinRM (5985, 5986)

{% tabs %}
{% tab title="Windows Remote Management (WinRM)" %} <mark style="color:green;">`Windows Remote Management (WinRM)`</mark> is a command-line-based remote management protocol integrated into Windows, using SOAP for remote connections. Enabled explicitly from Windows 10 onwards, WinRM communicates via <mark style="color:green;">`TCP ports 5985 (HTTP)`</mark> and <mark style="color:green;">`5986 (HTTPS)`</mark>, replacing ports 80 and 443 for security. WinRM works with Windows Remote Shell (<mark style="color:green;">`WinRS`</mark>), allowing execution of commands on remote systems, and is available by default on Windows 7 and later.
{% endtab %}

{% tab title="Resources" %}

* [GitHub evil-winrm](https://github.com/Hackplayers/evil-winrm)
  {% endtab %}
  {% endtabs %}

## Footprinting

{% tabs %}
{% tab title="Commands" %}

* **Basic nmap Scanning**

```bash
> nmap -sV -sC TARGET_IP -p5985,5986 --disable-arp-ping -n
```

* **Install evil-winrm**

```bash
> sudo gem install evil-winrm
```

* **Login to WinRM server using evil-winrm**

```bash
> evil-winrm -i TARGET_IP -u <username> -p <password>
> evil-winrm -i TARGET_IP -u <username> -H "<passwordHash>"
```

{% endtab %}
{% endtabs %}


---

# 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://edi9root.gitbook.io/notes/docs/protocol-service/window-remote-management/winrm-5985-5986.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.
