Wildcard trust

A + token in .rhosts or hosts.equiv is a wildcard matching any host or any user, so an entry like + + trusts everyone for passwordless access. Over-broad entries, a bare +, a wildcard host, or a netgroup that resolves widely, let an attacker from any (or a spoofed) address log in without a password.

2 ನಿಮಿಷದ ಓದುಅಕ್ಟೋ 7,2026 ರಂದು ನವೀಕರಿಸಲಾಗಿದೆflorianamette1 ಕೊಡುಗೆದಾರ
ನಿಮ್ಮ ಸಹಾಯಕವನ್ನು ಕೇಳಿ (MCP)GitHub ನಲ್ಲಿ ಸಂಪಾದಿಸಿ

Traditional r-command trust-file syntax uses + as an allow wildcard: + in the host field can match any host, + in the user field can match any remote user, and + + is deliberately broad. Actual behavior depends on the implementation and authentication stack. In particular, modern PAM-based systems may treat a standalone + as a wildcard only when the service enables the promiscuous option. Rules are evaluated sequentially until the first match, so an earlier negative host, user, or netgroup rule may prevent a later wildcard from applying. A reviewer must therefore inspect the complete ordered ruleset and the service's trust configuration before concluding that passwordless access is open.

bash
# detect over-broad trust where the files are readable
grep -R '+' /etc/hosts.equiv ~*/.rhosts 2>/dev/null
# inspect PAM/service policy, then test the exact host/user match
rlogin -l <user> <target>
rsh -l <user> <target> id

Exploitation notes#

  • + + and a bare + express maximally broad trust in traditional syntax, but the service may reject or constrain them through PAM or implementation-specific policy.
  • A + only in the user field of a host entry trusts all users from that host; in the host field, all hosts for that user; read the fields carefully to see how wide the trust is.
  • Netgroup (+@group) and wildcard host entries can resolve more broadly than intended; where you can read the file, evaluate what it actually matches.
  • Preserve rule order during analysis: deny entries must appear before the allow rule they are intended to constrain because evaluation stops at the first match.
  • This is the "already open" case of trust abuse; where no wildcard exists, plant one or spoof a specific trusted host.

References#