# Winrm

> *Source CTF and HTB Academy*

* Usually on port 5985, 5986

The Windows Remote Management (WinRM) is a simple Windows integrated remote management protocol based on the command line. WinRM uses the Simple Object Access Protocol (SOAP) to establish connections to remote hosts and their applications. Therefore, WinRM must be explicitly enabled and configured starting with Windows 10.

## Enumeration

### Nmap

* `nmap -sV -sC 10.129.201.248 -p5985,5986 --disable-arp-ping -n`

### Evil-winrm

* `sudo gem install evil-winrm` install
* `evil-winrm -i <target-IP> -u <username> -p <password>` Usage
* `evil-winrm -i 10.129.201.248 -u user -p password` Example

### Crackmapexec

* `crackmapexec winrm 10.129.42.197 -u user.list -p password.list`

## Resources

* [CrackMapExec](https://mpgn.gitbook.io/crackmapexec/)
* [Winrm Pentest - Raj Chandel](https://www.hackingarticles.in/winrm-penetration-testing/)
* [Abusing Windows Remote Management (WinRM) with Metasploit - Rapid7](https://www.rapid7.com/blog/post/2012/11/08/abusing-windows-remote-management-winrm-with-metasploit/)
* [Winrm - Lisandre](https://lisandre.com/archives/12597)
* [5985,5986 - Pentesting WinRM - Hacktricks](https://book.hacktricks.xyz/network-services-pentesting/5985-5986-pentesting-winrm)


---

# 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://csbygb.gitbook.io/pentips/networking-protocols-and-network-pentest/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.
