WinRM Configuration Enumeration
This is a post-access check to answer: which listeners are actually live, what auth is allowed, whether HTTP is unsafe, and which quotas will break large commands or long-running ops. Confirm the listener is reachable and auth methods are identified first: see WinRM Endpoint Exposure Check. For credential attacks against the discovered endpoint, see WinRM Brute Force and Password Spray.
WinRM Configuration Enumeration: Listeners
Run on the target inside your WinRM session:
Listener
Address = *
Transport = HTTP
Port = 5985
Enabled = true
URLPrefix = wsman
Explain command
| enumerate | Lists all WinRM listeners and their configurations |
| winrm/config/listener | Target resource path for WinRM listener configuration |
You care about:
TransportandPort: HTTP 5985 vs HTTPS 5986, or non-standard listeners.AddressandListeningOn: whether it’s bound broadly or limited.URLPrefix: usuallywsman, useful when an environment is weirdly proxied.
If you see only an HTTPS listener, stop wasting time on 5985 and use SSL options in your tooling.
Service auth and transport hardening
Run on the target:
Explain command
| get | Retrieves the configuration value for the specified path |
| winrm/config/service | Configuration path for WinRM service settings |
Fast reads that change decisions:
AllowUnencrypted = trueon an HTTP listener means traffic can be cleartext at the WinRM layer. Treat 5985 as hostile and prefer 5986 or a tunnel.Authblock tells you what will work:Kerberos,Negotiate,NTLM,Basic,CredSSP,Certificate.
If Basic = true and AllowUnencrypted = true, that combo is operationally “easy mode” but also the kind of misconfig you document hard. If Basic = true but AllowUnencrypted = false, Basic is still possible but should be constrained to HTTPS.
Client config from the target
Run on the target:
Explain command
| get | Retrieves configuration settings from the specified WinRM path. |
| winrm/config/client | WinRM configuration path for client settings. |
What you’re looking for:
TrustedHosts: if it’s*or wide, that host can WinRM to other hosts by IP without strict name constraints. That matters for lateral movement planning from a Windows foothold.
WinRS limits that break real work
Run on the target:
Explain command
| get | Retrieves the specified WinRM configuration |
| winrm/config/winrs | Configuration path for WinRM remote shell settings |
| winrm/config | Configuration path for WinRM general settings |
Pay attention to:
MaxMemoryPerShellMB,MaxProcessesPerShell,MaxShellsPerUser: low values cause tools and larger scripts to fail unpredictably.MaxTimeoutmsand related service timeouts: long commands get cut off, output truncates, or sessions die mid-task.
If quotas are tight, switch to smaller, chunked commands and stage output to disk instead of trying to stream everything back.
PowerShell WSMan view when winrm get is noisy
If you prefer a navigable tree, use the WSMan provider:
This is often easier to eyeball and script against than the raw winrm get output.
Run the same checks remotely from Kali
If you don’t want an interactive shell, execute the target-side commands over WinRM.
If you want to run PowerShell directly:
Explain command
| winrm | Protocol module for Windows Remote Management connections |
| $TARGET_IP | Target IP address variable for the remote host |
| -u | Username in DOMAIN\USER format for authentication |
| $DOMAIN\$USER | Domain and username variables for WinRM authentication |
| -p | Password for authentication |
| $PASSWORD | Password variable for the specified user account |
| -X | Execute PowerShell command on remote target |
| Get-ChildItem WSMan:\localhost\Listener | Format-List | PowerShell command to list and format WinRM listeners |
NetExec WinRM command execution supports -x and -X.
Edge cases
Access is denied when reading config
Some environments restrict reading WSMan config to admins. If winrm get fails, fall back to endpoint probing from your attacker box to at least learn auth schemes and ports, then escalate before re-checking config.
Config says one thing, behavior says another
If you’re behind a proxy or have multiple listeners, you can end up authenticating against a different front door than the one you’re reading locally. Correlate:
listener transport and port
what the endpoint actually offers in
WWW-Authenticatewhich URL you’re hitting (
/wsmanvs custom)
References
-
Installation and configuration for WinRMDOCS: Installation and configuration for WinRM, learn.microsoft.com/en-us/windows/win32/winrm/installation-and-configuration-for-windows-remote-management (opens in new tab)
Documents winrm enumerate winrm/config/listener and listener concepts
-
Configure WinRM for HTTPSDOCS: Configure WinRM for HTTPS, learn.microsoft.com/en-us/troubleshoot/windows-client/system-management-components/configure-winrm-for-https (opens in new tab)
Confirms default ports and validating listeners
-
about_WSMan_ProviderDOCS: about_WSMan_Provider, learn.microsoft.com/en-us/powershell/module/microsoft.wsman.management/about/about_wsman_provider (opens in new tab)
WSMan drive structure for enumerating WSMan configuration
-
about_Remote_TroubleshootingDOCS: about_Remote_Troubleshooting, learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_remote_troubleshooting (opens in new tab)
Notes on WSMan quotas and timeouts that impact remoting reliability
-
NetExec WinRM Command ExecutionLINK: NetExec WinRM Command Execution, www.netexec.wiki/winrm-protocol/command-execution (opens in new tab)
-x and -X remote execution patterns