Service bank
REMOTE ACCESS 512/tcp 513/tcp 514/tcp

R-Services

aka rlogin, rsh, rexec, rhosts

Legacy BSD remote services (rlogin/rsh/rexec) on 512-514. They trust source hosts via .rhosts and hosts.equiv, so a trust entry is a passwordless shell.

Ports

PortProtoNotes
512tcprexec
513tcprlogin
514tcprsh

Fingerprint

  • nmap shows exec/login/shell on 512-514
  • Presence of rlogind/rshd

Key files

PathHoldsSensitive
~/.rhosts trusted user@host entries (a + + means trust anyone) sensitive
/etc/hosts.equiv host-level trust relationships sensitive

Default / weak creds

  • none needed when a trust relationship exists

Exploitation primitives

  • rlogin as a user whose .rhosts trusts your host (no password)
  • rsh to run a single command on the trust
  • A `+ +` in .rhosts or hosts.equiv trusts every host and user

Overview

The r-services are ancient cleartext remote-access daemons that authenticate by trusting the source host and username rather than a password. A permissive .rhosts is an instant login.

Enumeration

Scan for them:

nmap -p512,513,514 -sV <TARGET>

Exploitation

Log in via rlogin trust:

rlogin <TARGET> -l root

Run a single command over rsh:

rsh <TARGET> "id"

Hardening

Remove r-services entirely; use SSH. If they must exist, never use + in .rhosts or hosts.equiv.

Seen on these machines 1

References