Linux rhosts and hostsequiv Misconfiguration Vulnerability

漏洞信息

漏洞名称: Linux .rhosts and hosts.equiv Misconfiguration Vulnerability

漏洞类型: 配置问题

漏洞等级: 高危

漏洞描述: 该漏洞涉及Linux系统中的.rhosts和/etc/hosts.equiv文件的错误配置或存在。这些文件用于配置远程主机信任关系,允许远程用户无需密码即可登录系统。如果这些文件配置不当,比如权限设置不正确或包含不安全的“+”符号,攻击者可以利用这些配置进行未授权的远程命令执行(如通过rlogin或rsh)。这种漏洞特别危险,因为它可能允许攻击者完全控制系统,而无需任何形式的认证。

受影响产品: Linux操作系统,广泛应用于服务器和个人计算机中,支持多种服务和应用程序的运行。由于其开源的特性,Linux在企业和个人用户中都非常流行。

漏洞解释: 该漏洞属于配置问题,具体来说是由于.rhosts和/etc/hosts.equiv文件的错误配置或存在,导致系统暴露于未授权访问的风险中。技术根源在于这些文件的权限设置不当或内容配置错误,使得攻击者可以利用这些文件绕过正常的认证机制。

影响分析: 此漏洞可能导致严重的安全风险,包括未授权的远程命令执行、数据泄露和服务中断。由于攻击者可以利用此漏洞无需认证即可执行命令,因此其危害性极高。此外,这种漏洞可以被自动化工具利用,进一步增加了其危险性。

产品名称: Linux

来源: https://github.com/projectdiscovery/nuclei-templates/blob/1dc5e4c5a7e3689548a72d7cb2a00b803fccc824/misconfiguration%2Flinux%2Flinux-rhosts-hostsequiv-check.yaml

类型: projectdiscovery/nuclei-templates:github issues

POC详情

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52

id: linux-rhosts-hostsequiv-check

info:
name: Detect presence or misconfiguration of .rhosts and hosts.equiv
author: songyaeji
severity: high
description: >
Presence or misconfiguration of .rhosts or /etc/hosts.equiv files can allow unauthorized remote command execution (rlogin, rsh).
This template detects existence and improper permissions or unsafe "+" usage in these files.
reference:
- https://isms.kisa.or.kr
- Cloud Vulnerability Assessment Guide(2024) by KISA
- https://linux.die.net/man/5/hosts.equiv
tags: linux,local,misconfig,rhosts,compliance
metadata:
verified: true
os: linux
max-request: 1
classification:
cvss-metrics: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
cvss-score: 7.8
cwe-id: CWE-732

self-contained: true

code:
- engine:
- bash
source: |
# Check if /etc/hosts.equiv exists
if [ -f /etc/hosts.equiv ]; then
echo "[FOUND] /etc/hosts.equiv exists"
ls -l /etc/hosts.equiv
echo "[CONTENT]"
cat /etc/hosts.equiv
fi

# Check if any .rhosts files exist under home directories
find /home -maxdepth 2 -name ".rhosts" 2>/dev/null | while read rhost; do
echo "[FOUND] $rhost"
ls -l "$rhost"
echo "[CONTENT]"
cat "$rhost"
done
matchers:
- type: word
part: code_1_response
words:
- "/etc/hosts.equiv"
- ".rhosts"


Linux rhosts and hostsequiv Misconfiguration Vulnerability
http://example.com/2025/07/29/github_2493036663/
作者
lianccc
发布于
2025年7月29日
许可协议