Skip to content

LearnNetwork

SSH, RDP and WinRM configuration checks

Brief

Remote admin services are left with password logins, root logins, old algorithms or unencrypted transports long after the client that needed them is gone. The check asks each server what it offers without logging in, then reads the configuration behind each answer.

Exam prep eJPT, OSCP

Track
Network
Stage
Access
Reviewed
On this page
  1. Check first
  2. Which servers answer, and with what version?
  3. Which algorithms does each server accept?
  4. Does the server take passwords?
  5. What does the configuration say, and why?
  6. Does RDP require Network Level Authentication?
  7. Does WinRM accept Basic logins over HTTP?
  8. The defender sees
  9. Done when
  10. Not covered
  11. Tools
  12. Reviewed

All commands

Situation
The hosts and ports from recon that answer on 22, 3389, 5985 or 5986, inside the scope letter, and the remote access configuration the client exports for the review. No step logs in, tries a password or sends a credential.
Goal
One line per remote admin service: host, version, algorithms outside the defaults, login methods offered, and the configuration line behind each finding.
Outputs
Captured on 6 Nov 2026 in the Atarus Bench review lab, edition review-lab-0.2: nmap 7.95 on Debian 13 against two OpenSSH 10.0 servers on a lab network with no route out, one with a drop-in file a team left for an old client and one hardened. Every account on both is locked, and no step logs in. The RDP and WinRM steps show their commands only: their output waits on the lab's Windows machine.

Check first

  • The list of hosts answering on 22 (SSH), 3389 (RDP), 5985 (WinRM over HTTP) and 5986 (WinRM over HTTPS), from recon, inside the scope letter.
  • Which hosts are meant to take remote admin from where: a jump host only, the admin network, or a VPN.
  • The client's export of each server's configuration, or a contact who can run sshd -T, winrm get winrm/config/service and winrm get winrm/config/service/auth for us.
  • The client's agreement that no step logs in or tries a password; guessing belongs to its own approved test.
  • A word to the client's team before the run: asking as root which methods the server offers leaves an authenticating user root line in each server's log, which fail2ban or sshguard may count as an attempt.

Steps

Which servers answer, and with what version?

nmap -Pn -sV -p 22 admin01.corp.example.com admin02.corp.example.com | grep -E '^Nmap scan|^22/tcp'

Expected output

Nmap scan report for admin01.corp.example.com (192.0.2.50)
22/tcp open  ssh     OpenSSH 10.0p2 Debian 7+deb13u4 (protocol 2.0)   # <- the distribution's package and patch level
Nmap scan report for admin02.corp.example.com (192.0.2.51)
22/tcp open  ssh     OpenSSH 10.0p2 Debian 7+deb13u4 (protocol 2.0)

Both servers run the same OpenSSH package, and the banner names the distribution's own patch level (deb13u4), so the version is checked against Debian's security tracker, not against upstream OpenSSH releases. A distribution backports fixes without changing the upstream number. The same version on both means the differences below come from configuration, not from the software.

Negative result. Every banner is a supported release with the distribution's current patches.

Fix. Keep the package on the distribution's security updates, and keep the banner: hiding the version slows nobody down and makes this check harder for the team itself.

Which algorithms does each server accept?

for h in admin01 admin02; do
  nmap -Pn -p 22 --script ssh2-enum-algos $h.corp.example.com | grep '^|' > /tmp/$h.algos
done
diff /tmp/admin01.algos /tmp/admin02.algos

Expected output

2c2   # <- < is admin01, > is admin02
< |   kex_algorithms: (11)
---
> |   kex_algorithms: (10)
11d10   # <- a line on admin01 only
< |       diffie-hellman-group14-sha1   # <- SHA-1 key exchange, added back on admin01 only

ssh2-enum-algos lists what the server offers in each class: key exchange, host keys, ciphers, MACs and compression. Comparing a host with a hardened one leaves only the differences: admin01 accepts one more key exchange, diffie-hellman-group14-sha1, which OpenSSH no longer enables by default. Everything else is the same, including hmac-sha1, which sits in OpenSSH's default MAC list on both hosts. On its own this is a low finding; it matters because something was added on purpose, and the reason is usually a client nobody has replaced.

Negative result. The list matches the release's defaults: no -sha1 key exchange, no -cbc cipher, no ssh-dss host key.

Fix. Remove the KexAlgorithms +... line and replace or upgrade the client that needed it. sshd does not accept KexAlgorithms inside a Match block, so where the client cannot change yet, run a second sshd on its own port, firewalled to that client's address, with the old algorithm and a key-only account.

Does the server take passwords?

nmap -Pn -p 22 --script ssh-auth-methods --script-args ssh.user=root \
  admin01.corp.example.com admin02.corp.example.com | grep -E '^Nmap scan|^\|' | sed 's/ *$//'

Expected output

Nmap scan report for admin01.corp.example.com (192.0.2.50)
| ssh-auth-methods:
|   Supported authentication methods:
|     publickey
|_    password   # <- passwords are accepted on this server
Nmap scan report for admin02.corp.example.com (192.0.2.51)
| ssh-auth-methods:
|   Supported authentication methods:
|_    publickey

