Common attacks and weaknesses
- Remote command execution with valid credentials.
- Lateral movement.
Windows Remote Management over HTTPS.
The client opens a session to port 5986: each command typed is sent to the server, which runs it and returns the output. Everything is encrypted: someone on the path only sees unreadable bytes.
| Service | Port | Transport | Description | Reference | Updated |
|---|---|---|---|---|---|
| wsmans | 5986 | TCP, UDP | WBEM WS-Management HTTP over TLS/SSL | - | 2006-11 |
// source: IANA service name and port number registry
Linux
sudo ss -ltnup 'sport = :5986' # process listening on 5986
sudo lsof -nP -i :5986macOS
sudo lsof -nP -i :5986
Windows (PowerShell)
Get-NetTCPConnection -LocalPort 5986 -State Listen | Select LocalAddress, OwningProcess Get-NetUDPEndpoint -LocalPort 5986 netstat -ano | findstr :5986
From another machine
nmap -p 5986 -sV <host> sudo nmap -sU -p 5986 <host> nc -zv <host> 5986
Block it in the firewall
sudo ufw deny 5986/tcp # Linux (ufw) New-NetFirewallRule -DisplayName "Block 5986" -Direction Inbound -LocalPort 5986 -Protocol TCP -Action Block # Windows
Windows Remote Management over HTTPS.
Port 5986 is registered for TCP and UDP. In practice the service mostly uses TCP.
It is rated 6/10 (high) when exposed to the Internet. Remote command execution with valid credentials. Restrict to admin networks.
On Linux run "ss -ltnup 'sport = :5986'", on macOS "lsof -nP -i :5986", and on Windows "netstat -ano | findstr :5986" to see the local process. From another machine, "nmap -p 5986 <host>" shows whether it is reachable.