Windows Remote Protocols

Overview

Windows systems utilize various remote management protocols for system administration, monitoring, and control. These protocols enable IT administrators to manage Windows machines remotely and provide various levels of access and functionality.

RDP (Remote Desktop Protocol)

Overview

RDP (Remote Desktop Protocol) is a proprietary protocol developed by Microsoft that allows for remote connections to Windows systems. It provides full desktop access with graphical user interface over network connections.

Key Characteristics:

  • Port 3389: Default RDP port

  • Authentication: Network Level Authentication (NLA), password-based

  • Encryption: TLS encryption for secure connections

  • Functionality: Full desktop remote access

  • Clients: Windows Remote Desktop, mstsc, rdesktop, xfreerdp

RDP Features

  • Desktop Sharing: Full graphical desktop access

  • Multi-Session: Multiple simultaneous connections

  • RemoteApp: Application-specific remote access

  • Clipboard Integration: Copy/paste between local and remote systems

  • Drive Redirection: Access to local drives from remote session

RDP Configuration

RDP Enumeration

RDP Security Issues

  1. Weak Authentication: Default or weak passwords

  2. Version Vulnerabilities: Outdated RDP versions

  3. Encryption Issues: Weak encryption protocols

  4. Brute Force: Password guessing attacks

  5. Network Exposure: RDP accessible from internet

WinRM (Windows Remote Management)

Overview

WinRM (Windows Remote Management) is Microsoft's implementation of the WS-Management Protocol, providing remote management capabilities for Windows systems. It enables remote execution of commands and scripts.

Key Characteristics:

  • Port 5985: HTTP (unencrypted)

  • Port 5986: HTTPS (encrypted)

  • Authentication: Kerberos, NTLM, Basic, Certificate

  • Protocol: SOAP over HTTP/HTTPS

  • Functionality: Remote command execution, PowerShell remoting

WinRM Features

  • PowerShell Remoting: Remote PowerShell sessions

  • Command Execution: Execute commands on remote systems

  • Event Forwarding: Forward Windows events

  • Configuration Management: Remote system configuration

  • Scalability: Manage multiple systems simultaneously

WinRM Configuration

WinRM Enumeration

WinRM Security Issues

  1. Weak Authentication: Basic authentication over HTTP

  2. Configuration: Overly permissive settings

  3. Encryption: Unencrypted HTTP transport

  4. Access Control: Insufficient access restrictions

  5. Credential Exposure: Credentials in scripts and configurations

WMI (Windows Management Instrumentation)

Overview

WMI (Windows Management Instrumentation) is Microsoft's implementation of Web-Based Enterprise Management (WBEM) and Common Information Model (CIM). It provides a standardized way to access management information in an enterprise environment.

Key Characteristics:

  • Port 135: RPC endpoint mapper

  • Dynamic Ports: Random high ports for actual communication

  • Authentication: Windows authentication (NTLM, Kerberos)

  • Functionality: System information, configuration, monitoring

  • Access: Local and remote management

WMI Components

  • WMI Service: Core service providing WMI functionality

  • WMI Repository: Database storing WMI class definitions

  • WMI Providers: Components that provide management data

  • WMI Classes: Object-oriented representation of manageable resources

  • WQL: WMI Query Language for data retrieval

WMI Configuration

WMI Enumeration

WMI Security Issues

  1. Authentication: Windows authentication bypass

  2. Access Control: Insufficient WMI permissions

  3. Information Disclosure: Sensitive system information

  4. Privilege Escalation: WMI-based escalation techniques

  5. Persistence: WMI event subscriptions for persistence

Advanced Enumeration Techniques

RDP Advanced Enumeration

WinRM Advanced Enumeration

WMI Advanced Enumeration

Practical Examples

HTB Academy Style RDP Enumeration

HTB Academy Style WinRM Enumeration

HTB Academy Lab Questions Examples

Security Assessment

RDP Security Assessment

WinRM Security Assessment

WMI Security Assessment

Enumeration Checklist

RDP Enumeration

WinRM Enumeration

WMI Enumeration

Attack Vectors

RDP Attack Vectors

WinRM Attack Vectors

WMI Attack Vectors

Common Vulnerabilities

RDP Vulnerabilities

  • CVE-2019-0708: BlueKeep RCE vulnerability

  • CVE-2019-1181: DejaBlue RCE vulnerability

  • CVE-2019-1182: DejaBlue RCE vulnerability

  • CVE-2012-0002: RDP denial of service

  • CVE-2018-0886: CredSSP authentication bypass

WinRM Vulnerabilities

  • Configuration Issues: Weak authentication settings

  • Network Exposure: WinRM accessible from untrusted networks

  • Authentication Bypass: Weak authentication mechanisms

  • Privilege Escalation: WinRM-based escalation techniques

WMI Vulnerabilities

  • WMI Event Subscriptions: Persistence mechanisms

  • WMI Query Injection: Malicious WQL queries

  • Access Control: Insufficient WMI permissions

  • Information Disclosure: Sensitive system information

Tools and Techniques

RDP Tools

WinRM Tools

WMI Tools

Defensive Measures

RDP Hardening

WinRM Security

WMI Security

Best Practices

RDP Best Practices

  1. Change default port: Use non-standard ports

  2. Enable NLA: Require Network Level Authentication

  3. Use strong passwords: Implement password policies

  4. Limit access: Restrict RDP access to authorized users

  5. Monitor connections: Log and monitor RDP sessions

  6. Keep updated: Apply security patches regularly

WinRM Best Practices

  1. Use HTTPS: Enable SSL/TLS encryption

  2. Restrict authentication: Disable basic authentication

  3. Limit access: Configure trusted hosts carefully

  4. Monitor activity: Log WinRM connections and commands

  5. Network security: Use firewall rules and VPNs

  6. Regular audits: Review WinRM configuration regularly

WMI Best Practices

  1. Access control: Set appropriate WMI permissions

  2. Monitor activity: Log WMI queries and changes

  3. Disable if unused: Turn off WMI if not needed

  4. Regular audits: Review WMI configuration and usage

  5. Network security: Restrict WMI network access

  6. Update regularly: Keep WMI components updated

Detection and Monitoring

RDP Monitoring

WinRM Monitoring

WMI Monitoring

Last updated