The script starts a login as root with the none method, which the server refuses with the list of methods that could continue, and stops there: no password is sent. admin01 accepts passwords; admin02 accepts keys only. sshd gives the same list whatever user name is asked, unless a Match User block changes the methods, so it does not reveal which accounts exist, and it does not show whether root itself may log in. That comes from the configuration in the next step.

Negative result. publickey only, or publickey and a second factor such as keyboard-interactive backed by the client's MFA.

Fix. Set PasswordAuthentication no and KbdInteractiveAuthentication no unless keyboard-interactive carries MFA, and give admins keys or SSH certificates.

What does the configuration say, and why?

head -n 20 ssh-export/*/*.conf

Expected output

==> ssh-export/admin01/10-backup-appliance.conf <==
# Added for the backup appliance's nightly pull (ticket OPS-118, 2023).   # <- the reason, and how old it is
# The appliance only speaks SHA-1 key exchange, and it logs in as root with a password.
PermitRootLogin yes   # <- root may log in, with a password
PasswordAuthentication yes
KexAlgorithms +diffie-hellman-group14-sha1

==> ssh-export/admin02/10-hardening.conf <==
# Keys only, no root, named admins only.
PermitRootLogin no
PasswordAuthentication no
KbdInteractiveAuthentication no
AllowGroups ssh-admins

The client exported each server's drop-in files. admin01's file explains both findings: root may log in with a password, and SHA-1 key exchange is back, for a backup appliance from a 2023 ticket. That ticket goes in the report, because the fix starts with whoever owns the appliance. sshd uses the first value it reads for each option, and Debian's main file includes sshd_config.d/*.conf at the top, so a drop-in overrides the main file. The effective answer is sshd -T, which the client runs; with Match blocks, sshd -T -C user=root,addr=192.0.2.10 shows what applies to one user from one address.

Negative result. No drop-in or main file line allows root, passwords or added algorithms, and sshd -T agrees.

Fix. Replace or update the appliance. Until then, give it its own account with a key limited by command= and from= in authorized_keys, move the SHA-1 key exchange to the second sshd described above, set PermitRootLogin no, remove the drop-in, and reload sshd.

Does RDP require Network Level Authentication?

nmap -Pn -p 3389 --script rdp-enum-encryption,rdp-ntlm-info win01.corp.example.com

rdp-enum-encryption lists the security layers the server accepts. Network Level Authentication (NLA) makes the client prove a credential before a session starts. If Native RDP or SSL succeed alongside CredSSP (NLA), NLA is optional, so anyone who reaches the port reaches the Windows login screen and the code behind it, where pre-login flaws such as BlueKeep lived. rdp-ntlm-info prints the NetBIOS and DNS names of the host and domain and the Windows build, which recon notes. The output waits on the lab's Windows machine, so this page shows the command only.

Negative result. Only CredSSP (NLA) succeeds, and the port answers only from the admin network or an RD Gateway.

Fix. Require NLA (the "Require user authentication for remote connections by using Network Level Authentication" policy), and reach RDP only through a gateway or VPN, never from the internet.

Does WinRM accept Basic logins over HTTP?

curl -s -o /dev/null -D - -X POST http://win01.corp.example.com:5985/wsman \
  -H 'Content-Type: application/soap+xml;charset=UTF-8' -d '' | grep -i '^WWW-Authenticate'

An empty request with no credentials gets a 401 whose WWW-Authenticate headers name the methods the service accepts. Negotiate and Kerberos are the defaults. Basic in the list means Basic logins are on. Whether the service takes them over plain HTTP on 5985 depends on AllowUnencrypted, which only the host's configuration shows. The output waits on the lab's Windows machine, so this page shows the command only.

Negative result. Negotiate and Kerberos only, or HTTPS on 5986 only, from the admin network.

Fix. On each host, winrm get winrm/config/service should show AllowUnencrypted = false and winrm get winrm/config/service/auth should show Basic = false. Set both by Group Policy, and limit the listener to the admin network.

The defender sees

Each SSH check is a connection that ends before login. OpenSSH logs it to the auth log or the journal as a closed or reset connection marked [preauth] from the tester's address, and -sV adds connections that send no SSH identification at all. The methods check adds Connection closed by authenticating user root, which reads as a root attempt and which fail2ban or sshguard may count. A burst of those from one address across many hosts is worth an alert, and the same burst from a jump host's address is how the team tells the tester from a real scan. RDP connections appear in the RdpCoreTS operational log, and WinRM requests in the WinRM operational log. If the SSH servers' logs reach no central store, that goes in the report beside the finding.

Done when

Every SSH, RDP and WinRM port in scope has its version, algorithms and offered login methods recorded without a login, and each finding is tied to the configuration line that causes it.

Not covered

Password guessing and spraying (see password spraying), key theft and agent forwarding, VNC and Telnet, and jump host design.